public class RocksDB extends RocksObject
Modifier and Type | Field and Description |
---|---|
static byte[] |
DEFAULT_COLUMN_FAMILY |
static int |
NOT_FOUND |
protected DBOptionsInterface |
options_ |
nativeHandle_
Modifier | Constructor and Description |
---|---|
protected |
RocksDB(long nativeHandle)
Private constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
compactRange()
Range compaction of database.
|
void |
compactRange(boolean reduce_level,
int target_level,
int target_path_id)
Deprecated.
|
void |
compactRange(byte[] begin,
byte[] end)
Range compaction of database.
|
void |
compactRange(byte[] begin,
byte[] end,
boolean reduce_level,
int target_level,
int target_path_id)
Deprecated.
|
void |
compactRange(ColumnFamilyHandle columnFamilyHandle)
Range compaction of column family.
|
void |
compactRange(ColumnFamilyHandle columnFamilyHandle,
boolean reduce_level,
int target_level,
int target_path_id)
Deprecated.
|
void |
compactRange(ColumnFamilyHandle columnFamilyHandle,
byte[] begin,
byte[] end)
Range compaction of column family.
|
void |
compactRange(ColumnFamilyHandle columnFamilyHandle,
byte[] begin,
byte[] end,
boolean reduce_level,
int target_level,
int target_path_id)
Deprecated.
|
void |
compactRange(ColumnFamilyHandle columnFamilyHandle,
byte[] begin,
byte[] end,
CompactRangeOptions compactRangeOptions)
Range compaction of column family.
|
void |
continueBackgroundWork()
Resumes backround work which was suspended by
previously calling
pauseBackgroundWork() |
ColumnFamilyHandle |
createColumnFamily(ColumnFamilyDescriptor columnFamilyDescriptor)
Creates a new column family with the name columnFamilyName and
allocates a ColumnFamilyHandle within an internal structure.
|
void |
delete(byte[] key)
Delete the database entry (if any) for "key".
|
void |
delete(byte[] key,
int offset,
int len)
Delete the database entry (if any) for "key".
|
void |
delete(ColumnFamilyHandle columnFamilyHandle,
byte[] key)
Delete the database entry (if any) for "key".
|
void |
delete(ColumnFamilyHandle columnFamilyHandle,
byte[] key,
int offset,
int len)
Delete the database entry (if any) for "key".
|
void |
delete(ColumnFamilyHandle columnFamilyHandle,
WriteOptions writeOpt,
byte[] key)
Delete the database entry (if any) for "key".
|
void |
delete(ColumnFamilyHandle columnFamilyHandle,
WriteOptions writeOpt,
byte[] key,
int offset,
int len)
Delete the database entry (if any) for "key".
|
protected void |
delete(long handle,
byte[] key,
int keyOffset,
int keyLength) |
protected void |
delete(long handle,
byte[] key,
int keyOffset,
int keyLength,
long cfHandle) |
protected void |
delete(long handle,
long writeOptHandle,
byte[] key,
int keyOffset,
int keyLength) |
protected void |
delete(long handle,
long writeOptHandle,
byte[] key,
int keyOffset,
int keyLength,
long cfHandle) |
void |
delete(WriteOptions writeOpt,
byte[] key)
Delete the database entry (if any) for "key".
|
void |
delete(WriteOptions writeOpt,
byte[] key,
int offset,
int len)
Delete the database entry (if any) for "key".
|
void |
deleteRange(byte[] beginKey,
byte[] endKey)
Removes the database entries in the range ["beginKey", "endKey"), i.e.,
including "beginKey" and excluding "endKey".
|
void |
deleteRange(ColumnFamilyHandle columnFamilyHandle,
byte[] beginKey,
byte[] endKey)
Removes the database entries in the range ["beginKey", "endKey"), i.e.,
including "beginKey" and excluding "endKey".
|
void |
deleteRange(ColumnFamilyHandle columnFamilyHandle,
WriteOptions writeOpt,
byte[] beginKey,
byte[] endKey)
Removes the database entries in the range ["beginKey", "endKey"), i.e.,
including "beginKey" and excluding "endKey".
|
protected void |
deleteRange(long handle,
byte[] beginKey,
int beginKeyOffset,
int beginKeyLength,
byte[] endKey,
int endKeyOffset,
int endKeyLength) |
protected void |
deleteRange(long handle,
byte[] beginKey,
int beginKeyOffset,
int beginKeyLength,
byte[] endKey,
int endKeyOffset,
int endKeyLength,
long cfHandle) |
protected void |
deleteRange(long handle,
long writeOptHandle,
byte[] beginKey,
int beginKeyOffset,
int beginKeyLength,
byte[] endKey,
int endKeyOffset,
int endKeyLength) |
protected void |
deleteRange(long handle,
long writeOptHandle,
byte[] beginKey,
int beginKeyOffset,
int beginKeyLength,
byte[] endKey,
int endKeyOffset,
int endKeyLength,
long cfHandle) |
void |
deleteRange(WriteOptions writeOpt,
byte[] beginKey,
byte[] endKey)
Removes the database entries in the range ["beginKey", "endKey"), i.e.,
including "beginKey" and excluding "endKey".
|
static void |
destroyDB(java.lang.String path,
Options options)
Static method to destroy the contents of the specified database.
|
void |
disableFileDeletions()
Prevent file deletions.
|
protected void |
disposeInternal(long handle) |
void |
dropColumnFamily(ColumnFamilyHandle columnFamilyHandle)
Drops the column family identified by columnFamilyName.
|
void |
enableFileDeletions(boolean force)
Allow compactions to delete obsolete files.
|
void |
flush(FlushOptions flushOptions)
Flush all memory table data.
|
void |
flush(FlushOptions flushOptions,
ColumnFamilyHandle columnFamilyHandle)
Flush all memory table data.
|
byte[] |
get(byte[] key)
The simplified version of get which returns a new byte array storing
the value associated with the specified input key if any.
|
int |
get(byte[] key,
byte[] value)
Get the value associated with the specified key within column family*
|
byte[] |
get(byte[] key,
int offset,
int len)
The simplified version of get which returns a new byte array storing
the value associated with the specified input key if any.
|
int |
get(byte[] key,
int offset,
int len,
byte[] value,
int vOffset,
int vLen)
Get the value associated with the specified key within column family*
|
byte[] |
get(ColumnFamilyHandle columnFamilyHandle,
byte[] key)
The simplified version of get which returns a new byte array storing
the value associated with the specified input key if any.
|
int |
get(ColumnFamilyHandle columnFamilyHandle,
byte[] key,
byte[] value)
Get the value associated with the specified key within column family.
|
byte[] |
get(ColumnFamilyHandle columnFamilyHandle,
byte[] key,
int offset,
int len)
The simplified version of get which returns a new byte array storing
the value associated with the specified input key if any.
|
int |
get(ColumnFamilyHandle columnFamilyHandle,
byte[] key,
int offset,
int len,
byte[] value,
int vOffset,
int vLen)
Get the value associated with the specified key within column family.
|
byte[] |
get(ColumnFamilyHandle columnFamilyHandle,
ReadOptions opt,
byte[] key)
The simplified version of get which returns a new byte array storing
the value associated with the specified input key if any.
|
int |
get(ColumnFamilyHandle columnFamilyHandle,
ReadOptions opt,
byte[] key,
byte[] value)
Get the value associated with the specified key within column family.
|
byte[] |
get(ColumnFamilyHandle columnFamilyHandle,
ReadOptions opt,
byte[] key,
int offset,
int len)
The simplified version of get which returns a new byte array storing
the value associated with the specified input key if any.
|
int |
get(ColumnFamilyHandle columnFamilyHandle,
ReadOptions opt,
byte[] key,
int offset,
int len,
byte[] value,
int vOffset,
int vLen)
Get the value associated with the specified key within column family.
|
protected byte[] |
get(long handle,
byte[] key,
int keyOffset,
int keyLength) |
protected int |
get(long handle,
byte[] key,
int keyOffset,
int keyLength,
byte[] value,
int valueOffset,
int valueLength) |
protected int |
get(long handle,
byte[] key,
int keyOffset,
int keyLength,
byte[] value,
int valueOffset,
int valueLength,
long cfHandle) |
protected byte[] |
get(long handle,
byte[] key,
int keyOffset,
int keyLength,
long cfHandle) |
protected byte[] |
get(long handle,
long readOptHandle,
byte[] key,
int keyOffset,
int keyLength) |
protected int |
get(long handle,
long readOptHandle,
byte[] key,
int keyOffset,
int keyLength,
byte[] value,
int valueOffset,
int valueLength) |
protected int |
get(long handle,
long readOptHandle,
byte[] key,
int keyOffset,
int keyLength,
byte[] value,
int valueOffset,
int valueLength,
long cfHandle) |
protected byte[] |
get(long handle,
long readOptHandle,
byte[] key,
int keyOffset,
int keyLength,
long cfHandle) |
byte[] |
get(ReadOptions opt,
byte[] key)
The simplified version of get which returns a new byte array storing
the value associated with the specified input key if any.
|
int |
get(ReadOptions opt,
byte[] key,
byte[] value)
Get the value associated with the specified key.
|
byte[] |
get(ReadOptions opt,
byte[] key,
int offset,
int len)
The simplified version of get which returns a new byte array storing
the value associated with the specified input key if any.
|
int |
get(ReadOptions opt,
byte[] key,
int offset,
int len,
byte[] value,
int vOffset,
int vLen)
Get the value associated with the specified key.
|
protected long |
getAggregatedLongProperty(long nativeHandle,
java.lang.String property,
int propertyLength) |
long |
getAggregatedLongProperty(java.lang.String property)
Return sum of the getLongProperty of all the column families
|
ColumnFamilyHandle |
getDefaultColumnFamily()
Gets the handle for the default column family
|
long |
getLatestSequenceNumber()
The sequence number of the most recent transaction.
|
long |
getLongProperty(ColumnFamilyHandle columnFamilyHandle,
java.lang.String property)
Similar to GetProperty(), but only works for a subset of properties
whose return value is a numerical value.
|
protected long |
getLongProperty(long nativeHandle,
long cfHandle,
java.lang.String property,
int propertyLength) |
protected long |
getLongProperty(long nativeHandle,
java.lang.String property,
int propertyLength) |
long |
getLongProperty(java.lang.String property)
Similar to GetProperty(), but only works for a subset of properties
whose return value is a numerical value.
|
java.lang.String |
getProperty(ColumnFamilyHandle columnFamilyHandle,
java.lang.String property)
DB implements can export properties about their state
via this method on a per column family level.
|
java.lang.String |
getProperty(java.lang.String property)
DB implementations can export properties about their state
via this method.
|
protected java.lang.String |
getProperty0(long nativeHandle,
long cfHandle,
java.lang.String property,
int propertyLength) |
protected java.lang.String |
getProperty0(long nativeHandle,
java.lang.String property,
int propertyLength) |
Snapshot |
getSnapshot()
Return a handle to the current DB state.
|
protected long |
getSnapshot(long nativeHandle) |
TransactionLogIterator |
getUpdatesSince(long sequenceNumber)
Returns an iterator that is positioned at a write-batch containing
seq_number.
|
void |
ingestExternalFile(ColumnFamilyHandle columnFamilyHandle,
java.util.List<java.lang.String> filePathList,
IngestExternalFileOptions ingestExternalFileOptions)
ingestExternalFile will load a list of external SST files (1) into the DB
We will try to find the lowest possible level that the file can fit in, and
ingest the file into this level (2).
|
void |
ingestExternalFile(java.util.List<java.lang.String> filePathList,
IngestExternalFileOptions ingestExternalFileOptions)
ingestExternalFile will load a list of external SST files (1) into the DB
We will try to find the lowest possible level that the file can fit in, and
ingest the file into this level (2).
|
protected long |
iterator(long handle) |
protected long |
iterator(long handle,
long readOptHandle) |
protected long |
iteratorCF(long handle,
long cfHandle) |
protected long |
iteratorCF(long handle,
long cfHandle,
long readOptHandle) |
protected long[] |
iterators(long handle,
long[] columnFamilyHandles,
long readOptHandle) |
boolean |
keyMayExist(byte[] key,
int offset,
int len,
java.lang.StringBuilder value)
If the key definitely does not exist in the database, then this method
returns false, else true.
|
boolean |
keyMayExist(byte[] key,
java.lang.StringBuilder value)
If the key definitely does not exist in the database, then this method
returns false, else true.
|
boolean |
keyMayExist(ColumnFamilyHandle columnFamilyHandle,
byte[] key,
int offset,
int len,
java.lang.StringBuilder value)
If the key definitely does not exist in the database, then this method
returns false, else true.
|
boolean |
keyMayExist(ColumnFamilyHandle columnFamilyHandle,
byte[] key,
java.lang.StringBuilder value)
If the key definitely does not exist in the database, then this method
returns false, else true.
|
protected boolean |
keyMayExist(long handle,
byte[] key,
int keyOffset,
int keyLength,
long cfHandle,
java.lang.StringBuilder stringBuilder) |
protected boolean |
keyMayExist(long handle,
byte[] key,
int keyOffset,
int keyLength,
java.lang.StringBuilder stringBuilder) |
protected boolean |
keyMayExist(long handle,
long optionsHandle,
byte[] key,
int keyOffset,
int keyLength,
long cfHandle,
java.lang.StringBuilder stringBuilder) |
protected boolean |
keyMayExist(long handle,
long optionsHandle,
byte[] key,
int keyOffset,
int keyLength,
java.lang.StringBuilder stringBuilder) |
boolean |
keyMayExist(ReadOptions readOptions,
byte[] key,
int offset,
int len,
java.lang.StringBuilder value)
If the key definitely does not exist in the database, then this method
returns false, else true.
|
boolean |
keyMayExist(ReadOptions readOptions,
byte[] key,
java.lang.StringBuilder value)
If the key definitely does not exist in the database, then this method
returns false, else true.
|
boolean |
keyMayExist(ReadOptions readOptions,
ColumnFamilyHandle columnFamilyHandle,
byte[] key,
int offset,
int len,
java.lang.StringBuilder value)
If the key definitely does not exist in the database, then this method
returns false, else true.
|
boolean |
keyMayExist(ReadOptions readOptions,
ColumnFamilyHandle columnFamilyHandle,
byte[] key,
java.lang.StringBuilder value)
If the key definitely does not exist in the database, then this method
returns false, else true.
|
protected static byte[][] |
listColumnFamilies(long optionsHandle,
java.lang.String path) |
static java.util.List<byte[]> |
listColumnFamilies(Options options,
java.lang.String path)
Static method to determine all available column families for a
rocksdb database identified by path
|
static void |
loadLibrary()
Loads the necessary library files.
|
static void |
loadLibrary(java.util.List<java.lang.String> paths)
Tries to load the necessary library files from the given list of
directories.
|
void |
merge(byte[] key,
byte[] value)
Add merge operand for key/value pair.
|
void |
merge(byte[] key,
int offset,
int len,
byte[] value,
int vOffset,
int vLen)
Add merge operand for key/value pair.
|
void |
merge(ColumnFamilyHandle columnFamilyHandle,
byte[] key,
byte[] value)
Add merge operand for key/value pair in a ColumnFamily.
|
void |
merge(ColumnFamilyHandle columnFamilyHandle,
byte[] key,
int offset,
int len,
byte[] value,
int vOffset,
int vLen)
Add merge operand for key/value pair in a ColumnFamily.
|
void |
merge(ColumnFamilyHandle columnFamilyHandle,
WriteOptions writeOpts,
byte[] key,
byte[] value)
Add merge operand for key/value pair.
|
void |
merge(ColumnFamilyHandle columnFamilyHandle,
WriteOptions writeOpts,
byte[] key,
int offset,
int len,
byte[] value,
int vOffset,
int vLen)
Add merge operand for key/value pair.
|
protected void |
merge(long handle,
byte[] key,
int keyOffset,
int keyLength,
byte[] value,
int valueOffset,
int valueLength) |
protected void |
merge(long handle,
byte[] key,
int keyOffset,
int keyLength,
byte[] value,
int valueOffset,
int valueLength,
long cfHandle) |
protected void |
merge(long handle,
long writeOptHandle,
byte[] key,
int keyOffset,
int keyLength,
byte[] value,
int valueOffset,
int valueLength) |
protected void |
merge(long handle,
long writeOptHandle,
byte[] key,
int keyOffset,
int keyLength,
byte[] value,
int valueOffset,
int valueLength,
long cfHandle) |
void |
merge(WriteOptions writeOpts,
byte[] key,
byte[] value)
Add merge operand for key/value pair.
|
void |
merge(WriteOptions writeOpts,
byte[] key,
int offset,
int len,
byte[] value,
int vOffset,
int vLen)
Add merge operand for key/value pair.
|
java.util.Map<byte[],byte[]> |
multiGet(java.util.List<byte[]> keys)
Returns a map of keys for which values were found in DB.
|
java.util.Map<byte[],byte[]> |
multiGet(java.util.List<ColumnFamilyHandle> columnFamilyHandleList,
java.util.List<byte[]> keys)
Returns a map of keys for which values were found in DB.
|
protected byte[][] |
multiGet(long dbHandle,
byte[][] keys,
int[] keyOffsets,
int[] keyLengths) |
protected byte[][] |
multiGet(long dbHandle,
byte[][] keys,
int[] keyOffsets,
int[] keyLengths,
long[] columnFamilyHandles) |
protected byte[][] |
multiGet(long dbHandle,
long rOptHandle,
byte[][] keys,
int[] keyOffsets,
int[] keyLengths) |
protected byte[][] |
multiGet(long dbHandle,
long rOptHandle,
byte[][] keys,
int[] keyOffsets,
int[] keyLengths,
long[] columnFamilyHandles) |
java.util.Map<byte[],byte[]> |
multiGet(ReadOptions opt,
java.util.List<byte[]> keys)
Returns a map of keys for which values were found in DB.
|
java.util.Map<byte[],byte[]> |
multiGet(ReadOptions opt,
java.util.List<ColumnFamilyHandle> columnFamilyHandleList,
java.util.List<byte[]> keys)
Returns a map of keys for which values were found in DB.
|
RocksIterator |
newIterator()
Return a heap-allocated iterator over the contents of the
database.
|
RocksIterator |
newIterator(ColumnFamilyHandle columnFamilyHandle)
Return a heap-allocated iterator over the contents of the
database.
|
RocksIterator |
newIterator(ColumnFamilyHandle columnFamilyHandle,
ReadOptions readOptions)
Return a heap-allocated iterator over the contents of the
database.
|
RocksIterator |
newIterator(ReadOptions readOptions)
Return a heap-allocated iterator over the contents of the
database.
|
java.util.List<RocksIterator> |
newIterators(java.util.List<ColumnFamilyHandle> columnFamilyHandleList)
Returns iterators from a consistent database state across multiple
column families.
|
java.util.List<RocksIterator> |
newIterators(java.util.List<ColumnFamilyHandle> columnFamilyHandleList,
ReadOptions readOptions)
Returns iterators from a consistent database state across multiple
column families.
|
static RocksDB |
open(DBOptions options,
java.lang.String path,
java.util.List<ColumnFamilyDescriptor> columnFamilyDescriptors,
java.util.List<ColumnFamilyHandle> columnFamilyHandles)
The factory constructor of RocksDB that opens a RocksDB instance given
the path to the database using the specified options and db path and a list
of column family names.
|
protected static long |
open(long optionsHandle,
java.lang.String path) |
protected static long[] |
open(long optionsHandle,
java.lang.String path,
byte[][] columnFamilyNames,
long[] columnFamilyOptions) |
static RocksDB |
open(Options options,
java.lang.String path)
The factory constructor of RocksDB that opens a RocksDB instance given
the path to the database using the specified options and db path.
|
static RocksDB |
open(java.lang.String path)
The factory constructor of RocksDB that opens a RocksDB instance given
the path to the database using the default options w/ createIfMissing
set to true.
|
static RocksDB |
open(java.lang.String path,
java.util.List<ColumnFamilyDescriptor> columnFamilyDescriptors,
java.util.List<ColumnFamilyHandle> columnFamilyHandles)
The factory constructor of RocksDB that opens a RocksDB instance given
the path to the database using the specified options and db path and a list
of column family names.
|
static RocksDB |
openReadOnly(DBOptions options,
java.lang.String path,
java.util.List<ColumnFamilyDescriptor> columnFamilyDescriptors,
java.util.List<ColumnFamilyHandle> columnFamilyHandles)
The factory constructor of RocksDB that opens a RocksDB instance in
Read-Only mode given the path to the database using the specified
options and db path.
|
static RocksDB |
openReadOnly(Options options,
java.lang.String path)
The factory constructor of RocksDB that opens a RocksDB instance in
Read-Only mode given the path to the database using the specified
options and db path.
|
static RocksDB |
openReadOnly(java.lang.String path)
The factory constructor of RocksDB that opens a RocksDB instance in
Read-Only mode given the path to the database using the default
options.
|
static RocksDB |
openReadOnly(java.lang.String path,
java.util.List<ColumnFamilyDescriptor> columnFamilyDescriptors,
java.util.List<ColumnFamilyHandle> columnFamilyHandles)
The factory constructor of RocksDB that opens a RocksDB instance in
Read-Only mode given the path to the database using the default
options.
|
protected static long |
openROnly(long optionsHandle,
java.lang.String path) |
protected static long[] |
openROnly(long optionsHandle,
java.lang.String path,
byte[][] columnFamilyNames,
long[] columnFamilyOptions) |
void |
pauseBackgroundWork()
This function will wait until all currently running background processes
finish.
|
void |
put(byte[] key,
byte[] value)
Set the database entry for "key" to "value".
|
void |
put(byte[] key,
int offset,
int len,
byte[] value,
int vOffset,
int vLen)
Set the database entry for "key" to "value"
|
void |
put(ColumnFamilyHandle columnFamilyHandle,
byte[] key,
byte[] value)
Set the database entry for "key" to "value" in the specified
column family.
|
void |
put(ColumnFamilyHandle columnFamilyHandle,
byte[] key,
int offset,
int len,
byte[] value,
int vOffset,
int vLen)
Set the database entry for "key" to "value" in the specified
column family.
|
void |
put(ColumnFamilyHandle columnFamilyHandle,
WriteOptions writeOpts,
byte[] key,
byte[] value)
Set the database entry for "key" to "value" for the specified
column family.
|
void |
put(ColumnFamilyHandle columnFamilyHandle,
WriteOptions writeOpts,
byte[] key,
int offset,
int len,
byte[] value,
int vOffset,
int vLen)
Set the database entry for "key" to "value" for the specified
column family.
|
protected void |
put(long handle,
byte[] key,
int keyOffset,
int keyLength,
byte[] value,
int valueOffset,
int valueLength) |
protected void |
put(long handle,
byte[] key,
int keyOffset,
int keyLength,
byte[] value,
int valueOffset,
int valueLength,
long cfHandle) |
protected void |
put(long handle,
long writeOptHandle,
byte[] key,
int keyOffset,
int keyLength,
byte[] value,
int valueOffset,
int valueLength) |
protected void |
put(long handle,
long writeOptHandle,
byte[] key,
int keyOffset,
int keyLength,
byte[] value,
int valueOffset,
int valueLength,
long cfHandle) |
void |
put(WriteOptions writeOpts,
byte[] key,
byte[] value)
Set the database entry for "key" to "value".
|
void |
put(WriteOptions writeOpts,
byte[] key,
int offset,
int len,
byte[] value,
int vOffset,
int vLen)
Set the database entry for "key" to "value".
|
protected void |
releaseSnapshot(long nativeHandle,
long snapshotHandle) |
void |
releaseSnapshot(Snapshot snapshot)
Release a previously acquired snapshot.
|
void |
remove(byte[] key)
Deprecated.
Use
delete(byte[]) |
void |
remove(ColumnFamilyHandle columnFamilyHandle,
byte[] key)
Deprecated.
|
void |
remove(ColumnFamilyHandle columnFamilyHandle,
WriteOptions writeOpt,
byte[] key)
Deprecated.
|
void |
remove(WriteOptions writeOpt,
byte[] key)
Deprecated.
|
void |
setOptions(ColumnFamilyHandle columnFamilyHandle,
MutableColumnFamilyOptions mutableColumnFamilyOptions) |
void |
singleDelete(byte[] key)
Remove the database entry for
key . |
void |
singleDelete(ColumnFamilyHandle columnFamilyHandle,
byte[] key)
Remove the database entry for
key . |
void |
singleDelete(ColumnFamilyHandle columnFamilyHandle,
WriteOptions writeOpt,
byte[] key)
Remove the database entry for
key . |
protected void |
singleDelete(long handle,
byte[] key,
int keyLen) |
protected void |
singleDelete(long handle,
byte[] key,
int keyLen,
long cfHandle) |
protected void |
singleDelete(long handle,
long writeOptHandle,
byte[] key,
int keyLen) |
protected void |
singleDelete(long handle,
long writeOptHandle,
byte[] key,
int keyLen,
long cfHandle) |
void |
singleDelete(WriteOptions writeOpt,
byte[] key)
Remove the database entry for
key . |
protected void |
storeOptionsInstance(DBOptionsInterface options) |
void |
write(WriteOptions writeOpts,
WriteBatch updates)
Apply the specified updates to the database.
|
void |
write(WriteOptions writeOpts,
WriteBatchWithIndex updates)
Apply the specified updates to the database.
|
protected void |
write0(long handle,
long writeOptHandle,
long wbHandle) |
protected void |
write1(long handle,
long writeOptHandle,
long wbwiHandle) |
disposeInternal
close, disOwnNativeHandle, isOwningHandle
dispose, finalize
public static final byte[] DEFAULT_COLUMN_FAMILY
public static final int NOT_FOUND
protected DBOptionsInterface options_
protected RocksDB(long nativeHandle)
nativeHandle
- The native handle of the C++ RocksDB objectpublic static void loadLibrary()
public static void loadLibrary(java.util.List<java.lang.String> paths)
paths
- a list of strings where each describes a directory
of a library.public static RocksDB open(java.lang.String path) throws RocksDBException
path
- the path to the rocksdb.RocksDB
instance on success, null if the specified
RocksDB
can not be opened.RocksDBException
- thrown if error happens in underlying
native library.Options.setCreateIfMissing(boolean)
public static RocksDB open(java.lang.String path, java.util.List<ColumnFamilyDescriptor> columnFamilyDescriptors, java.util.List<ColumnFamilyHandle> columnFamilyHandles) throws RocksDBException
If opened in read write mode every existing column family name must be passed within the list to this method.
If opened in read-only mode only a subset of existing column families must be passed to this method.
Options instance *should* not be disposed before all DBs using this options instance have been closed. If user doesn't call options dispose explicitly, then this options instance will be GC'd automatically
ColumnFamily handles are disposed when the RocksDB instance is disposed.
path
- the path to the rocksdb.columnFamilyDescriptors
- list of column family descriptorscolumnFamilyHandles
- will be filled with ColumnFamilyHandle instances
on open.RocksDB
instance on success, null if the specified
RocksDB
can not be opened.RocksDBException
- thrown if error happens in underlying
native library.DBOptions.setCreateIfMissing(boolean)
public static RocksDB open(Options options, java.lang.String path) throws RocksDBException
Options instance *should* not be disposed before all DBs using this options instance have been closed. If user doesn't call options dispose explicitly, then this options instance will be GC'd automatically.
Options instance can be re-used to open multiple DBs if DB statistics is not used. If DB statistics are required, then its recommended to open DB with new Options instance as underlying native statistics instance does not use any locks to prevent concurrent updates.
options
- Options
instance.path
- the path to the rocksdb.RocksDB
instance on success, null if the specified
RocksDB
can not be opened.RocksDBException
- thrown if error happens in underlying
native library.Options.setCreateIfMissing(boolean)
public static RocksDB open(DBOptions options, java.lang.String path, java.util.List<ColumnFamilyDescriptor> columnFamilyDescriptors, java.util.List<ColumnFamilyHandle> columnFamilyHandles) throws RocksDBException
If opened in read write mode every existing column family name must be passed within the list to this method.
If opened in read-only mode only a subset of existing column families must be passed to this method.
Options instance *should* not be disposed before all DBs using this options instance have been closed. If user doesn't call options dispose explicitly, then this options instance will be GC'd automatically.
Options instance can be re-used to open multiple DBs if DB statistics is not used. If DB statistics are required, then its recommended to open DB with new Options instance as underlying native statistics instance does not use any locks to prevent concurrent updates.
ColumnFamily handles are disposed when the RocksDB instance is disposed.
options
- DBOptions
instance.path
- the path to the rocksdb.columnFamilyDescriptors
- list of column family descriptorscolumnFamilyHandles
- will be filled with ColumnFamilyHandle instances
on open.RocksDB
instance on success, null if the specified
RocksDB
can not be opened.RocksDBException
- thrown if error happens in underlying
native library.DBOptions.setCreateIfMissing(boolean)
public static RocksDB openReadOnly(java.lang.String path) throws RocksDBException
path
- the path to the RocksDB.RocksDB
instance on success, null if the specified
RocksDB
can not be opened.RocksDBException
- thrown if error happens in underlying
native library.public static RocksDB openReadOnly(java.lang.String path, java.util.List<ColumnFamilyDescriptor> columnFamilyDescriptors, java.util.List<ColumnFamilyHandle> columnFamilyHandles) throws RocksDBException
path
- the path to the RocksDB.columnFamilyDescriptors
- list of column family descriptorscolumnFamilyHandles
- will be filled with ColumnFamilyHandle instances
on open.RocksDB
instance on success, null if the specified
RocksDB
can not be opened.RocksDBException
- thrown if error happens in underlying
native library.public static RocksDB openReadOnly(Options options, java.lang.String path) throws RocksDBException
options
- Options
instance.path
- the path to the RocksDB.RocksDB
instance on success, null if the specified
RocksDB
can not be opened.RocksDBException
- thrown if error happens in underlying
native library.public static RocksDB openReadOnly(DBOptions options, java.lang.String path, java.util.List<ColumnFamilyDescriptor> columnFamilyDescriptors, java.util.List<ColumnFamilyHandle> columnFamilyHandles) throws RocksDBException
This open method allows to open RocksDB using a subset of available column families
Options instance *should* not be disposed before all DBs using this options instance have been closed. If user doesn't call options dispose explicitly,then this options instance will be GC'd automatically.
options
- DBOptions
instance.path
- the path to the RocksDB.columnFamilyDescriptors
- list of column family descriptorscolumnFamilyHandles
- will be filled with ColumnFamilyHandle instances
on open.RocksDB
instance on success, null if the specified
RocksDB
can not be opened.RocksDBException
- thrown if error happens in underlying
native library.public static java.util.List<byte[]> listColumnFamilies(Options options, java.lang.String path) throws RocksDBException
options
- Options for opening the databasepath
- Absolute path to rocksdb databaseRocksDBException
- thrown if error happens in underlying
native library.protected void storeOptionsInstance(DBOptionsInterface options)
public void put(byte[] key, byte[] value) throws RocksDBException
key
- the specified key to be inserted.value
- the value associated with the specified key.RocksDBException
- thrown if error happens in underlying
native library.public void put(byte[] key, int offset, int len, byte[] value, int vOffset, int vLen) throws RocksDBException
key
- The specified key to be insertedoffset
- the offset of the "key" array to be used, must be non-negative and
no larger than "key".lengthlen
- the length of the "key" array to be used, must be non-negative and
must be non-negative and no larger than ("key".length - offset)value
- the value associated with the specified keyvOffset
- the offset of the "value" array to be used, must be non-negative and
no longer than "key".lengthvLen
- the length of the "value" array to be used, must be non-negative and
must be non-negative and no larger than ("value".length - offset)RocksDBException
- thrown if errors happens in underlying native library.public void put(ColumnFamilyHandle columnFamilyHandle, byte[] key, byte[] value) throws RocksDBException
columnFamilyHandle
- ColumnFamilyHandle
instancekey
- the specified key to be inserted.value
- the value associated with the specified key.
throws IllegalArgumentException if column family is not presentRocksDBException
- thrown if error happens in underlying
native library.public void put(ColumnFamilyHandle columnFamilyHandle, byte[] key, int offset, int len, byte[] value, int vOffset, int vLen) throws RocksDBException
columnFamilyHandle
- ColumnFamilyHandle
instancekey
- The specified key to be insertedoffset
- the offset of the "key" array to be used, must be non-negative and
no larger than "key".lengthlen
- the length of the "key" array to be used, must be non-negative and
must be non-negative and no larger than ("key".length - offset)value
- the value associated with the specified keyvOffset
- the offset of the "value" array to be used, must be non-negative and
no longer than "key".lengthvLen
- the length of the "value" array to be used, must be non-negative and
must be non-negative and no larger than ("value".length - offset)RocksDBException
- thrown if errors happens in underlying native library.public void put(WriteOptions writeOpts, byte[] key, byte[] value) throws RocksDBException
writeOpts
- WriteOptions
instance.key
- the specified key to be inserted.value
- the value associated with the specified key.RocksDBException
- thrown if error happens in underlying
native library.public void put(WriteOptions writeOpts, byte[] key, int offset, int len, byte[] value, int vOffset, int vLen) throws RocksDBException
writeOpts
- WriteOptions
instance.key
- The specified key to be insertedoffset
- the offset of the "key" array to be used, must be non-negative and
no larger than "key".lengthlen
- the length of the "key" array to be used, must be non-negative and
must be non-negative and no larger than ("key".length - offset)value
- the value associated with the specified keyvOffset
- the offset of the "value" array to be used, must be non-negative and
no longer than "key".lengthvLen
- the length of the "value" array to be used, must be non-negative and
must be non-negative and no larger than ("value".length - offset)RocksDBException
- thrown if error happens in underlying
native library.public void put(ColumnFamilyHandle columnFamilyHandle, WriteOptions writeOpts, byte[] key, byte[] value) throws RocksDBException
columnFamilyHandle
- ColumnFamilyHandle
instancewriteOpts
- WriteOptions
instance.key
- the specified key to be inserted.value
- the value associated with the specified key.
throws IllegalArgumentException if column family is not presentRocksDBException
- thrown if error happens in underlying
native library.IllegalArgumentException
public void put(ColumnFamilyHandle columnFamilyHandle, WriteOptions writeOpts, byte[] key, int offset, int len, byte[] value, int vOffset, int vLen) throws RocksDBException
columnFamilyHandle
- ColumnFamilyHandle
instancewriteOpts
- WriteOptions
instance.key
- The specified key to be insertedoffset
- the offset of the "key" array to be used, must be non-negative and
no larger than "key".lengthlen
- the length of the "key" array to be used, must be non-negative and
must be non-negative and no larger than ("key".length - offset)value
- the value associated with the specified keyvOffset
- the offset of the "value" array to be used, must be non-negative and
no longer than "key".lengthvLen
- the length of the "value" array to be used, must be non-negative and
must be non-negative and no larger than ("value".length - offset)RocksDBException
- thrown if error happens in underlying
native library.public boolean keyMayExist(byte[] key, java.lang.StringBuilder value)
key
- byte array of a key to search forvalue
- StringBuilder instance which is a out parameter if a value is
found in block-cache.public boolean keyMayExist(byte[] key, int offset, int len, java.lang.StringBuilder value)
key
- byte array of a key to search foroffset
- the offset of the "key" array to be used, must be non-negative and
no larger than "key".lengthlen
- the length of the "key" array to be used, must be non-negative andvalue
- StringBuilder instance which is a out parameter if a value is
found in block-cache.public boolean keyMayExist(ColumnFamilyHandle columnFamilyHandle, byte[] key, java.lang.StringBuilder value)
columnFamilyHandle
- ColumnFamilyHandle
instancekey
- byte array of a key to search forvalue
- StringBuilder instance which is a out parameter if a value is
found in block-cache.public boolean keyMayExist(ColumnFamilyHandle columnFamilyHandle, byte[] key, int offset, int len, java.lang.StringBuilder value)
columnFamilyHandle
- ColumnFamilyHandle
instancekey
- byte array of a key to search foroffset
- the offset of the "key" array to be used, must be non-negative and
no larger than "key".lengthlen
- the length of the "key" array to be used, must be non-negative andvalue
- StringBuilder instance which is a out parameter if a value is
found in block-cache.public boolean keyMayExist(ReadOptions readOptions, byte[] key, java.lang.StringBuilder value)
readOptions
- ReadOptions
instancekey
- byte array of a key to search forvalue
- StringBuilder instance which is a out parameter if a value is
found in block-cache.public boolean keyMayExist(ReadOptions readOptions, byte[] key, int offset, int len, java.lang.StringBuilder value)
readOptions
- ReadOptions
instancekey
- byte array of a key to search foroffset
- the offset of the "key" array to be used, must be non-negative and
no larger than "key".lengthlen
- the length of the "key" array to be used, must be non-negative andvalue
- StringBuilder instance which is a out parameter if a value is
found in block-cache.public boolean keyMayExist(ReadOptions readOptions, ColumnFamilyHandle columnFamilyHandle, byte[] key, java.lang.StringBuilder value)
readOptions
- ReadOptions
instancecolumnFamilyHandle
- ColumnFamilyHandle
instancekey
- byte array of a key to search forvalue
- StringBuilder instance which is a out parameter if a value is
found in block-cache.public boolean keyMayExist(ReadOptions readOptions, ColumnFamilyHandle columnFamilyHandle, byte[] key, int offset, int len, java.lang.StringBuilder value)
readOptions
- ReadOptions
instancecolumnFamilyHandle
- ColumnFamilyHandle
instancekey
- byte array of a key to search foroffset
- the offset of the "key" array to be used, must be non-negative and
no larger than "key".lengthlen
- the length of the "key" array to be used, must be non-negative andvalue
- StringBuilder instance which is a out parameter if a value is
found in block-cache.public void write(WriteOptions writeOpts, WriteBatch updates) throws RocksDBException
writeOpts
- WriteOptions instanceupdates
- WriteBatch instanceRocksDBException
- thrown if error happens in underlying
native library.public void write(WriteOptions writeOpts, WriteBatchWithIndex updates) throws RocksDBException
writeOpts
- WriteOptions instanceupdates
- WriteBatchWithIndex instanceRocksDBException
- thrown if error happens in underlying
native library.public void merge(byte[] key, byte[] value) throws RocksDBException
key
- the specified key to be merged.value
- the value to be merged with the current value for
the specified key.RocksDBException
- thrown if error happens in underlying
native library.public void merge(byte[] key, int offset, int len, byte[] value, int vOffset, int vLen) throws RocksDBException
key
- the specified key to be merged.offset
- the offset of the "key" array to be used, must be non-negative and
no larger than "key".lengthlen
- the length of the "key" array to be used, must be non-negative andvalue
- the value to be merged with the current value for the specified key.vOffset
- the offset of the "value" array to be used, must be non-negative and
no longer than "key".lengthvLen
- the length of the "value" array to be used, must be non-negative and
must be non-negative and no larger than ("value".length - offset)RocksDBException
- thrown if error happens in underlying
native library.public void merge(ColumnFamilyHandle columnFamilyHandle, byte[] key, byte[] value) throws RocksDBException
columnFamilyHandle
- ColumnFamilyHandle
instancekey
- the specified key to be merged.value
- the value to be merged with the current value for
the specified key.RocksDBException
- thrown if error happens in underlying
native library.public void merge(ColumnFamilyHandle columnFamilyHandle, byte[] key, int offset, int len, byte[] value, int vOffset, int vLen) throws RocksDBException
columnFamilyHandle
- ColumnFamilyHandle
instancekey
- the specified key to be merged.offset
- the offset of the "key" array to be used, must be non-negative and
no larger than "key".lengthlen
- the length of the "key" array to be used, must be non-negative andvalue
- the value to be merged with the current value for
the specified key.vOffset
- the offset of the "value" array to be used, must be non-negative and
no longer than "key".lengthvLen
- the length of the "value" array to be used, must be non-negative and
must be non-negative and no larger than ("value".length - offset)RocksDBException
- thrown if error happens in underlying
native library.public void merge(WriteOptions writeOpts, byte[] key, byte[] value) throws RocksDBException
writeOpts
- WriteOptions
for this write.key
- the specified key to be merged.value
- the value to be merged with the current value for
the specified key.RocksDBException
- thrown if error happens in underlying
native library.public void merge(WriteOptions writeOpts, byte[] key, int offset, int len, byte[] value, int vOffset, int vLen) throws RocksDBException
writeOpts
- WriteOptions
for this write.key
- the specified key to be merged.offset
- the offset of the "key" array to be used, must be non-negative and
no larger than "key".lengthlen
- the length of the "key" array to be used, must be non-negative andvalue
- the value to be merged with the current value for
the specified key.vOffset
- the offset of the "value" array to be used, must be non-negative and
no longer than "key".lengthvLen
- the length of the "value" array to be used, must be non-negative and
must be non-negative and no larger than ("value".length - offset)RocksDBException
- thrown if error happens in underlying
native library.public void merge(ColumnFamilyHandle columnFamilyHandle, WriteOptions writeOpts, byte[] key, byte[] value) throws RocksDBException
columnFamilyHandle
- ColumnFamilyHandle
instancewriteOpts
- WriteOptions
for this write.key
- the specified key to be merged.value
- the value to be merged with the current value for
the specified key.RocksDBException
- thrown if error happens in underlying
native library.public void merge(ColumnFamilyHandle columnFamilyHandle, WriteOptions writeOpts, byte[] key, int offset, int len, byte[] value, int vOffset, int vLen) throws RocksDBException
columnFamilyHandle
- ColumnFamilyHandle
instancewriteOpts
- WriteOptions
for this write.key
- the specified key to be merged.offset
- the offset of the "key" array to be used, must be non-negative and
no larger than "key".lengthlen
- the length of the "key" array to be used, must be non-negative andvalue
- the value to be merged with the current value for
the specified key.vOffset
- the offset of the "value" array to be used, must be non-negative and
no longer than "key".lengthvLen
- the length of the "value" array to be used, must be non-negative and
must be non-negative and no larger than ("value".length - offset)RocksDBException
- thrown if error happens in underlying
native library.public int get(byte[] key, byte[] value) throws RocksDBException
key
- the key to retrieve the value.value
- the out-value to receive the retrieved value.key
in byte. If the return value is greater than the
length of value
, then it indicates that the size of the
input buffer value
is insufficient and partial result will
be returned. RocksDB.NOT_FOUND will be returned if the value not
found.RocksDBException
- thrown if error happens in underlying
native library.public int get(byte[] key, int offset, int len, byte[] value, int vOffset, int vLen) throws RocksDBException
key
- the key to retrieve the value.offset
- the offset of the "key" array to be used, must be non-negative and
no larger than "key".lengthlen
- the length of the "key" array to be used, must be non-negative andvalue
- the out-value to receive the retrieved value.vOffset
- the offset of the "value" array to be used, must be non-negative and
no longer than "key".lengthvLen
- the length of the "value" array to be used, must be non-negative and
must be non-negative and no larger than ("value".length - offset)key
in byte. If the return value is greater than the
length of value
, then it indicates that the size of the
input buffer value
is insufficient and partial result will
be returned. RocksDB.NOT_FOUND will be returned if the value not
found.RocksDBException
- thrown if error happens in underlying
native library.public int get(ColumnFamilyHandle columnFamilyHandle, byte[] key, byte[] value) throws RocksDBException, java.lang.IllegalArgumentException
columnFamilyHandle
- ColumnFamilyHandle
instancekey
- the key to retrieve the value.value
- the out-value to receive the retrieved value.key
in byte. If the return value is greater than the
length of value
, then it indicates that the size of the
input buffer value
is insufficient and partial result will
be returned. RocksDB.NOT_FOUND will be returned if the value not
found.RocksDBException
- thrown if error happens in underlying
native library.java.lang.IllegalArgumentException
public int get(ColumnFamilyHandle columnFamilyHandle, byte[] key, int offset, int len, byte[] value, int vOffset, int vLen) throws RocksDBException, java.lang.IllegalArgumentException
columnFamilyHandle
- ColumnFamilyHandle
instancekey
- the key to retrieve the value.offset
- the offset of the "key" array to be used, must be non-negative and
no larger than "key".lengthlen
- the length of the "key" array to be used, must be non-negative andvalue
- the out-value to receive the retrieved value.vOffset
- the offset of the "value" array to be used, must be non-negative and
no longer than "key".lengthvLen
- the length of the "value" array to be used, must be non-negative and
must be non-negative and no larger than ("value".length - offset)key
in byte. If the return value is greater than the
length of value
, then it indicates that the size of the
input buffer value
is insufficient and partial result will
be returned. RocksDB.NOT_FOUND will be returned if the value not
found.RocksDBException
- thrown if error happens in underlying
native library.java.lang.IllegalArgumentException
public int get(ReadOptions opt, byte[] key, byte[] value) throws RocksDBException
opt
- ReadOptions
instance.key
- the key to retrieve the value.value
- the out-value to receive the retrieved value.key
in byte. If the return value is greater than the
length of value
, then it indicates that the size of the
input buffer value
is insufficient and partial result will
be returned. RocksDB.NOT_FOUND will be returned if the value not
found.RocksDBException
- thrown if error happens in underlying
native library.public int get(ReadOptions opt, byte[] key, int offset, int len, byte[] value, int vOffset, int vLen) throws RocksDBException
opt
- ReadOptions
instance.key
- the key to retrieve the value.offset
- the offset of the "key" array to be used, must be non-negative and
no larger than "key".lengthlen
- the length of the "key" array to be used, must be non-negative andvalue
- the out-value to receive the retrieved value.vOffset
- the offset of the "value" array to be used, must be non-negative and
no longer than "key".lengthvLen
- the length of the "value" array to be used, must be non-negative and
must be non-negative and no larger than ("value".length - offset)key
in byte. If the return value is greater than the
length of value
, then it indicates that the size of the
input buffer value
is insufficient and partial result will
be returned. RocksDB.NOT_FOUND will be returned if the value not
found.RocksDBException
- thrown if error happens in underlying
native library.public int get(ColumnFamilyHandle columnFamilyHandle, ReadOptions opt, byte[] key, byte[] value) throws RocksDBException
columnFamilyHandle
- ColumnFamilyHandle
instanceopt
- ReadOptions
instance.key
- the key to retrieve the value.value
- the out-value to receive the retrieved value.key
in byte. If the return value is greater than the
length of value
, then it indicates that the size of the
input buffer value
is insufficient and partial result will
be returned. RocksDB.NOT_FOUND will be returned if the value not
found.RocksDBException
- thrown if error happens in underlying
native library.public int get(ColumnFamilyHandle columnFamilyHandle, ReadOptions opt, byte[] key, int offset, int len, byte[] value, int vOffset, int vLen) throws RocksDBException
columnFamilyHandle
- ColumnFamilyHandle
instanceopt
- ReadOptions
instance.key
- the key to retrieve the value.offset
- the offset of the "key" array to be used, must be non-negative and
no larger than "key".lengthlen
- the length of the "key" array to be used, must be non-negative andvalue
- the out-value to receive the retrieved value.vOffset
- the offset of the "value" array to be used, must be non-negative and
no longer than "key".lengthvLen
- the length of the "value" array to be used, must be non-negative and
must be non-negative and no larger than ("value".length - offset)key
in byte. If the return value is greater than the
length of value
, then it indicates that the size of the
input buffer value
is insufficient and partial result will
be returned. RocksDB.NOT_FOUND will be returned if the value not
found.RocksDBException
- thrown if error happens in underlying
native library.public byte[] get(byte[] key) throws RocksDBException
key
- the key retrieve the value.RocksDBException
- thrown if error happens in underlying
native library.public byte[] get(byte[] key, int offset, int len) throws RocksDBException
key
- the key retrieve the value.offset
- the offset of the "key" array to be used, must be non-negative and
no larger than "key".lengthlen
- the length of the "key" array to be used, must be non-negative andRocksDBException
- thrown if error happens in underlying
native library.public byte[] get(ColumnFamilyHandle columnFamilyHandle, byte[] key) throws RocksDBException
columnFamilyHandle
- ColumnFamilyHandle
instancekey
- the key retrieve the value.RocksDBException
- thrown if error happens in underlying
native library.public byte[] get(ColumnFamilyHandle columnFamilyHandle, byte[] key, int offset, int len) throws RocksDBException
columnFamilyHandle
- ColumnFamilyHandle
instancekey
- the key retrieve the value.offset
- the offset of the "key" array to be used, must be non-negative and
no larger than "key".lengthlen
- the length of the "key" array to be used, must be non-negative andRocksDBException
- thrown if error happens in underlying
native library.public byte[] get(ReadOptions opt, byte[] key) throws RocksDBException
key
- the key retrieve the value.opt
- Read options.RocksDBException
- thrown if error happens in underlying
native library.public byte[] get(ReadOptions opt, byte[] key, int offset, int len) throws RocksDBException
key
- the key retrieve the value.offset
- the offset of the "key" array to be used, must be non-negative and
no larger than "key".lengthlen
- the length of the "key" array to be used, must be non-negative andopt
- Read options.RocksDBException
- thrown if error happens in underlying
native library.public byte[] get(ColumnFamilyHandle columnFamilyHandle, ReadOptions opt, byte[] key) throws RocksDBException
columnFamilyHandle
- ColumnFamilyHandle
instancekey
- the key retrieve the value.opt
- Read options.RocksDBException
- thrown if error happens in underlying
native library.public byte[] get(ColumnFamilyHandle columnFamilyHandle, ReadOptions opt, byte[] key, int offset, int len) throws RocksDBException
columnFamilyHandle
- ColumnFamilyHandle
instancekey
- the key retrieve the value.offset
- the offset of the "key" array to be used, must be non-negative and
no larger than "key".lengthlen
- the length of the "key" array to be used, must be non-negative andopt
- Read options.RocksDBException
- thrown if error happens in underlying
native library.public java.util.Map<byte[],byte[]> multiGet(java.util.List<byte[]> keys) throws RocksDBException
keys
- List of keys for which values need to be retrieved.RocksDBException
- thrown if error happens in underlying
native library.public java.util.Map<byte[],byte[]> multiGet(java.util.List<ColumnFamilyHandle> columnFamilyHandleList, java.util.List<byte[]> keys) throws RocksDBException, java.lang.IllegalArgumentException
Note: Every key needs to have a related column family name in
columnFamilyHandleList
.
columnFamilyHandleList
- List
containing
ColumnFamilyHandle
instances.keys
- List of keys for which values need to be retrieved.RocksDBException
- thrown if error happens in underlying
native library.java.lang.IllegalArgumentException
- thrown if the size of passed keys is not
equal to the amount of passed column family handles.public java.util.Map<byte[],byte[]> multiGet(ReadOptions opt, java.util.List<byte[]> keys) throws RocksDBException
opt
- Read options.keys
- of keys for which values need to be retrieved.RocksDBException
- thrown if error happens in underlying
native library.public java.util.Map<byte[],byte[]> multiGet(ReadOptions opt, java.util.List<ColumnFamilyHandle> columnFamilyHandleList, java.util.List<byte[]> keys) throws RocksDBException
Note: Every key needs to have a related column family name in
columnFamilyHandleList
.
opt
- Read options.columnFamilyHandleList
- List
containing
ColumnFamilyHandle
instances.keys
- of keys for which values need to be retrieved.RocksDBException
- thrown if error happens in underlying
native library.java.lang.IllegalArgumentException
- thrown if the size of passed keys is not
equal to the amount of passed column family handles.@Deprecated public void remove(byte[] key) throws RocksDBException
delete(byte[])
key
- Key to delete within databaseRocksDBException
- thrown if error happens in underlying
native library.public void delete(byte[] key) throws RocksDBException
key
- Key to delete within databaseRocksDBException
- thrown if error happens in underlying
native library.public void delete(byte[] key, int offset, int len) throws RocksDBException
key
- Key to delete within databaseoffset
- the offset of the "key" array to be used, must be non-negative and
no larger than "key".lengthlen
- the length of the "key" array to be used, must be non-negative andRocksDBException
- thrown if error happens in underlying
native library.@Deprecated public void remove(ColumnFamilyHandle columnFamilyHandle, byte[] key) throws RocksDBException
delete(ColumnFamilyHandle, byte[])
columnFamilyHandle
- ColumnFamilyHandle
instancekey
- Key to delete within databaseRocksDBException
- thrown if error happens in underlying
native library.public void delete(ColumnFamilyHandle columnFamilyHandle, byte[] key) throws RocksDBException
columnFamilyHandle
- ColumnFamilyHandle
instancekey
- Key to delete within databaseRocksDBException
- thrown if error happens in underlying
native library.public void delete(ColumnFamilyHandle columnFamilyHandle, byte[] key, int offset, int len) throws RocksDBException
columnFamilyHandle
- ColumnFamilyHandle
instancekey
- Key to delete within databaseoffset
- the offset of the "key" array to be used, must be non-negative and
no larger than "key".lengthlen
- the length of the "key" array to be used, must be non-negative andRocksDBException
- thrown if error happens in underlying
native library.@Deprecated public void remove(WriteOptions writeOpt, byte[] key) throws RocksDBException
delete(WriteOptions, byte[])
writeOpt
- WriteOptions to be used with delete operationkey
- Key to delete within databaseRocksDBException
- thrown if error happens in underlying
native library.public void delete(WriteOptions writeOpt, byte[] key) throws RocksDBException
writeOpt
- WriteOptions to be used with delete operationkey
- Key to delete within databaseRocksDBException
- thrown if error happens in underlying
native library.public void delete(WriteOptions writeOpt, byte[] key, int offset, int len) throws RocksDBException
writeOpt
- WriteOptions to be used with delete operationkey
- Key to delete within databaseoffset
- the offset of the "key" array to be used, must be non-negative and
no larger than "key".lengthlen
- the length of the "key" array to be used, must be non-negative andRocksDBException
- thrown if error happens in underlying
native library.@Deprecated public void remove(ColumnFamilyHandle columnFamilyHandle, WriteOptions writeOpt, byte[] key) throws RocksDBException
delete(ColumnFamilyHandle, WriteOptions, byte[])
columnFamilyHandle
- ColumnFamilyHandle
instancewriteOpt
- WriteOptions to be used with delete operationkey
- Key to delete within databaseRocksDBException
- thrown if error happens in underlying
native library.public void delete(ColumnFamilyHandle columnFamilyHandle, WriteOptions writeOpt, byte[] key) throws RocksDBException
columnFamilyHandle
- ColumnFamilyHandle
instancewriteOpt
- WriteOptions to be used with delete operationkey
- Key to delete within databaseRocksDBException
- thrown if error happens in underlying
native library.public void delete(ColumnFamilyHandle columnFamilyHandle, WriteOptions writeOpt, byte[] key, int offset, int len) throws RocksDBException
columnFamilyHandle
- ColumnFamilyHandle
instancewriteOpt
- WriteOptions to be used with delete operationkey
- Key to delete within databaseoffset
- the offset of the "key" array to be used, must be non-negative and
no larger than "key".lengthlen
- the length of the "key" array to be used, must be non-negative andRocksDBException
- thrown if error happens in underlying
native library.@Experimental(value="Performance optimization for a very specific workload") public void singleDelete(byte[] key) throws RocksDBException
key
. Requires that the key exists
and was not overwritten. It is not an error if the key did not exist
in the database.
If a key is overwritten (by calling put(byte[], byte[])
multiple
times), then the result of calling SingleDelete() on this key is undefined.
SingleDelete() only behaves correctly if there has been only one Put()
for this key since the previous call to SingleDelete() for this key.
This feature is currently an experimental performance optimization
for a very specific workload. It is up to the caller to ensure that
SingleDelete is only used for a key that is not deleted using Delete() or
written using Merge(). Mixing SingleDelete operations with Deletes and
Merges can result in undefined behavior.key
- Key to delete within databaseRocksDBException
- thrown if error happens in underlying
native library.@Experimental(value="Performance optimization for a very specific workload") public void singleDelete(ColumnFamilyHandle columnFamilyHandle, byte[] key) throws RocksDBException
key
. Requires that the key exists
and was not overwritten. It is not an error if the key did not exist
in the database.
If a key is overwritten (by calling put(byte[], byte[])
multiple
times), then the result of calling SingleDelete() on this key is undefined.
SingleDelete() only behaves correctly if there has been only one Put()
for this key since the previous call to SingleDelete() for this key.
This feature is currently an experimental performance optimization
for a very specific workload. It is up to the caller to ensure that
SingleDelete is only used for a key that is not deleted using Delete() or
written using Merge(). Mixing SingleDelete operations with Deletes and
Merges can result in undefined behavior.columnFamilyHandle
- The column family to delete the key fromkey
- Key to delete within databaseRocksDBException
- thrown if error happens in underlying
native library.@Experimental(value="Performance optimization for a very specific workload") public void singleDelete(WriteOptions writeOpt, byte[] key) throws RocksDBException
key
. Requires that the key exists
and was not overwritten. It is not an error if the key did not exist
in the database.
If a key is overwritten (by calling put(byte[], byte[])
multiple
times), then the result of calling SingleDelete() on this key is undefined.
SingleDelete() only behaves correctly if there has been only one Put()
for this key since the previous call to SingleDelete() for this key.
This feature is currently an experimental performance optimization
for a very specific workload. It is up to the caller to ensure that
SingleDelete is only used for a key that is not deleted using Delete() or
written using Merge(). Mixing SingleDelete operations with Deletes and
Merges can result in undefined behavior.
Note: consider setting WriteOptions.setSync(boolean)
true.writeOpt
- Write options for the deletekey
- Key to delete within databaseRocksDBException
- thrown if error happens in underlying
native library.@Experimental(value="Performance optimization for a very specific workload") public void singleDelete(ColumnFamilyHandle columnFamilyHandle, WriteOptions writeOpt, byte[] key) throws RocksDBException
key
. Requires that the key exists
and was not overwritten. It is not an error if the key did not exist
in the database.
If a key is overwritten (by calling put(byte[], byte[])
multiple
times), then the result of calling SingleDelete() on this key is undefined.
SingleDelete() only behaves correctly if there has been only one Put()
for this key since the previous call to SingleDelete() for this key.
This feature is currently an experimental performance optimization
for a very specific workload. It is up to the caller to ensure that
SingleDelete is only used for a key that is not deleted using Delete() or
written using Merge(). Mixing SingleDelete operations with Deletes and
Merges can result in undefined behavior.
Note: consider setting WriteOptions.setSync(boolean)
true.columnFamilyHandle
- The column family to delete the key fromwriteOpt
- Write options for the deletekey
- Key to delete within databaseRocksDBException
- thrown if error happens in underlying
native library.public java.lang.String getProperty(ColumnFamilyHandle columnFamilyHandle, java.lang.String property) throws RocksDBException
If property
is a valid property understood by this DB
implementation, fills value
with its current value and
returns true. Otherwise returns false.
Valid property names include:
columnFamilyHandle
- ColumnFamilyHandle
instanceproperty
- to be fetched. See above for examplesRocksDBException
- thrown if error happens in underlying
native library.public void deleteRange(byte[] beginKey, byte[] endKey) throws RocksDBException
beginKey
- First key to delete within database (included)endKey
- Last key to delete within database (excluded)RocksDBException
- thrown if error happens in underlying native library.public void deleteRange(ColumnFamilyHandle columnFamilyHandle, byte[] beginKey, byte[] endKey) throws RocksDBException
columnFamilyHandle
- ColumnFamilyHandle
instancebeginKey
- First key to delete within database (included)endKey
- Last key to delete within database (excluded)RocksDBException
- thrown if error happens in underlying native library.public void deleteRange(WriteOptions writeOpt, byte[] beginKey, byte[] endKey) throws RocksDBException
writeOpt
- WriteOptions to be used with delete operationbeginKey
- First key to delete within database (included)endKey
- Last key to delete within database (excluded)RocksDBException
- thrown if error happens in underlying native library.public void deleteRange(ColumnFamilyHandle columnFamilyHandle, WriteOptions writeOpt, byte[] beginKey, byte[] endKey) throws RocksDBException
columnFamilyHandle
- ColumnFamilyHandle
instancewriteOpt
- WriteOptions to be used with delete operationbeginKey
- First key to delete within database (included)endKey
- Last key to delete within database (excluded)RocksDBException
- thrown if error happens in underlying native library.public java.lang.String getProperty(java.lang.String property) throws RocksDBException
Valid property names include:
property
- to be fetched. See above for examplesRocksDBException
- thrown if error happens in underlying
native library.public long getLongProperty(java.lang.String property) throws RocksDBException
Similar to GetProperty(), but only works for a subset of properties whose return value is a numerical value. Return the value as long.
Note: As the returned property is of type
uint64_t
on C++ side the returning value can be negative
because Java supports in Java 7 only signed long values.
Java 7: To mitigate the problem of the non
existent unsigned long tpye, values should be encapsulated using
java.math.BigInteger
to reflect the correct value. The correct
behavior is guaranteed if 2^64
is added to negative values.
Java 8: In Java 8 the value should be treated as
unsigned long using provided methods of type Long
.
property
- to be fetched.RocksDBException
- if an error happens in the underlying native code.public long getLongProperty(ColumnFamilyHandle columnFamilyHandle, java.lang.String property) throws RocksDBException
Similar to GetProperty(), but only works for a subset of properties whose return value is a numerical value. Return the value as long.
Note: As the returned property is of type
uint64_t
on C++ side the returning value can be negative
because Java supports in Java 7 only signed long values.
Java 7: To mitigate the problem of the non
existent unsigned long tpye, values should be encapsulated using
java.math.BigInteger
to reflect the correct value. The correct
behavior is guaranteed if 2^64
is added to negative values.
Java 8: In Java 8 the value should be treated as
unsigned long using provided methods of type Long
.
columnFamilyHandle
- ColumnFamilyHandle
instanceproperty
- to be fetched.RocksDBException
- if an error happens in the underlying native code.public long getAggregatedLongProperty(java.lang.String property) throws RocksDBException
Return sum of the getLongProperty of all the column families
Note: As the returned property is of type
uint64_t
on C++ side the returning value can be negative
because Java supports in Java 7 only signed long values.
Java 7: To mitigate the problem of the non
existent unsigned long tpye, values should be encapsulated using
java.math.BigInteger
to reflect the correct value. The correct
behavior is guaranteed if 2^64
is added to negative values.
Java 8: In Java 8 the value should be treated as
unsigned long using provided methods of type Long
.
property
- to be fetched.RocksDBException
- if an error happens in the underlying native code.public RocksIterator newIterator()
Return a heap-allocated iterator over the contents of the database. The result of newIterator() is initially invalid (caller must call one of the Seek methods on the iterator before using it).
Caller should close the iterator when it is no longer needed. The returned iterator should be closed before this db is closed.
public RocksIterator newIterator(ReadOptions readOptions)
Return a heap-allocated iterator over the contents of the database. The result of newIterator() is initially invalid (caller must call one of the Seek methods on the iterator before using it).
Caller should close the iterator when it is no longer needed. The returned iterator should be closed before this db is closed.
readOptions
- ReadOptions
instance.public Snapshot getSnapshot()
Return a handle to the current DB state. Iterators created with this handle will all observe a stable snapshot of the current DB state. The caller must call ReleaseSnapshot(result) when the snapshot is no longer needed.
nullptr will be returned if the DB fails to take a snapshot or does not support snapshot.
Snapshot
instancepublic void releaseSnapshot(Snapshot snapshot)
snapshot
- Snapshot
instancepublic RocksIterator newIterator(ColumnFamilyHandle columnFamilyHandle)
Return a heap-allocated iterator over the contents of the database. The result of newIterator() is initially invalid (caller must call one of the Seek methods on the iterator before using it).
Caller should close the iterator when it is no longer needed. The returned iterator should be closed before this db is closed.
columnFamilyHandle
- ColumnFamilyHandle
instancepublic RocksIterator newIterator(ColumnFamilyHandle columnFamilyHandle, ReadOptions readOptions)
Return a heap-allocated iterator over the contents of the database. The result of newIterator() is initially invalid (caller must call one of the Seek methods on the iterator before using it).
Caller should close the iterator when it is no longer needed. The returned iterator should be closed before this db is closed.
columnFamilyHandle
- ColumnFamilyHandle
instancereadOptions
- ReadOptions
instance.public java.util.List<RocksIterator> newIterators(java.util.List<ColumnFamilyHandle> columnFamilyHandleList) throws RocksDBException
columnFamilyHandleList
- List
containing
ColumnFamilyHandle
instances.List
containing RocksIterator
instancesRocksDBException
- thrown if error happens in underlying
native library.public java.util.List<RocksIterator> newIterators(java.util.List<ColumnFamilyHandle> columnFamilyHandleList, ReadOptions readOptions) throws RocksDBException
columnFamilyHandleList
- List
containing
ColumnFamilyHandle
instances.readOptions
- ReadOptions
instance.List
containing RocksIterator
instancesRocksDBException
- thrown if error happens in underlying
native library.public ColumnFamilyHandle getDefaultColumnFamily()
public ColumnFamilyHandle createColumnFamily(ColumnFamilyDescriptor columnFamilyDescriptor) throws RocksDBException
columnFamilyDescriptor
- column family to be created.ColumnFamilyHandle
instance.RocksDBException
- thrown if error happens in underlying
native library.public void dropColumnFamily(ColumnFamilyHandle columnFamilyHandle) throws RocksDBException, java.lang.IllegalArgumentException
columnFamilyHandle
- ColumnFamilyHandle
instanceRocksDBException
- thrown if error happens in underlying
native library.java.lang.IllegalArgumentException
public void flush(FlushOptions flushOptions) throws RocksDBException
Flush all memory table data.
Note: it must be ensured that the FlushOptions instance is not GC'ed before this method finishes. If the wait parameter is set to false, flush processing is asynchronous.
flushOptions
- FlushOptions
instance.RocksDBException
- thrown if an error occurs within the native
part of the library.public void flush(FlushOptions flushOptions, ColumnFamilyHandle columnFamilyHandle) throws RocksDBException
Flush all memory table data.
Note: it must be ensured that the FlushOptions instance is not GC'ed before this method finishes. If the wait parameter is set to false, flush processing is asynchronous.
flushOptions
- FlushOptions
instance.columnFamilyHandle
- ColumnFamilyHandle
instance.RocksDBException
- thrown if an error occurs within the native
part of the library.public void compactRange() throws RocksDBException
Range compaction of database.
Note: After the database has been compacted, all data will have been pushed down to the last level containing any data.
See also
RocksDBException
- thrown if an error occurs within the native
part of the library.public void compactRange(byte[] begin, byte[] end) throws RocksDBException
Range compaction of database.
Note: After the database has been compacted, all data will have been pushed down to the last level containing any data.
See also
begin
- start of key range (included in range)end
- end of key range (excluded from range)RocksDBException
- thrown if an error occurs within the native
part of the library.@Deprecated public void compactRange(boolean reduce_level, int target_level, int target_path_id) throws RocksDBException
compactRange(ColumnFamilyHandle, byte[], byte[], CompactRangeOptions)
insteadRange compaction of database.
Note: After the database has been compacted, all data will have been pushed down to the last level containing any data.
Compaction outputs should be placed in options.db_paths [target_path_id]. Behavior is undefined if target_path_id is out of range.
See also
reduce_level
- reduce level after compactiontarget_level
- target level to compact totarget_path_id
- the target path id of output pathRocksDBException
- thrown if an error occurs within the native
part of the library.@Deprecated public void compactRange(byte[] begin, byte[] end, boolean reduce_level, int target_level, int target_path_id) throws RocksDBException
compactRange(ColumnFamilyHandle, byte[], byte[], CompactRangeOptions)
insteadRange compaction of database.
Note: After the database has been compacted, all data will have been pushed down to the last level containing any data.
Compaction outputs should be placed in options.db_paths [target_path_id]. Behavior is undefined if target_path_id is out of range.
See also
begin
- start of key range (included in range)end
- end of key range (excluded from range)reduce_level
- reduce level after compactiontarget_level
- target level to compact totarget_path_id
- the target path id of output pathRocksDBException
- thrown if an error occurs within the native
part of the library.public void compactRange(ColumnFamilyHandle columnFamilyHandle) throws RocksDBException
Range compaction of column family.
Note: After the database has been compacted, all data will have been pushed down to the last level containing any data.
See also
columnFamilyHandle
- ColumnFamilyHandle
instance.RocksDBException
- thrown if an error occurs within the native
part of the library.public void compactRange(ColumnFamilyHandle columnFamilyHandle, byte[] begin, byte[] end) throws RocksDBException
Range compaction of column family.
Note: After the database has been compacted, all data will have been pushed down to the last level containing any data.
See also
columnFamilyHandle
- ColumnFamilyHandle
instance.begin
- start of key range (included in range)end
- end of key range (excluded from range)RocksDBException
- thrown if an error occurs within the native
part of the library.public void compactRange(ColumnFamilyHandle columnFamilyHandle, byte[] begin, byte[] end, CompactRangeOptions compactRangeOptions) throws RocksDBException
Range compaction of column family.
Note: After the database has been compacted, all data will have been pushed down to the last level containing any data.
columnFamilyHandle
- ColumnFamilyHandle
instance.begin
- start of key range (included in range)end
- end of key range (excluded from range)compactRangeOptions
- options for the compactionRocksDBException
- thrown if an error occurs within the native
part of the library.@Deprecated public void compactRange(ColumnFamilyHandle columnFamilyHandle, boolean reduce_level, int target_level, int target_path_id) throws RocksDBException
compactRange(ColumnFamilyHandle, byte[], byte[], CompactRangeOptions)
insteadRange compaction of column family.
Note: After the database has been compacted, all data will have been pushed down to the last level containing any data.
Compaction outputs should be placed in options.db_paths [target_path_id]. Behavior is undefined if target_path_id is out of range.
See also
columnFamilyHandle
- ColumnFamilyHandle
instance.reduce_level
- reduce level after compactiontarget_level
- target level to compact totarget_path_id
- the target path id of output pathRocksDBException
- thrown if an error occurs within the native
part of the library.@Deprecated public void compactRange(ColumnFamilyHandle columnFamilyHandle, byte[] begin, byte[] end, boolean reduce_level, int target_level, int target_path_id) throws RocksDBException
compactRange(ColumnFamilyHandle, byte[], byte[], CompactRangeOptions)
insteadRange compaction of column family.
Note: After the database has been compacted, all data will have been pushed down to the last level containing any data.
Compaction outputs should be placed in options.db_paths [target_path_id]. Behavior is undefined if target_path_id is out of range.
See also
columnFamilyHandle
- ColumnFamilyHandle
instance.begin
- start of key range (included in range)end
- end of key range (excluded from range)reduce_level
- reduce level after compactiontarget_level
- target level to compact totarget_path_id
- the target path id of output pathRocksDBException
- thrown if an error occurs within the native
part of the library.public void pauseBackgroundWork() throws RocksDBException
continueBackgroundWork()
is calledRocksDBException
- If an error occurs when pausing background workpublic void continueBackgroundWork() throws RocksDBException
pauseBackgroundWork()
RocksDBException
- If an error occurs when resuming background workpublic long getLatestSequenceNumber()
The sequence number of the most recent transaction.
public void disableFileDeletions() throws RocksDBException
Prevent file deletions. Compactions will continue to occur, but no obsolete files will be deleted. Calling this multiple times have the same effect as calling it once.
RocksDBException
- thrown if operation was not performed
successfully.public void enableFileDeletions(boolean force) throws RocksDBException
Allow compactions to delete obsolete files. If force == true, the call to EnableFileDeletions() will guarantee that file deletions are enabled after the call, even if DisableFileDeletions() was called multiple times before.
If force == false, EnableFileDeletions will only enable file deletion after it's been called at least as many times as DisableFileDeletions(), enabling the two methods to be called by two threads concurrently without synchronization -- i.e., file deletions will be enabled only after both threads call EnableFileDeletions()
force
- boolean value described above.RocksDBException
- thrown if operation was not performed
successfully.public TransactionLogIterator getUpdatesSince(long sequenceNumber) throws RocksDBException
Returns an iterator that is positioned at a write-batch containing seq_number. If the sequence number is non existent, it returns an iterator at the first available seq_no after the requested seq_no.
Must set WAL_ttl_seconds or WAL_size_limit_MB to large values to use this api, else the WAL files will get cleared aggressively and the iterator might keep getting invalid before an update is read.
sequenceNumber
- sequence number offsetTransactionLogIterator
instance.RocksDBException
- if iterator cannot be retrieved
from native-side.public void setOptions(ColumnFamilyHandle columnFamilyHandle, MutableColumnFamilyOptions mutableColumnFamilyOptions) throws RocksDBException
RocksDBException
public void ingestExternalFile(java.util.List<java.lang.String> filePathList, IngestExternalFileOptions ingestExternalFileOptions) throws RocksDBException
SstFileWriter
(2) We will try to ingest the files to the lowest possible level
even if the file compression doesn't match the level compressionfilePathList
- The list of files to ingestingestExternalFileOptions
- the options for the ingestionRocksDBException
- thrown if error happens in underlying
native library.public void ingestExternalFile(ColumnFamilyHandle columnFamilyHandle, java.util.List<java.lang.String> filePathList, IngestExternalFileOptions ingestExternalFileOptions) throws RocksDBException
SstFileWriter
(2) We will try to ingest the files to the lowest possible level
even if the file compression doesn't match the level compressioncolumnFamilyHandle
- The column family for the ingested filesfilePathList
- The list of files to ingestingestExternalFileOptions
- the options for the ingestionRocksDBException
- thrown if error happens in underlying
native library.public static void destroyDB(java.lang.String path, Options options) throws RocksDBException
path
- the path to the Rocksdb database.options
- Options
instance.RocksDBException
- thrown if error happens in underlying
native library.protected static long open(long optionsHandle, java.lang.String path) throws RocksDBException
RocksDBException
protected static long[] open(long optionsHandle, java.lang.String path, byte[][] columnFamilyNames, long[] columnFamilyOptions) throws RocksDBException
optionsHandle
- Native handle pointing to an Options objectpath
- The directory path for the database filescolumnFamilyNames
- An array of column family namescolumnFamilyOptions
- An array of native handles pointing to
ColumnFamilyOptions objectsRocksDBException
- thrown if the database could not be openedprotected static long openROnly(long optionsHandle, java.lang.String path) throws RocksDBException
RocksDBException
protected static long[] openROnly(long optionsHandle, java.lang.String path, byte[][] columnFamilyNames, long[] columnFamilyOptions) throws RocksDBException
optionsHandle
- Native handle pointing to an Options objectpath
- The directory path for the database filescolumnFamilyNames
- An array of column family namescolumnFamilyOptions
- An array of native handles pointing to
ColumnFamilyOptions objectsRocksDBException
- thrown if the database could not be openedprotected static byte[][] listColumnFamilies(long optionsHandle, java.lang.String path) throws RocksDBException
RocksDBException
protected void put(long handle, byte[] key, int keyOffset, int keyLength, byte[] value, int valueOffset, int valueLength) throws RocksDBException
RocksDBException
protected void put(long handle, byte[] key, int keyOffset, int keyLength, byte[] value, int valueOffset, int valueLength, long cfHandle) throws RocksDBException
RocksDBException
protected void put(long handle, long writeOptHandle, byte[] key, int keyOffset, int keyLength, byte[] value, int valueOffset, int valueLength) throws RocksDBException
RocksDBException
protected void put(long handle, long writeOptHandle, byte[] key, int keyOffset, int keyLength, byte[] value, int valueOffset, int valueLength, long cfHandle) throws RocksDBException
RocksDBException
protected void write0(long handle, long writeOptHandle, long wbHandle) throws RocksDBException
RocksDBException
protected void write1(long handle, long writeOptHandle, long wbwiHandle) throws RocksDBException
RocksDBException
protected boolean keyMayExist(long handle, byte[] key, int keyOffset, int keyLength, java.lang.StringBuilder stringBuilder)
protected boolean keyMayExist(long handle, byte[] key, int keyOffset, int keyLength, long cfHandle, java.lang.StringBuilder stringBuilder)
protected boolean keyMayExist(long handle, long optionsHandle, byte[] key, int keyOffset, int keyLength, java.lang.StringBuilder stringBuilder)
protected boolean keyMayExist(long handle, long optionsHandle, byte[] key, int keyOffset, int keyLength, long cfHandle, java.lang.StringBuilder stringBuilder)
protected void merge(long handle, byte[] key, int keyOffset, int keyLength, byte[] value, int valueOffset, int valueLength) throws RocksDBException
RocksDBException
protected void merge(long handle, byte[] key, int keyOffset, int keyLength, byte[] value, int valueOffset, int valueLength, long cfHandle) throws RocksDBException
RocksDBException
protected void merge(long handle, long writeOptHandle, byte[] key, int keyOffset, int keyLength, byte[] value, int valueOffset, int valueLength) throws RocksDBException
RocksDBException
protected void merge(long handle, long writeOptHandle, byte[] key, int keyOffset, int keyLength, byte[] value, int valueOffset, int valueLength, long cfHandle) throws RocksDBException
RocksDBException
protected int get(long handle, byte[] key, int keyOffset, int keyLength, byte[] value, int valueOffset, int valueLength) throws RocksDBException
RocksDBException
protected int get(long handle, byte[] key, int keyOffset, int keyLength, byte[] value, int valueOffset, int valueLength, long cfHandle) throws RocksDBException
RocksDBException
protected int get(long handle, long readOptHandle, byte[] key, int keyOffset, int keyLength, byte[] value, int valueOffset, int valueLength) throws RocksDBException
RocksDBException
protected int get(long handle, long readOptHandle, byte[] key, int keyOffset, int keyLength, byte[] value, int valueOffset, int valueLength, long cfHandle) throws RocksDBException
RocksDBException
protected byte[][] multiGet(long dbHandle, byte[][] keys, int[] keyOffsets, int[] keyLengths)
protected byte[][] multiGet(long dbHandle, byte[][] keys, int[] keyOffsets, int[] keyLengths, long[] columnFamilyHandles)
protected byte[][] multiGet(long dbHandle, long rOptHandle, byte[][] keys, int[] keyOffsets, int[] keyLengths)
protected byte[][] multiGet(long dbHandle, long rOptHandle, byte[][] keys, int[] keyOffsets, int[] keyLengths, long[] columnFamilyHandles)
protected byte[] get(long handle, byte[] key, int keyOffset, int keyLength) throws RocksDBException
RocksDBException
protected byte[] get(long handle, byte[] key, int keyOffset, int keyLength, long cfHandle) throws RocksDBException
RocksDBException
protected byte[] get(long handle, long readOptHandle, byte[] key, int keyOffset, int keyLength) throws RocksDBException
RocksDBException
protected byte[] get(long handle, long readOptHandle, byte[] key, int keyOffset, int keyLength, long cfHandle) throws RocksDBException
RocksDBException
protected void delete(long handle, byte[] key, int keyOffset, int keyLength) throws RocksDBException
RocksDBException
protected void delete(long handle, byte[] key, int keyOffset, int keyLength, long cfHandle) throws RocksDBException
RocksDBException
protected void delete(long handle, long writeOptHandle, byte[] key, int keyOffset, int keyLength) throws RocksDBException
RocksDBException
protected void delete(long handle, long writeOptHandle, byte[] key, int keyOffset, int keyLength, long cfHandle) throws RocksDBException
RocksDBException
protected void singleDelete(long handle, byte[] key, int keyLen) throws RocksDBException
RocksDBException
protected void singleDelete(long handle, byte[] key, int keyLen, long cfHandle) throws RocksDBException
RocksDBException
protected void singleDelete(long handle, long writeOptHandle, byte[] key, int keyLen) throws RocksDBException
RocksDBException
protected void singleDelete(long handle, long writeOptHandle, byte[] key, int keyLen, long cfHandle) throws RocksDBException
RocksDBException
protected void deleteRange(long handle, byte[] beginKey, int beginKeyOffset, int beginKeyLength, byte[] endKey, int endKeyOffset, int endKeyLength) throws RocksDBException
RocksDBException
protected void deleteRange(long handle, byte[] beginKey, int beginKeyOffset, int beginKeyLength, byte[] endKey, int endKeyOffset, int endKeyLength, long cfHandle) throws RocksDBException
RocksDBException
protected void deleteRange(long handle, long writeOptHandle, byte[] beginKey, int beginKeyOffset, int beginKeyLength, byte[] endKey, int endKeyOffset, int endKeyLength) throws RocksDBException
RocksDBException
protected void deleteRange(long handle, long writeOptHandle, byte[] beginKey, int beginKeyOffset, int beginKeyLength, byte[] endKey, int endKeyOffset, int endKeyLength, long cfHandle) throws RocksDBException
RocksDBException
protected java.lang.String getProperty0(long nativeHandle, java.lang.String property, int propertyLength) throws RocksDBException
RocksDBException
protected java.lang.String getProperty0(long nativeHandle, long cfHandle, java.lang.String property, int propertyLength) throws RocksDBException
RocksDBException
protected long getLongProperty(long nativeHandle, java.lang.String property, int propertyLength) throws RocksDBException
RocksDBException
protected long getLongProperty(long nativeHandle, long cfHandle, java.lang.String property, int propertyLength) throws RocksDBException
RocksDBException
protected long getAggregatedLongProperty(long nativeHandle, java.lang.String property, int propertyLength) throws RocksDBException
RocksDBException
protected long iterator(long handle)
protected long iterator(long handle, long readOptHandle)
protected long iteratorCF(long handle, long cfHandle)
protected long iteratorCF(long handle, long cfHandle, long readOptHandle)
protected long[] iterators(long handle, long[] columnFamilyHandles, long readOptHandle) throws RocksDBException
RocksDBException
protected long getSnapshot(long nativeHandle)
protected void releaseSnapshot(long nativeHandle, long snapshotHandle)
protected void disposeInternal(long handle)
disposeInternal
in class RocksObject