Documentation ¶
Index ¶
- Variables
- func CheckEngine(dbPath string, createDatabaseIfNotExists bool, dbEngine hivedb.Engine, ...) (hivedb.Engine, error)
- func NewPebbleDB(directory string, reportCompactionRunning func(running bool), ...) (*pebbleDB.DB, error)
- func NewRocksDB(path string) (*rocksdb.RocksDB, error)
- func StoreWithDefaultSettings(path string, createDatabaseIfNotExists bool, dbEngine hivedb.Engine, ...) (kvstore.KVStore, error)
- type Cleanup
- type Database
- func (db *Database) CompactionRunning() bool
- func (db *Database) CompactionSupported() bool
- func (db *Database) Engine() hivedb.Engine
- func (db *Database) Events() *Events
- func (db *Database) KVStore() kvstore.KVStore
- func (db *Database) Metrics() *metrics.DatabaseMetrics
- func (db *Database) Size() (int64, error)
- type Events
Constants ¶
This section is empty.
Variables ¶
View Source
var ( AllowedEnginesDefault = []hivedb.Engine{ hivedb.EngineAuto, hivedb.EngineMapDB, hivedb.EnginePebble, hivedb.EngineRocksDB, } AllowedEnginesStorage = []hivedb.Engine{ hivedb.EnginePebble, hivedb.EngineRocksDB, } AllowedEnginesStorageAuto = append(AllowedEnginesStorage, hivedb.EngineAuto) )
View Source
var ( // ErrNothingToCleanUp is returned when nothing is there to clean up in the database. ErrNothingToCleanUp = errors.New("Nothing to clean up in the databases") )
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 NewPebbleDB ¶
func NewPebbleDB(directory string, reportCompactionRunning func(running bool), enableFilter bool) (*pebbleDB.DB, error)
NewPebbleDB creates a new pebble DB instance.
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 Cleanup ¶
func (*Cleanup) MarshalJSON ¶
type Database ¶
type Database struct {
// contains filtered or unexported fields
}
Database holds the underlying KVStore and database specific functions.
func New ¶
func New(databaseDirectory string, kvStore kvstore.KVStore, engine hivedb.Engine, metrics *metrics.DatabaseMetrics, events *Events, compactionSupported bool, compactionRunningFunc func() bool) *Database
New creates a new Database instance.
func (*Database) CompactionRunning ¶
CompactionRunning returns whether a compaction is running.
func (*Database) CompactionSupported ¶
CompactionSupported returns whether the database engine supports compaction.
func (*Database) Metrics ¶
func (db *Database) Metrics() *metrics.DatabaseMetrics
Metrics returns the database metrics.
Click to show internal directories.
Click to hide internal directories.