log

package
v8.23.4 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Log

type Log struct {
	*raftboltdb.BoltStore
}

Log is an object that can return information about the Raft log.

func New

func New(path string, noFreelistSync bool) (*Log, error)

New returns an instantiated Log object that provides access to the Raft log stored in a BoltDB database. It takes a path to the database file and a boolean flag to enable/disable the freelist sync. If the flag is set to true, the freelist will not be synced to disk, which can improve write performance but may increase the risk of data loss in the event of a crash or power loss. Returns an error if the BoltDB store cannot be created.

func (*Log) HasCommand added in v8.15.0

func (l *Log) HasCommand() (bool, error)

HasCommand returns whether the Raft log contains any Command log entries.

func (*Log) Indexes

func (l *Log) Indexes() (uint64, uint64, error)

Indexes returns the first and last indexes.

func (*Log) LastCommandIndex

func (l *Log) LastCommandIndex(fi, li uint64) (uint64, error)

LastCommandIndex returns the index of the last Command log entry written to the Raft log. Returns an index of zero if no such log exists.

func (*Log) Stats

func (l *Log) Stats() bbolt.Stats

Stats returns stats about the BBoltDB database.

Jump to

Keyboard shortcuts

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