datastore

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BoltDbStore

type BoltDbStore struct {
	// contains filtered or unexported fields
}

BoltDbStore is a struct that implements the raft.LogStore interface It uses BoltDB as the underlying storage and a read-write mutex for concurrency control

func (*BoltDbStore) DeleteRange

func (ds *BoltDbStore) DeleteRange(min, max uint64) error

DeleteRange is a method on BoltDbStore that deletes a range of log entries

func (*BoltDbStore) FirstIndex

func (ds *BoltDbStore) FirstIndex() (uint64, error)

FirstIndex is a method on BoltDbStore that returns the first index in the log

func (*BoltDbStore) Get added in v1.0.9

func (ds *BoltDbStore) Get(key []byte) ([]byte, error)

func (*BoltDbStore) GetLog

func (ds *BoltDbStore) GetLog(index uint64, log *raft.Log) error

GetLog is a method on BoltDbStore that retrieves a log entry by its index

func (*BoltDbStore) GetUint64 added in v1.0.9

func (ds *BoltDbStore) GetUint64(key []byte) (uint64, error)

func (*BoltDbStore) LastIndex

func (ds *BoltDbStore) LastIndex() (uint64, error)

LastIndex is a method on BoltDbStore that returns the last index in the log

func (*BoltDbStore) Set added in v1.0.9

func (ds *BoltDbStore) Set(key []byte, val []byte) error

func (*BoltDbStore) SetUint64 added in v1.0.9

func (ds *BoltDbStore) SetUint64(key []byte, val uint64) error

func (*BoltDbStore) StoreLog

func (ds *BoltDbStore) StoreLog(log *raft.Log) error

StoreLog is a method on BoltDbStore that stores a single log entry

func (*BoltDbStore) StoreLogs

func (ds *BoltDbStore) StoreLogs(logs []*raft.Log) error

StoreLogs is a method on BoltDbStore that stores multiple log entries

type DataStore added in v1.0.9

type DataStore interface {
	raft.LogStore
	raft.StableStore
}

func NewLogBoltDbStorage

func NewLogBoltDbStorage(conf config.Config) (DataStore, error)

NewLogBoltDbStorage is a function that creates a new BoltDB store It takes a configuration map as input and returns a raft.LogStore and an error

func NewLogFlyDbStorage

func NewLogFlyDbStorage(conf config.Config) (DataStore, error)

NewLogFlyDbStorage is a function that creates a new FlyDB store It takes a configuration map as input and returns a raft.LogStore and an error

func NewLogInMemStorage

func NewLogInMemStorage(conf config.Config) (DataStore, error)

NewLogInMemStorage is a function that creates a new in-memory store It returns a raft.LogStore and an error

func NewLogRocksDbStorage

func NewLogRocksDbStorage(conf config.Config) (DataStore, error)

NewLogRocksDbStorage is a function that creates a new RocksDB store It takes a configuration map as input and returns a raft.LogStore and an error

type FlyDbStore

type FlyDbStore struct {
	// contains filtered or unexported fields
}

FlyDbStore is a struct that implements the raft.LogStore interface It uses FlyDB as the underlying storage and a read-write mutex for concurrency control

func (*FlyDbStore) DeleteRange

func (fds *FlyDbStore) DeleteRange(min, max uint64) error

DeleteRange is a method on FlyDbStore that deletes a range of log entries

func (*FlyDbStore) FirstIndex

func (fds *FlyDbStore) FirstIndex() (uint64, error)

FirstIndex is a method on FlyDbStore that returns the first index in the log

func (*FlyDbStore) Get added in v1.0.9

func (fds *FlyDbStore) Get(key []byte) ([]byte, error)

Get retrieves the value associated with `key`; returns []byte if key exists

func (*FlyDbStore) GetLog

func (fds *FlyDbStore) GetLog(index uint64, log *raft.Log) error

GetLog is a method on FlyDbStore that retrieves a log entry by its index

func (*FlyDbStore) GetUint64 added in v1.0.9

func (fds *FlyDbStore) GetUint64(key []byte) (uint64, error)

GetUint64 is used to retrieve the Uint64 value of `key`

func (*FlyDbStore) LastIndex

func (fds *FlyDbStore) LastIndex() (uint64, error)

LastIndex is a method on FlyDbStore that returns the last index in the log

func (*FlyDbStore) Set added in v1.0.9

func (fds *FlyDbStore) Set(key []byte, val []byte) error

Set is used to store key/value pair

func (*FlyDbStore) SetUint64 added in v1.0.9

func (fds *FlyDbStore) SetUint64(key []byte, val uint64) error

SetUint64 is used to set Uint64 value for `key`

func (*FlyDbStore) StoreLog

func (fds *FlyDbStore) StoreLog(log *raft.Log) error

StoreLog is a method on FlyDbStore that stores a single log entry

func (*FlyDbStore) StoreLogs

func (fds *FlyDbStore) StoreLogs(logs []*raft.Log) error

StoreLogs is a method on FlyDbStore that stores multiple log entries since FlyDB currently does not support transactions, please be aware that in case of errors, already written data will persist.

type InMemStore

type InMemStore struct {
	// contains filtered or unexported fields
}

InMemStore is a struct that implements the raft.LogStore interface It uses a map as the underlying storage and a read-write mutex for concurrency control

func (*InMemStore) DeleteRange

func (ds *InMemStore) DeleteRange(min, max uint64) error

DeleteRange is a method on InMemStore that deletes a range of log entries

func (*InMemStore) FirstIndex

func (ds *InMemStore) FirstIndex() (uint64, error)

FirstIndex is a method on InMemStore that returns the first index in the log

func (*InMemStore) Get added in v1.0.9

func (ds *InMemStore) Get(key []byte) ([]byte, error)

func (*InMemStore) GetLog

func (ds *InMemStore) GetLog(index uint64, log *raft.Log) error

GetLog is a method on InMemStore that retrieves a log entry by its index

func (*InMemStore) GetUint64 added in v1.0.9

func (ds *InMemStore) GetUint64(key []byte) (uint64, error)

func (*InMemStore) LastIndex

func (ds *InMemStore) LastIndex() (uint64, error)

LastIndex is a method on InMemStore that returns the last index in the log

func (*InMemStore) Set added in v1.0.9

func (ds *InMemStore) Set(key []byte, val []byte) error

func (*InMemStore) SetUint64 added in v1.0.9

func (ds *InMemStore) SetUint64(key []byte, val uint64) error

func (*InMemStore) StoreLog

func (ds *InMemStore) StoreLog(log *raft.Log) error

StoreLog is a method on InMemStore that stores a single log entry

func (*InMemStore) StoreLogs

func (ds *InMemStore) StoreLogs(logs []*raft.Log) error

StoreLogs is a method on InMemStore that stores multiple log entries

type RocksDbStore

type RocksDbStore struct {
	// contains filtered or unexported fields
}

RocksDbStore is a struct that implements the raft.LogStore interface It uses BoltDB as the underlying storage and a read-write mutex for concurrency control

func (*RocksDbStore) DeleteRange

func (rds *RocksDbStore) DeleteRange(min, max uint64) error

DeleteRange is a method on RocksDbStore that deletes a range of log entries

func (*RocksDbStore) FirstIndex

func (rds *RocksDbStore) FirstIndex() (uint64, error)

FirstIndex is a method on RocksDbStore that returns the first index in the log

func (*RocksDbStore) Get added in v1.0.9

func (rds *RocksDbStore) Get(key []byte) ([]byte, error)

func (*RocksDbStore) GetLog

func (rds *RocksDbStore) GetLog(index uint64, log *raft.Log) error

GetLog is a method on RocksDbStore that retrieves a log entry by its index

func (*RocksDbStore) GetUint64 added in v1.0.9

func (rds *RocksDbStore) GetUint64(key []byte) (uint64, error)

func (*RocksDbStore) LastIndex

func (rds *RocksDbStore) LastIndex() (uint64, error)

LastIndex is a method on RocksDbStore that returns the last index in the log

func (*RocksDbStore) Set added in v1.0.9

func (rds *RocksDbStore) Set(key []byte, val []byte) error

func (*RocksDbStore) SetUint64 added in v1.0.9

func (rds *RocksDbStore) SetUint64(key []byte, val uint64) error

func (*RocksDbStore) StoreLog

func (rds *RocksDbStore) StoreLog(log *raft.Log) error

StoreLog is a method on RocksDbStore that stores a single log entry

func (*RocksDbStore) StoreLogs

func (rds *RocksDbStore) StoreLogs(logs []*raft.Log) error

StoreLogs is a method on RocksDbStore that stores multiple log entries

Jump to

Keyboard shortcuts

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