Show / Hide Table of Contents

Class RocksDBKeyValueStore

The RocksDB IKeyValueStore implementation. This stores data in the RocksDB.

RocksDBStore and RocksDBKeyValueStore-backed can be instantiated from a URI with rocksdb+file: scheme using , e.g.:

  • rocksdb+file:///var/data/planet/
  • rocksdb+file:///c:/Users/john/AppData/Local/planet/
  • rocksdb+file:///var/data/planet/?secure=true (trie keys are hashed)

The following query string parameters are supported:

block-cacheCorresponds to RocksDBStore(String, Int32, Int32, Nullable<UInt64>, Nullable<UInt64>, Nullable<UInt64>, Int32, Int32, Int32)'s blockCacheSize parameter. 512 by default.
tx-cacheCorresponds to RocksDBStore(String, Int32, Int32, Nullable<UInt64>, Nullable<UInt64>, Nullable<UInt64>, Int32, Int32, Int32)'s txCacheSize parameter. 1024 by default.
max-total-wal-sizeCorresponds to RocksDB's max_total_wal_size option.
keep-log-file-numCorresponds to RocksDB's keep_log_file_num option.
max_log_file_sizeCorresponds to RocksDB's max_log_file_size option.
tx-epoch-unit-secsCorresponds to RocksDBStore(String, Int32, Int32, Nullable<UInt64>, Nullable<UInt64>, Nullable<UInt64>, Int32, Int32, Int32)'s txEpochUnitSeconds parameter. 86400 by default.
block-epoch-unit-secsCorresponds to RocksDBStore(String, Int32, Int32, Nullable<UInt64>, Nullable<UInt64>, Nullable<UInt64>, Int32, Int32, Int32)'s blockEpochUnitSeconds parameter. 86400 by default.
connection-cacheCorresponds to RocksDBStore(String, Int32, Int32, Nullable<UInt64>, Nullable<UInt64>, Nullable<UInt64>, Int32, Int32, Int32)'s dbConnectionCacheSize parameter. 100 by default.
states-dirCorresponds to RocksDBKeyValueStore(String)'s path parameter. It is relative to the URI path, and defaults to states.
securetrue or false (default). Corresponds to 's secure parameter.
Inheritance
Object
RocksDBKeyValueStore
Implements
IKeyValueStore
IDisposable
Namespace: Libplanet.RocksDBStore
Assembly: Libplanet.RocksDBStore.dll
Syntax
public class RocksDBKeyValueStore : object, IKeyValueStore, IDisposable

Constructors

| Improve this Doc View Source

RocksDBKeyValueStore(String)

Creates a new RocksDBKeyValueStore.

Declaration
public RocksDBKeyValueStore(string path)
Parameters
Type Name Description
String path

The path of the storage file will be saved.

Methods

| Improve this Doc View Source

Delete(IEnumerable<KeyBytes>)

Declaration
public void Delete(IEnumerable<KeyBytes> keys)
Parameters
Type Name Description
IEnumerable<KeyBytes> keys
| Improve this Doc View Source

Delete(in KeyBytes)

Deletes the given key. If the key does not exist, nothing happens.

Declaration
public void Delete(in KeyBytes key)
Parameters
Type Name Description
KeyBytes key

A key to delete.

| Improve this Doc View Source

Dispose()

Declaration
public void Dispose()
| Improve this Doc View Source

Exists(in KeyBytes)

Declaration
public bool Exists(in KeyBytes key)
Parameters
Type Name Description
KeyBytes key
Returns
Type Description
Boolean
| Improve this Doc View Source

Get(IEnumerable<KeyBytes>)

Declaration
public IReadOnlyDictionary<KeyBytes, byte[]> Get(IEnumerable<KeyBytes> keys)
Parameters
Type Name Description
IEnumerable<KeyBytes> keys
Returns
Type Description
IReadOnlyDictionary<KeyBytes, Byte[]>
| Improve this Doc View Source

Get(in KeyBytes)

Declaration
public byte[] Get(in KeyBytes key)
Parameters
Type Name Description
KeyBytes key
Returns
Type Description
Byte[]
| Improve this Doc View Source

ListKeys()

Declaration
public IEnumerable<KeyBytes> ListKeys()
Returns
Type Description
IEnumerable<KeyBytes>
| Improve this Doc View Source

Set(IDictionary<KeyBytes, Byte[]>)

Declaration
public void Set(IDictionary<KeyBytes, byte[]> values)
Parameters
Type Name Description
IDictionary<KeyBytes, Byte[]> values
| Improve this Doc View Source

Set(in KeyBytes, Byte[])

Declaration
public void Set(in KeyBytes key, byte[] value)
Parameters
Type Name Description
KeyBytes key
Byte[] value

Implements

IKeyValueStore
IDisposable
  • Improve this Doc
  • View Source
In This Article
Back to top Copyright © 2018–2022 Planetarium