Documentation ¶
Index ¶
Constants ¶
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 ¶
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) 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.