datastore

package
v1.0.8 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewLogBoltDbStorage

func NewLogBoltDbStorage(conf config.Config) (raft.LogStore, 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) (raft.LogStore, 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) (raft.LogStore, 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) (raft.LogStore, 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

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) 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) LastIndex

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

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

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 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) 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) LastIndex

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

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

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) 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) LastIndex

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

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

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) 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) LastIndex

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

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

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