Documentation ¶
Index ¶
- Variables
- func CheckEngine(dbPath string, createDatabaseIfNotExists bool, dbEngine hivedb.Engine, ...) (hivedb.Engine, error)
- func NewRocksDB(path string) (*rocksdb.RocksDB, error)
- func StoreWithDefaultSettings(path string, createDatabaseIfNotExists bool, dbEngine hivedb.Engine, ...) (kvstore.KVStore, error)
- type Config
- type DBInstance
Constants ¶
This section is empty.
Variables ¶
View Source
var ( AllowedEnginesDefault = []hivedb.Engine{ hivedb.EngineAuto, hivedb.EngineMapDB, hivedb.EngineRocksDB, } AllowedEnginesStorage = []hivedb.Engine{ hivedb.EngineRocksDB, } AllowedEnginesStorageAuto = append(AllowedEnginesStorage, hivedb.EngineAuto) )
View Source
var ( ErrEpochPruned = ierrors.New("epoch pruned") ErrNoPruningNeeded = ierrors.New("no pruning needed") ErrDatabaseFull = ierrors.New("database full") ErrDatabaseShutdown = ierrors.New("cannot open DBInstance that is shutdown") ErrDatabaseNotClosed = ierrors.New("cannot open DBInstance that is not closed") )
Functions ¶
func CheckEngine ¶
func CheckEngine(dbPath string, createDatabaseIfNotExists bool, dbEngine hivedb.Engine, allowedEngines ...hivedb.Engine) (hivedb.Engine, error)
CheckEngine is a wrapper around hivedb.CheckEngine to throw a custom error message in case of engine mismatch.
func NewRocksDB ¶
NewRocksDB creates a new RocksDB instance.
func StoreWithDefaultSettings ¶
func StoreWithDefaultSettings(path string, createDatabaseIfNotExists bool, dbEngine hivedb.Engine, allowedEngines ...hivedb.Engine) (kvstore.KVStore, error)
StoreWithDefaultSettings returns a kvstore with default settings. It also checks if the database engine is correct.
Types ¶
type Config ¶
func (Config) WithDirectory ¶
type DBInstance ¶
type DBInstance struct {
// contains filtered or unexported fields
}
func NewDBInstance ¶
func NewDBInstance(dbConfig Config, openedCallback func(d *DBInstance)) *DBInstance
func (*DBInstance) Close ¶
func (d *DBInstance) Close()
func (*DBInstance) CloseWithoutLocking ¶
func (d *DBInstance) CloseWithoutLocking()
func (*DBInstance) Flush ¶
func (d *DBInstance) Flush()
func (*DBInstance) KVStore ¶
func (d *DBInstance) KVStore() kvstore.KVStore
func (*DBInstance) LockAccess ¶
func (d *DBInstance) LockAccess()
func (*DBInstance) Open ¶
func (d *DBInstance) Open() error
Open re-opens a closed DBInstance. It must only be called while holding a lock on DBInstance, otherwise it might cause a race condition and corruption of node's state.
func (*DBInstance) Shutdown ¶
func (d *DBInstance) Shutdown()
func (*DBInstance) UnlockAccess ¶
func (d *DBInstance) UnlockAccess()
Click to show internal directories.
Click to hide internal directories.