options

package
v0.0.0-...-7788d34 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 27, 2024 License: Apache-2.0, Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Bitcask = iota
	Leveldb
)

Variables

View Source
var Options = &KvsOptions{
	HostName:       "LocalKvs",
	Listen:         "",
	Port:           3000,
	Home:           "/tmp/kvs",
	LockFilename:   "kvs.lock",
	DataFileSuffix: ".data",
	HintFileSuffix: ".hint",

	MaxFileSize: 1 << 26,
}

Todo: Sync Strategy, Hint File CRC Check, Merge Policy(https://docs.basho.com/riak/kv/2.0.0/setup/planning/backend/bitcask/#merge-policy)

Functions

This section is empty.

Types

type KvsOptions

type KvsOptions struct {
	// Server options
	HostName string
	Listen   string
	Port     int

	// Backend engine type, ref const: Bitcask, Leveldb
	EngineType int

	// Storage engine options
	Home           string
	DataDir        string
	DataFileSuffix string
	HintFileSuffix string
	LockFilename   string
	MaxFileSize    uint64
}

func (*KvsOptions) GetDataFilePath

func (o *KvsOptions) GetDataFilePath(fileId uint32) string

Get data file path e.g. if fileId == 0, {KVS_HOME}/data/000.data

func (*KvsOptions) GetFpFunc

func (o *KvsOptions) GetFpFunc(active bool) func(int) string

func (*KvsOptions) GetHintFilePath

func (o *KvsOptions) GetHintFilePath(fileId uint32) string

func (*KvsOptions) GetLockFilePath

func (o *KvsOptions) GetLockFilePath() string

func (*KvsOptions) Print

func (o *KvsOptions) Print()

Print all of kvs options

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL