db

package
v0.0.0-...-daa8459 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrorBadLogFormat = errors.New("bad log format")

Functions

func InitDB

func InitDB()

Types

type LevelDB

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

func NewLevelDB

func NewLevelDB(path string) *LevelDB

func (*LevelDB) Close

func (level *LevelDB) Close() error

func (*LevelDB) PrintLog

func (db *LevelDB) PrintLog(fileName string)

func (*LevelDB) ReadLog

func (level *LevelDB) ReadLog(index int) (*paxos.LogEntry, error)

func (*LevelDB) Restore

func (level *LevelDB) Restore(p *paxos.Proposer, a *paxos.Acceptor, statMachine sm.StatMachine) error

func (*LevelDB) WriteLog

func (level *LevelDB) WriteLog(index int, entry *paxos.LogEntry) error

type MyComparator

type MyComparator struct {
}

func (MyComparator) Compare

func (cmp MyComparator) Compare(a, b []byte) int

func (MyComparator) Name

func (cmp MyComparator) Name() string

func (MyComparator) Separator

func (cmp MyComparator) Separator(dst, a, b []byte) []byte

func (MyComparator) Successor

func (cmp MyComparator) Successor(dst, b []byte) []byte

Jump to

Keyboard shortcuts

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