rocksdb

package
v0.0.0-...-c635e59 Latest Latest
Warning

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

Go to latest
Published: May 20, 2024 License: Apache-2.0, BSD-2-Clause Imports: 1 Imported by: 10

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(_ *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 BlockCacheSize

func BlockCacheSize(size uint64) Option

BlockCacheSize sets the size in bytes of the LRU cache for grocksdb blocks.

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(_ string, _ ...Option) (*RocksDB, error)

CreateDB creates a new RocksDB instance.

func OpenDBReadOnly

func OpenDBReadOnly(_ string, _ ...Option) (*RocksDB, error)

OpenDBReadOnly opens a new RocksDB instance in read-only mode.

func (*RocksDB) Close

func (r *RocksDB) Close() error

Close the database.

func (*RocksDB) Flush

func (r *RocksDB) Flush() error

Flush the database.

func (*RocksDB) GetIntProperty

func (r *RocksDB) GetIntProperty(_ 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(_ 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