Documentation ¶
Index ¶
- type Config
- type DataStore
- func (s *DataStore) Apply(log *raft.Log) any
- func (s *DataStore) Close() error
- func (s *DataStore) Delete(key []byte) error
- func (s *DataStore) DeleteAll() error
- func (s *DataStore) DeleteMany(keys [][]byte) error
- func (s *DataStore) DeletePrefix(prefix []byte) error
- func (s *DataStore) DeleteRange(min, max []byte) (keys [][]byte, err error)
- func (s *DataStore) Get(key []byte) ([]byte, error)
- func (s *DataStore) GetMany(keys [][]byte) ([][]byte, error)
- func (s *DataStore) GetPrefix(prefix []byte) (keys, values [][]byte, err error)
- func (s *DataStore) GetRange(min, max []byte, count int) (keys, values [][]byte, err error)
- func (s *DataStore) Restore(r io.ReadCloser) error
- func (s *DataStore) Set(key, value []byte) error
- func (s *DataStore) SetMany(keys, values [][]byte) error
- func (s *DataStore) Snapshot() (raft.FSMSnapshot, error)
- func (s *DataStore) Stats() map[string]string
- type LogStore
- func (s *LogStore) Close() error
- func (s *LogStore) DeleteAll() error
- func (s *LogStore) DeleteRange(min, max uint64) error
- func (s *LogStore) FirstIndex() (uint64, error)
- func (s *LogStore) GetLog(index uint64, log *raft.Log) error
- func (s *LogStore) LastIndex() (uint64, error)
- func (s *LogStore) Stats() map[string]string
- func (s *LogStore) StoreLog(log *raft.Log) error
- func (s *LogStore) StoreLogs(logs []*raft.Log) error
- type Logger
- type StableStore
- func (s *StableStore) Close()
- func (s *StableStore) Get(key []byte) ([]byte, error)
- func (s *StableStore) GetUint64(key []byte) (uint64, error)
- func (s *StableStore) PrintConfig(out io.Writer)
- func (s *StableStore) Set(key []byte, val []byte) error
- func (s *StableStore) SetUint64(key []byte, val uint64) error
- type StableStoreConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Path string InMemory bool SyncWrites bool MaxLevels int LevelSizeMultiplier int BaseTableSize int64 BaseLevelSize int64 ValueLogFileSize int64 ValueLogMaxEntries uint32 NumMemtables int MemTableSize int64 BlockSize int BlockCacheSize int64 NumLevelZeroTables int NumLevelZeroTablesStall int NumCompactors int CompactL0OnClose bool Compression bool GCEnabled bool GCInterval time.Duration GCDiscardRatio float64 Logger Logger }
func DefaultDataStoreConfig ¶
func DefaultLogStoreConfig ¶
type DataStore ¶
type DataStore struct {
// contains filtered or unexported fields
}
func NewDataStore ¶
func (*DataStore) DeleteMany ¶
func (*DataStore) DeletePrefix ¶
func (*DataStore) DeleteRange ¶
type LogStore ¶
type LogStore struct {
// contains filtered or unexported fields
}
func NewLogStore ¶
func (*LogStore) DeleteRange ¶
DeleteRange deletes a range of log entries. The range is inclusive.
func (*LogStore) FirstIndex ¶
FirstIndex returns the first index written. 0 for no entries.
type StableStore ¶
type StableStore struct {
// contains filtered or unexported fields
}
StableStore is used to provide stable storage of key configurations to raft consensus algorithm.
func NewStableStore ¶
func NewStableStore(config *StableStoreConfig) (*StableStore, error)
func (*StableStore) Close ¶
func (s *StableStore) Close()
func (*StableStore) Get ¶
func (s *StableStore) Get(key []byte) ([]byte, error)
Get returns the value for key, or an empty byte slice if key was not found.
func (*StableStore) GetUint64 ¶
func (s *StableStore) GetUint64(key []byte) (uint64, error)
GetUint64 returns the uint64 value for key, or 0 if key was not found.
func (*StableStore) PrintConfig ¶
func (s *StableStore) PrintConfig(out io.Writer)
type StableStoreConfig ¶
type StableStoreConfig struct { Path string // Config directory path. Sync bool // Fsync after each write. InMemory bool }
func DefaultStableStoreConfig ¶
func DefaultStableStoreConfig(path string) *StableStoreConfig
func (*StableStoreConfig) WithInMemory ¶
func (c *StableStoreConfig) WithInMemory(inMemory bool) *StableStoreConfig
func (*StableStoreConfig) WithPath ¶
func (c *StableStoreConfig) WithPath(path string) *StableStoreConfig
func (*StableStoreConfig) WithSync ¶
func (c *StableStoreConfig) WithSync(sync bool) *StableStoreConfig
Click to show internal directories.
Click to hide internal directories.