Documentation ¶
Index ¶
- type RavelLogStore
- func (r *RavelLogStore) DeleteRange(min uint64, max uint64) error
- func (r *RavelLogStore) FirstIndex() (uint64, error)
- func (r *RavelLogStore) GetLog(index uint64, raftLog *raft.Log) error
- func (r *RavelLogStore) LastIndex() (uint64, error)
- func (r *RavelLogStore) StoreLog(l *raft.Log) error
- func (r *RavelLogStore) StoreLogs(logs []*raft.Log) error
- type RavelStableStore
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RavelLogStore ¶
type RavelLogStore struct {
Db *db.RavelDatabase
}
RavelLogStore implements raft.LogStore interface. The functions define the operations possible on the Logs which is maintained by every instance of raft.Raft
func NewRavelLogStore ¶
func NewRavelLogStore(logDBPath string) (*RavelLogStore, error)
NewRavelLogStore creates a new instance of RavelLogStore, logDBPath specifies the directory path to initialise the internal db.RavelDatabase instance. An entry in the Logs is of type raft.Log
func (*RavelLogStore) DeleteRange ¶
func (r *RavelLogStore) DeleteRange(min uint64, max uint64) error
DeleteRange deletes the entries from "min" to "max" position (both inclusive) in the Logs
func (*RavelLogStore) FirstIndex ¶
func (r *RavelLogStore) FirstIndex() (uint64, error)
FirstIndex returns the Index property of the first entry in the Logs.
func (*RavelLogStore) GetLog ¶
func (r *RavelLogStore) GetLog(index uint64, raftLog *raft.Log) error
GetLog writes the log on position "index" to the pointer "raftLog"
func (*RavelLogStore) LastIndex ¶
func (r *RavelLogStore) LastIndex() (uint64, error)
LastIndex returns the Index property of the last entry in the Logs
type RavelStableStore ¶
type RavelStableStore struct {
Db *db.RavelDatabase
}
RavelStableStore implements the raft.StableStore interface. It stores the configuration for raft.Raft
func NewRavelStableStore ¶
func NewRavelStableStore(stableStoreDBPath string) (*RavelStableStore, error)
NewRavelStableStore creates a new instance of RavelStableStore
func (*RavelStableStore) Get ¶
func (s *RavelStableStore) Get(key []byte) ([]byte, error)
Get returns the value for the provided key
func (*RavelStableStore) GetUint64 ¶
func (s *RavelStableStore) GetUint64(key []byte) (uint64, error)
GetUint64 returns the value for the given key