metadb

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2024 License: MPL-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// FileName is the default file name for the bolt db file.
	FileName = "wal-meta.db"

	// *Bucket are the names used for internal bolt buckets
	MetaBucket   = "wal-meta"
	StableBucket = "stable"

	// We just need one key for now so use the byte 'm' for meta arbitrarily.
	MetaKey = "m"
)

Variables

View Source
var (
	// ErrUnintialized is returned when any call is made before Load has opened
	// the DB file.
	ErrUnintialized = errors.New("uninitialized")
)

Functions

This section is empty.

Types

type BoltMetaDB

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

BoltMetaDB implements types.MetaStore using BoltDB as a reliable persistent store. See repo README for reasons for this design choice and performance implications.

func (*BoltMetaDB) Close

func (db *BoltMetaDB) Close() error

Close implements io.Closer

func (*BoltMetaDB) CommitState

func (db *BoltMetaDB) CommitState(state types.PersistentState) error

CommitState must atomically replace all persisted metadata in the current store with the set provided. It must not return until the data is persisted durably and in a crash-safe way otherwise the guarantees of the WAL will be compromised. The WAL will only ever call this in a single thread at one time and it will never be called concurrently with Load however it may be called concurrently with Get/SetStable operations.

func (*BoltMetaDB) Load

func (db *BoltMetaDB) Load(dir string) (types.PersistentState, error)

Load loads the existing persisted state. If there is no existing state implementations are expected to create initialize new storage and return an empty state.

Jump to

Keyboard shortcuts

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