public class StateController extends Object implements AutoCloseable
Current suggested method of customizing RocksDB instance per stream processor is to subclass this class and to override the protected methods to your liking.
Another option would be to use a Builder class and make StateController entirely controlled through its properties.
| Modifier and Type | Field and Description |
|---|---|
protected List<AutoCloseable> |
closeables |
protected List<org.rocksdb.ColumnFamilyDescriptor> |
columnFamilyDescriptors |
protected List<org.rocksdb.ColumnFamilyHandle> |
columnFamilyHandles |
protected File |
dbDirectory |
| Constructor and Description |
|---|
StateController() |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
protected org.rocksdb.ColumnFamilyOptions |
createColumnFamilyOptions() |
protected org.rocksdb.Options |
createOptions() |
void |
delete() |
void |
delete(byte[] key) |
void |
delete(File dbDirectory) |
void |
delete(long key) |
protected void |
ensureIsOpened(String operation) |
boolean |
exist(org.rocksdb.ColumnFamilyHandle handle,
byte[] key,
int offset,
int length) |
void |
foreach(org.rocksdb.ColumnFamilyHandle handle,
java.util.function.BiConsumer<byte[],byte[]> keyValueConsumer) |
int |
get(byte[] key,
int keyOffset,
int keyLength,
byte[] value,
int valueOffset,
int valueLength) |
int |
get(org.rocksdb.ColumnFamilyHandle columnFamilyHandle,
byte[] key,
int keyOffset,
int keyLength,
byte[] value,
int valueOffset,
int valueLength) |
int |
get(org.rocksdb.ColumnFamilyHandle columnFamilyHandle,
long key,
byte[] value,
int valueOffset,
int valueLength) |
byte[] |
get(long key)
!creates garbage!
|
org.rocksdb.ColumnFamilyHandle |
getColumnFamilyHandle(byte[] name) |
org.rocksdb.RocksDB |
getDb() |
protected org.rocksdb.Env |
getDbEnv() |
boolean |
isOpened() |
org.rocksdb.RocksDB |
open(File dbDirectory,
boolean reopen) |
protected org.rocksdb.RocksDB |
open(File dbDirectory,
boolean reopen,
List<byte[]> columnFamilyNames) |
protected org.rocksdb.RocksDB |
openDb(org.rocksdb.DBOptions dbOptions) |
protected org.rocksdb.RocksDB |
openDb(org.rocksdb.Options options) |
void |
put(byte[] key,
byte[] valueBuffer) |
void |
put(byte[] key,
int keyOffset,
int keyLength,
byte[] value,
int valueOffset,
int valueLength) |
void |
put(org.rocksdb.ColumnFamilyHandle handle,
byte[] key,
int keyOffset,
int keyLength,
byte[] value,
int valueOffset,
int valueLength) |
void |
put(org.rocksdb.ColumnFamilyHandle handle,
long key,
byte[] value,
int valueOffset,
int valueLength) |
void |
put(long key,
BufferWriter valueWriter)
*creates garbage*
|
void |
put(long key,
byte[] valueBuffer) |
void |
put(long key,
byte[] value,
int valueOffset,
int valueLength) |
void |
remove(byte[] key,
int offset,
int length) |
void |
remove(org.rocksdb.ColumnFamilyHandle handle,
byte[] key,
int offset,
int length) |
void |
remove(org.rocksdb.ColumnFamilyHandle handle,
long key) |
void |
removeEntriesWithPrefix(org.rocksdb.ColumnFamilyHandle handle,
byte[] prefix,
java.util.function.BiConsumer<byte[],byte[]> entryConsumer) |
boolean |
tryGet(byte[] keyBuffer,
byte[] valueBuffer) |
boolean |
tryGet(long key,
byte[] valueBuffer) |
void |
whileEqualPrefix(org.rocksdb.ColumnFamilyHandle handle,
byte[] prefix,
java.util.function.BiConsumer<byte[],byte[]> keyValueConsumer) |
void |
whileTrue(org.rocksdb.ColumnFamilyHandle handle,
java.util.function.BiFunction<byte[],byte[],Boolean> keyValueConsumer) |
protected File dbDirectory
protected List<AutoCloseable> closeables
protected final List<org.rocksdb.ColumnFamilyDescriptor> columnFamilyDescriptors
protected final List<org.rocksdb.ColumnFamilyHandle> columnFamilyHandles
public org.rocksdb.RocksDB open(File dbDirectory, boolean reopen) throws Exception
Exceptionprotected org.rocksdb.RocksDB openDb(org.rocksdb.Options options)
throws org.rocksdb.RocksDBException
org.rocksdb.RocksDBExceptionprotected org.rocksdb.RocksDB open(File dbDirectory, boolean reopen, List<byte[]> columnFamilyNames) throws Exception
Exceptionprotected org.rocksdb.RocksDB openDb(org.rocksdb.DBOptions dbOptions)
throws org.rocksdb.RocksDBException
org.rocksdb.RocksDBExceptionpublic org.rocksdb.ColumnFamilyHandle getColumnFamilyHandle(byte[] name)
protected org.rocksdb.Options createOptions()
protected org.rocksdb.ColumnFamilyOptions createColumnFamilyOptions()
protected org.rocksdb.Env getDbEnv()
protected void ensureIsOpened(String operation)
public boolean isOpened()
public void close()
close in interface AutoCloseablepublic org.rocksdb.RocksDB getDb()
public void put(long key,
byte[] valueBuffer)
public void put(org.rocksdb.ColumnFamilyHandle handle,
long key,
byte[] value,
int valueOffset,
int valueLength)
public void put(org.rocksdb.ColumnFamilyHandle handle,
byte[] key,
int keyOffset,
int keyLength,
byte[] value,
int valueOffset,
int valueLength)
public void put(long key,
byte[] value,
int valueOffset,
int valueLength)
public void put(byte[] key,
int keyOffset,
int keyLength,
byte[] value,
int valueOffset,
int valueLength)
public void put(long key,
BufferWriter valueWriter)
key - valueWriter - public void put(byte[] key,
byte[] valueBuffer)
public void delete(long key)
public void delete(byte[] key)
public int get(byte[] key,
int keyOffset,
int keyLength,
byte[] value,
int valueOffset,
int valueLength)
public int get(org.rocksdb.ColumnFamilyHandle columnFamilyHandle,
byte[] key,
int keyOffset,
int keyLength,
byte[] value,
int valueOffset,
int valueLength)
public int get(org.rocksdb.ColumnFamilyHandle columnFamilyHandle,
long key,
byte[] value,
int valueOffset,
int valueLength)
public byte[] get(long key)
key - public boolean tryGet(long key,
byte[] valueBuffer)
public boolean tryGet(byte[] keyBuffer,
byte[] valueBuffer)
public boolean exist(org.rocksdb.ColumnFamilyHandle handle,
byte[] key,
int offset,
int length)
public void remove(byte[] key,
int offset,
int length)
public void remove(org.rocksdb.ColumnFamilyHandle handle,
byte[] key,
int offset,
int length)
public void remove(org.rocksdb.ColumnFamilyHandle handle,
long key)
public void foreach(org.rocksdb.ColumnFamilyHandle handle,
java.util.function.BiConsumer<byte[],byte[]> keyValueConsumer)
public void removeEntriesWithPrefix(org.rocksdb.ColumnFamilyHandle handle,
byte[] prefix,
java.util.function.BiConsumer<byte[],byte[]> entryConsumer)
public void whileEqualPrefix(org.rocksdb.ColumnFamilyHandle handle,
byte[] prefix,
java.util.function.BiConsumer<byte[],byte[]> keyValueConsumer)
public void whileTrue(org.rocksdb.ColumnFamilyHandle handle,
java.util.function.BiFunction<byte[],byte[],Boolean> keyValueConsumer)
Copyright © 2017–2018 camunda services GmbH. All rights reserved.