store

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2018 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Iterate

func Iterate(logs raft.LogStore, r *Range, handler Handler) error

Iterate through all command logs in the given store within the given range.

func Replay

func Replay(logs raft.LogStore, snaps raft.SnapshotStore, r *Range, dir string) error

Replay the commands in the given logs and snapshot stores using the given dir as database directory.

Types

type Handler

type Handler func(uint64, *raft.Log) error

Handler handles a single command log yielded by Iterate.

type Range

type Range struct {
	First uint64
	Last  uint64
}

Range contains the first and last index of a dump.

func DefaultRange

func DefaultRange(logs raft.LogStore) (*Range, error)

DefaultRange returns a Range spanning all available indexes.

func HeadRange

func HeadRange(logs raft.LogStore, n int) (*Range, error)

HeadRange returns a range that includes only the first n entries.

func TailRange

func TailRange(logs raft.LogStore, n int) (*Range, error)

TailRange returns a range that includes only the last n entries.

Jump to

Keyboard shortcuts

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