Class RocksDBKeyValueStore
The RocksDB IKeyValueStore implementation. This stores data in the RocksDB.
RocksDBStore and RocksDBKeyValueStore-backed
rocksdb+file:
scheme
using
rocksdb+file:///var/data/planet/
rocksdb+file:///c:/Users/john/AppData/Local/planet/
The following query string parameters are supported:
block-cache | Corresponds to
blockCacheSize parameter. 512 by default. |
tx-cache | Corresponds to
txCacheSize parameter. 1024 by default. |
max-total-wal-size | Corresponds to RocksDB's max_total_wal_size option. |
keep-log-file-num | Corresponds to RocksDB's keep_log_file_num option. |
max_log_file_size | Corresponds to RocksDB's max_log_file_size option. |
tx-epoch-unit-secs | Corresponds to
txEpochUnitSeconds parameter. 86400 by default. |
block-epoch-unit-secs | Corresponds to
blockEpochUnitSeconds parameter. 86400 by default. |
connection-cache | Corresponds to
dbConnectionCacheSize parameter. 100 by default. |
states-dir | Corresponds to path
parameter. It is relative to the URI path, and defaults to states . |
Inheritance
Namespace: Libplanet.RocksDBStore
Assembly: Libplanet.RocksDBStore.dll
Syntax
public class RocksDBKeyValueStore : object, IKeyValueStore
Constructors
| Improve this Doc View SourceRocksDBKeyValueStore(String, RocksDBInstanceType, Nullable<DbOptions>)
Creates a new RocksDBKeyValueStore.
Declaration
public RocksDBKeyValueStore(string path, RocksDBInstanceType type = RocksDBInstanceType.Primary, DbOptions? options = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | path | The path of the storage file will be saved. |
RocksDBInstanceType | type | Determines the instance type of the internal |
System.Nullable<DbOptions> | options | The |
Properties
| Improve this Doc View SourceType
The RocksDB IKeyValueStore implementation. This stores data in the RocksDB.
RocksDBStore and RocksDBKeyValueStore-backed
rocksdb+file:
scheme
using
rocksdb+file:///var/data/planet/
rocksdb+file:///c:/Users/john/AppData/Local/planet/
The following query string parameters are supported:
block-cache | Corresponds to
blockCacheSize parameter. 512 by default. |
tx-cache | Corresponds to
txCacheSize parameter. 1024 by default. |
max-total-wal-size | Corresponds to RocksDB's max_total_wal_size option. |
keep-log-file-num | Corresponds to RocksDB's keep_log_file_num option. |
max_log_file_size | Corresponds to RocksDB's max_log_file_size option. |
tx-epoch-unit-secs | Corresponds to
txEpochUnitSeconds parameter. 86400 by default. |
block-epoch-unit-secs | Corresponds to
blockEpochUnitSeconds parameter. 86400 by default. |
connection-cache | Corresponds to
dbConnectionCacheSize parameter. 100 by default. |
states-dir | Corresponds to path
parameter. It is relative to the URI path, and defaults to states . |
Declaration
public RocksDBInstanceType Type { get; }
Property Value
Type | Description |
---|---|
RocksDBInstanceType |
Methods
| Improve this Doc View SourceDelete(IEnumerable<KeyBytes>)
The RocksDB IKeyValueStore implementation. This stores data in the RocksDB.
RocksDBStore and RocksDBKeyValueStore-backed
rocksdb+file:
scheme
using
rocksdb+file:///var/data/planet/
rocksdb+file:///c:/Users/john/AppData/Local/planet/
The following query string parameters are supported:
block-cache | Corresponds to
blockCacheSize parameter. 512 by default. |
tx-cache | Corresponds to
txCacheSize parameter. 1024 by default. |
max-total-wal-size | Corresponds to RocksDB's max_total_wal_size option. |
keep-log-file-num | Corresponds to RocksDB's keep_log_file_num option. |
max_log_file_size | Corresponds to RocksDB's max_log_file_size option. |
tx-epoch-unit-secs | Corresponds to
txEpochUnitSeconds parameter. 86400 by default. |
block-epoch-unit-secs | Corresponds to
blockEpochUnitSeconds parameter. 86400 by default. |
connection-cache | Corresponds to
dbConnectionCacheSize parameter. 100 by default. |
states-dir | Corresponds to path
parameter. It is relative to the URI path, and defaults to states . |
Declaration
public void Delete(IEnumerable<KeyBytes> keys)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<KeyBytes> | keys |
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. |
Dispose()
The RocksDB IKeyValueStore implementation. This stores data in the RocksDB.
RocksDBStore and RocksDBKeyValueStore-backed
rocksdb+file:
scheme
using
rocksdb+file:///var/data/planet/
rocksdb+file:///c:/Users/john/AppData/Local/planet/
The following query string parameters are supported:
block-cache | Corresponds to
blockCacheSize parameter. 512 by default. |
tx-cache | Corresponds to
txCacheSize parameter. 1024 by default. |
max-total-wal-size | Corresponds to RocksDB's max_total_wal_size option. |
keep-log-file-num | Corresponds to RocksDB's keep_log_file_num option. |
max_log_file_size | Corresponds to RocksDB's max_log_file_size option. |
tx-epoch-unit-secs | Corresponds to
txEpochUnitSeconds parameter. 86400 by default. |
block-epoch-unit-secs | Corresponds to
blockEpochUnitSeconds parameter. 86400 by default. |
connection-cache | Corresponds to
dbConnectionCacheSize parameter. 100 by default. |
states-dir | Corresponds to path
parameter. It is relative to the URI path, and defaults to states . |
Declaration
public void Dispose()
Exists(in KeyBytes)
Checks whether the given key exists in the store.
Declaration
public bool Exists(in KeyBytes key)
Parameters
Type | Name | Description |
---|---|---|
KeyBytes | key | A key to check. |
Returns
Type | Description |
---|---|
System.Boolean | true if the key exists; otherwise, false. |
Get(in KeyBytes)
Gets the value associated with the specified key.
Declaration
public byte[] Get(in KeyBytes key)
Parameters
Type | Name | Description |
---|---|---|
KeyBytes | key | The key whose value to get. |
Returns
Type | Description |
---|---|
System.Byte[] | The value associated with the specified key. |
ListKeys()
The RocksDB IKeyValueStore implementation. This stores data in the RocksDB.
RocksDBStore and RocksDBKeyValueStore-backed
rocksdb+file:
scheme
using
rocksdb+file:///var/data/planet/
rocksdb+file:///c:/Users/john/AppData/Local/planet/
The following query string parameters are supported:
block-cache | Corresponds to
blockCacheSize parameter. 512 by default. |
tx-cache | Corresponds to
txCacheSize parameter. 1024 by default. |
max-total-wal-size | Corresponds to RocksDB's max_total_wal_size option. |
keep-log-file-num | Corresponds to RocksDB's keep_log_file_num option. |
max_log_file_size | Corresponds to RocksDB's max_log_file_size option. |
tx-epoch-unit-secs | Corresponds to
txEpochUnitSeconds parameter. 86400 by default. |
block-epoch-unit-secs | Corresponds to
blockEpochUnitSeconds parameter. 86400 by default. |
connection-cache | Corresponds to
dbConnectionCacheSize parameter. 100 by default. |
states-dir | Corresponds to path
parameter. It is relative to the URI path, and defaults to states . |
Declaration
public IEnumerable<KeyBytes> ListKeys()
Returns
Type | Description |
---|---|
IEnumerable<KeyBytes> |
Set(IDictionary<KeyBytes, Byte[]>)
The RocksDB IKeyValueStore implementation. This stores data in the RocksDB.
RocksDBStore and RocksDBKeyValueStore-backed
rocksdb+file:
scheme
using
rocksdb+file:///var/data/planet/
rocksdb+file:///c:/Users/john/AppData/Local/planet/
The following query string parameters are supported:
block-cache | Corresponds to
blockCacheSize parameter. 512 by default. |
tx-cache | Corresponds to
txCacheSize parameter. 1024 by default. |
max-total-wal-size | Corresponds to RocksDB's max_total_wal_size option. |
keep-log-file-num | Corresponds to RocksDB's keep_log_file_num option. |
max_log_file_size | Corresponds to RocksDB's max_log_file_size option. |
tx-epoch-unit-secs | Corresponds to
txEpochUnitSeconds parameter. 86400 by default. |
block-epoch-unit-secs | Corresponds to
blockEpochUnitSeconds parameter. 86400 by default. |
connection-cache | Corresponds to
dbConnectionCacheSize parameter. 100 by default. |
states-dir | Corresponds to path
parameter. It is relative to the URI path, and defaults to states . |
Declaration
public void Set(IDictionary<KeyBytes, byte[]> values)
Parameters
Type | Name | Description |
---|---|---|
IDictionary<KeyBytes, System.Byte[]> | values |
Set(in KeyBytes, Byte[])
Sets the value to the key. If the key already exists, the value is overwritten.
Declaration
public void Set(in KeyBytes key, byte[] value)
Parameters
Type | Name | Description |
---|---|---|
KeyBytes | key | The key of the value to set. |
System.Byte[] | value | The value to set. |
TryCatchUpWithPrimary()
The RocksDB IKeyValueStore implementation. This stores data in the RocksDB.
RocksDBStore and RocksDBKeyValueStore-backed
rocksdb+file:
scheme
using
rocksdb+file:///var/data/planet/
rocksdb+file:///c:/Users/john/AppData/Local/planet/
The following query string parameters are supported:
block-cache | Corresponds to
blockCacheSize parameter. 512 by default. |
tx-cache | Corresponds to
txCacheSize parameter. 1024 by default. |
max-total-wal-size | Corresponds to RocksDB's max_total_wal_size option. |
keep-log-file-num | Corresponds to RocksDB's keep_log_file_num option. |
max_log_file_size | Corresponds to RocksDB's max_log_file_size option. |
tx-epoch-unit-secs | Corresponds to
txEpochUnitSeconds parameter. 86400 by default. |
block-epoch-unit-secs | Corresponds to
blockEpochUnitSeconds parameter. 86400 by default. |
connection-cache | Corresponds to
dbConnectionCacheSize parameter. 100 by default. |
states-dir | Corresponds to path
parameter. It is relative to the URI path, and defaults to states . |
Declaration
public void TryCatchUpWithPrimary()