raftutil

package
v1.5.12 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2023 License: MPL-2.0 Imports: 19 Imported by: 1

Documentation

Overview

Code generated by go generate; DO NOT EDIT.

Index

Constants

This section is empty.

Variables

View Source
var ErrNoMoreLogs = fmt.Errorf("no more logs")

Functions

func FindFileInPath added in v1.0.0

func FindFileInPath(file string, p string) (path string, err error)

FindFileInPath searches for file in path p

func FindRaftDir added in v1.0.0

func FindRaftDir(p string) (raftpath string, err error)

FindRaftDir finds raft.db and returns parent directory path

func FindRaftFile added in v1.0.0

func FindRaftFile(p string) (raftpath string, err error)

FindRaftFile finds raft.db and returns path

func LogEntries

func LogEntries(p string) (<-chan interface{}, <-chan error, error)

LogEntries reads the raft logs found in the data directory found at the path `p`, and returns a channel of logs, and a channel of warnings. If opening the raft state returns an error, both channels will be nil.

func RaftStateInfo

func RaftStateInfo(p string) (store *raftboltdb.BoltStore, firstIdx uint64, lastIdx uint64, err error)

RaftStateInfo returns info about the nomad state, as found in the passed data-dir directory

func RestoreFromArchive added in v1.2.0

func RestoreFromArchive(archive io.Reader, filter *nomad.FSMFilter) (*state.StateStore, *raft.SnapshotMeta, error)

func StateAsMap added in v1.2.0

func StateAsMap(store *state.StateStore) map[string][]interface{}

StateAsMap returns a json-able representation of the state

Types

type FSMHelper added in v1.2.0

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

func NewFSM added in v1.2.0

func NewFSM(p string) (*FSMHelper, error)

func (*FSMHelper) ApplyAll added in v1.2.0

func (f *FSMHelper) ApplyAll() (index uint64, term uint64, err error)

func (*FSMHelper) ApplyNext added in v1.2.0

func (f *FSMHelper) ApplyNext() (index uint64, term uint64, err error)

func (*FSMHelper) ApplyUntil added in v1.2.0

func (f *FSMHelper) ApplyUntil(stopIdx uint64) (idx uint64, term uint64, err error)

ApplyUntil applies all raft entries until (inclusive) the passed index.

func (*FSMHelper) Close added in v1.2.0

func (f *FSMHelper) Close()

func (*FSMHelper) State added in v1.2.0

func (f *FSMHelper) State() *state.StateStore

func (*FSMHelper) StateAsMap added in v1.2.0

func (f *FSMHelper) StateAsMap() map[string][]interface{}

Jump to

Keyboard shortcuts

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