kvstore

package
v0.0.0-...-e532b39 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2019 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Configuration values for KV Store

Index

Constants

View Source
const (
	B uint64 = 1 << (iota * 10)
	KB
	MB
	GB
	TB
	PB
	EB
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CliftonDBKVStore

type CliftonDBKVStore struct {
	KVStoreRoot         string
	SSTablesRoot        string
	WALRoot             string
	KVStoreLockFilePath string
	// contains filtered or unexported fields
}

func NewCliftonDBKVStore

func NewCliftonDBKVStore(dirPath string, logPath string) (*CliftonDBKVStore, error)

func (*CliftonDBKVStore) Delete

func (s *CliftonDBKVStore) Delete(key types.KeyType) (ok bool, err error)

func (*CliftonDBKVStore) EnsureDirsExist

func (s *CliftonDBKVStore) EnsureDirsExist() error

func (*CliftonDBKVStore) Exists

func (s *CliftonDBKVStore) Exists(key types.KeyType) (ok bool, err error)

func (*CliftonDBKVStore) Get

func (s *CliftonDBKVStore) Get(key types.KeyType) (data types.ValueType, ok bool, err error)

func (*CliftonDBKVStore) Put

func (s *CliftonDBKVStore) Put(key types.KeyType, data types.ValueType) (err error)

func (*CliftonDBKVStore) ReadLockFile

func (s *CliftonDBKVStore) ReadLockFile() (data KVStoreLockFileData, err error)

func (*CliftonDBKVStore) Remove

func (s *CliftonDBKVStore) Remove(key types.KeyType) (ok bool, err error)

func (*CliftonDBKVStore) WriteLockFile

func (s *CliftonDBKVStore) WriteLockFile(data KVStoreLockFileData) error

type KVStore

type KVStore interface {
	Get(keyType types.KeyType) (data types.ValueType, ok bool, err error)
	Put(key types.KeyType, data types.ValueType) (err error)
	Remove(key types.KeyType) (ok bool, err error)
	Exists(key types.KeyType) (ok bool, err error)
}

func BootstrapFromDir

func BootstrapFromDir(dirPath string) *KVStore

type KVStoreConfig

type KVStoreConfig struct {
	Log         LogStorageConfig `yaml:"wal-log"`
	SSTable     SSTableConfig    `yaml:"sstable"`
	DataDirPath string           `yaml:"data-dir"`
}

type KVStoreLockFileData

type KVStoreLockFileData struct {
	PartitionId    uint32 `yaml:"partition-id"`
	WALCommitIndex uint64 `yaml:"wal-commit-index"`
	WALApplyIndex  uint64 `yaml:"wal-apply-index"`
}

type KVStoreMetadata

type KVStoreMetadata struct {
	SStableLevel0 []string
	SStableLevel1 []string
	SStableLevel2 []string
	SStableLevel3 []string
}

type KVStoreOpenOptions

type KVStoreOpenOptions interface {
	Apply(options *KVStoreOptions)
}

type KVStoreOptions

type KVStoreOptions struct {
	WALSegmentSizeBytes int
	DataBlockSize       int
	IndexBlockSize      int
}

type LogStorageConfig

type LogStorageConfig struct {
	SegmentSize string `yaml:"segment-size"`
}

type PutCmd

type PutCmd struct {
}

type SSTableConfig

type SSTableConfig struct {
	IndexBlockSize int `yaml:"index-block-size"`
	DataBlockSize  int `yaml:"data-block-size"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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