storage

package
v0.0.0-...-e47cf43 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EntryStore

type EntryStore struct {
	sync.Mutex
	io.Closer
	// contains filtered or unexported fields
}

EntryStore implements the Storage interface backed by an SS table. Specifically we use the implementation from Badger for storing entries in sorted manner.

func NewEntryStore

func NewEntryStore(entryDir string) (*EntryStore, error)

func (*EntryStore) Append

func (es *EntryStore) Append(entries []pb.Entry) error

func (*EntryStore) ApplySnapshot

func (es *EntryStore) ApplySnapshot(snap pb.Snapshot) error

func (*EntryStore) Close

func (es *EntryStore) Close() error

func (*EntryStore) Compact

func (es *EntryStore) Compact(compactIndex uint64) error

func (*EntryStore) CreateSnapshot

func (es *EntryStore) CreateSnapshot(i uint64, cs *pb.ConfState, data []byte) (pb.Snapshot, error)

func (*EntryStore) Entries

func (es *EntryStore) Entries(lo, hi, maxSize uint64) ([]pb.Entry, error)

func (*EntryStore) FirstIndex

func (es *EntryStore) FirstIndex() (uint64, error)

func (*EntryStore) InitialState

func (es *EntryStore) InitialState() (pb.HardState, pb.ConfState, error)

func (*EntryStore) LastIndex

func (es *EntryStore) LastIndex() (uint64, error)

func (*EntryStore) SetHardState

func (es *EntryStore) SetHardState(st pb.HardState) error

func (*EntryStore) Snapshot

func (es *EntryStore) Snapshot() (pb.Snapshot, error)

func (*EntryStore) Term

func (es *EntryStore) Term(i uint64) (uint64, error)

type RaftStorageEngine

type RaftStorageEngine interface {
	raft.Storage
	SetHardState(st pb.HardState) error
	ApplySnapshot(snap pb.Snapshot) error
	Compact(compactIndex uint64) error
	Append(entries []pb.Entry) error
	CreateSnapshot(i uint64, cs *pb.ConfState, data []byte) (pb.Snapshot, error)
}

Jump to

Keyboard shortcuts

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