Back to godoc.org
github.com/hashicorp/raft-mdb

package raftmdb

v0.0.0 (9ee9663)
Latest Go to latest
Published: Aug 24, 2018 | License: MPL-2.0 | Module: github.com/hashicorp/raft-mdb

Index

type MDBStore

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

MDBStore provides an implementation of LogStore and StableStore, all backed by a single MDB database.

func NewMDBStore

func NewMDBStore(base string) (*MDBStore, error)

NewMDBStore returns a new MDBStore and potential error. Requres a base directory from which to operate. Uses the default maximum size.

func NewMDBStoreWithSize

func NewMDBStoreWithSize(base string, maxSize uint64) (*MDBStore, error)

NewMDBStore returns a new MDBStore and potential error. Requres a base directory from which to operate, and a maximum size. If maxSize is not 0, a default value is used.

func (*MDBStore) Close

func (m *MDBStore) Close() error

Close is used to gracefully shutdown the MDB store

func (*MDBStore) DeleteRange

func (m *MDBStore) DeleteRange(minIdx, maxIdx uint64) error

Deletes a range of log entries. The range is inclusive.

func (*MDBStore) FirstIndex

func (m *MDBStore) FirstIndex() (uint64, error)

func (*MDBStore) Get

func (m *MDBStore) Get(key []byte) ([]byte, error)

Get a K/V pair

func (*MDBStore) GetLog

func (m *MDBStore) GetLog(index uint64, logOut *raft.Log) error

Gets a log entry at a given index

func (*MDBStore) GetUint64

func (m *MDBStore) GetUint64(key []byte) (uint64, error)

func (*MDBStore) LastIndex

func (m *MDBStore) LastIndex() (uint64, error)

func (*MDBStore) Set

func (m *MDBStore) Set(key []byte, val []byte) error

Set a K/V pair

func (*MDBStore) SetUint64

func (m *MDBStore) SetUint64(key []byte, val uint64) error

func (*MDBStore) StoreLog

func (m *MDBStore) StoreLog(log *raft.Log) error

Stores a log entry

func (*MDBStore) StoreLogs

func (m *MDBStore) StoreLogs(logs []*raft.Log) error

Stores multiple log entries

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
f or F : Jump to identifier