rocksdb

package
v0.0.0-...-1aaebbc Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2021 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

DB interface represents the capabilities exposed by the underlying implmentation based on RocksDB engine.

func OpenDB

func OpenDB(dbFolder string, dbOpts ...DBOption) (DB, error)

OpenDB initializes a new instance of RocksDB with specified options. It uses the given folder for storing the data files.

type DBOption

type DBOption func(*rocksDBOpts)

DBOption is used to configure the RocksDB storage engine.

func WithCacheSize

func WithCacheSize(size uint64) DBOption

WithCacheSize is used to set the block cache size.

func WithLogger

func WithLogger(lgr *zap.Logger) DBOption

WithLogger is used to inject a ZAP logger instance.

func WithRocksDBConfig

func WithRocksDBConfig(iniFile string) DBOption

WithRocksDBConfig can be used to override internal RocksDB storage settings through the given .ini file.

func WithSSTDir

func WithSSTDir(sstDir string) DBOption

WithSSTDir configures the directory to be used for SST Operation on RocksDB.

func WithStats

func WithStats(statsCli stats.Client) DBOption

WithStats is used to inject a metrics client.

func WithSyncWrites

func WithSyncWrites() DBOption

WithSyncWrites ensures all writes to RocksDB are immediatey flushed to disk from OS buffers.

type WriteBatchIterator

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

WriteBatchIterator represents a iterator to iterator over records.

func NewWriteBatchIterator

func NewWriteBatchIterator(wbData []byte) *WriteBatchIterator

NewWriteBatchIterator creates a new write batch iterator initialised with the given write batch data byte array.

func (*WriteBatchIterator) Error

func (iter *WriteBatchIterator) Error() error

Error returns the error if the iteration is failed.

func (*WriteBatchIterator) Next

func (iter *WriteBatchIterator) Next() bool

Next returns the next record. Returns false if no further record exists.

func (*WriteBatchIterator) Record

Record returns the current record.

Jump to

Keyboard shortcuts

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