rocksdb

package
v1.0.0-beta.3 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2022 License: Apache-2.0, BSD-2-Clause Imports: 1 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(db *RocksDB) kvstore.KVStore

New creates a new KVStore with the underlying RocksDB.

Types

type Option

type Option func(*Options)

Option is one of the Options

func Custom

func Custom(options []string) Option

Custom passes the given string to GetOptionsFromString

func IncreaseParallelism

func IncreaseParallelism(threadCount int) Option

IncreaseParallelism sets opts.IncreaseParallelism(threadCount)

func ReadFillCache

func ReadFillCache(fillCache bool) Option

ReadFillCache sets the opts.SetFillCache ReadOption

func UseCompression

func UseCompression(compression bool) Option

UseCompression sets opts.SetCompression(grocksdb.ZSTDCompression)

func WriteDisableWAL

func WriteDisableWAL(value bool) Option

WriteDisableWAL sets the opts.DisableWAL WriteOption

func WriteSync

func WriteSync(sync bool) Option

WriteSync sets the opts.SetSync WriteOption

type Options

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

Options holds the options used to instantiate the underlying grocksdb.DB

type RocksDB

type RocksDB struct {
}

RocksDB holds the underlying grocksdb.DB instance and options

func CreateDB

func CreateDB(directory string, options ...Option) (*RocksDB, error)

CreateDB creates a new RocksDB instance.

func (*RocksDB) Close

func (r *RocksDB) Close() error

func (*RocksDB) Flush

func (r *RocksDB) Flush() error

func (*RocksDB) GetIntProperty

func (r *RocksDB) GetIntProperty(name string) (uint64, bool)

GetIntProperty similar to "GetProperty", but only works for a subset of properties whose return value is an integer. Return the value by integer.

func (*RocksDB) GetProperty

func (r *RocksDB) GetProperty(name string) string

GetProperty returns the value of a database property.

Jump to

Keyboard shortcuts

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