wal

package
v0.0.0-...-7eb9833 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	PersistentLogFile = "wal.bin"
	StateFile         = "state.bin"
)

PersistentLogFile name of the log file

View Source
var ErrInvalidVarint = errors.New("invalid varint32 encountered")

ErrInvalidVarint error when the data is corrupt

Functions

This section is empty.

Types

type Iterator

type Iterator interface {
	Next() (*pb.WalEntry, error)
	Close() error
}

Iterator interface for persistent logs iterator

type State

type State struct {
	Term     int64  `json:"Term"`
	VotedFor string `json:"VotedFor"`
}

State state of the raft instance

type Wal

type Wal interface {
	Open()
	Close() error
	Append(entry *pb.WalEntry) error
	Size() int
	WALFileName() string
	Iterator() (Iterator, error)
	WriteState(int64, string) error
	ReadState() (int64, string, error)
}

Wal represents the wal

func NewWAL

func NewWAL(walDir string, logger *logrus.Logger, ev *events.Events, isTestMode bool) Wal

NewWAL Creates new storage

Jump to

Keyboard shortcuts

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