raft-mdb: github.com/hashicorp/raft-mdb Index | Files

package raftmdb

import "github.com/hashicorp/raft-mdb"

Index

Package Files

mdb_store.go util.go

type MDBStore Uses

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 Uses

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 Uses

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 Uses

func (m *MDBStore) Close() error

Close is used to gracefully shutdown the MDB store

func (*MDBStore) DeleteRange Uses

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

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

func (*MDBStore) FirstIndex Uses

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

func (*MDBStore) Get Uses

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

Get a K/V pair

func (*MDBStore) GetLog Uses

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

Gets a log entry at a given index

func (*MDBStore) GetUint64 Uses

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

func (*MDBStore) LastIndex Uses

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

func (*MDBStore) Set Uses

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

Set a K/V pair

func (*MDBStore) SetUint64 Uses

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

func (*MDBStore) StoreLog Uses

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

Stores a log entry

func (*MDBStore) StoreLogs Uses

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

Stores multiple log entries

Package raftmdb imports 8 packages (graph) and is imported by 55 packages. Updated 2019-10-31. Refresh now. Tools for package owners.