public abstract class AbstractWriteBatch extends RocksObject implements WriteBatchInterface
nativeHandle_| Modifier | Constructor and Description |
|---|---|
protected |
AbstractWriteBatch(long nativeHandle) |
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Clear all updates buffered in this batch
|
int |
count()
Returns the number of updates in the batch.
|
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 |
merge(byte[] key,
byte[] value)
Merge "value" with the existing value of "key" in the database.
|
void |
merge(ColumnFamilyHandle columnFamilyHandle,
byte[] key,
byte[] value)
Merge "value" with the existing value of "key" in given column family.
|
void |
put(byte[] key,
byte[] value)
Store the mapping "key->value" in the database.
|
void |
put(ColumnFamilyHandle columnFamilyHandle,
byte[] key,
byte[] value)
Store the mapping "key->value" within given column
family.
|
void |
putLogData(byte[] blob)
Append a blob of arbitrary size to the records in this batch.
|
void |
remove(byte[] key)
If the database contains a mapping for "key", erase it.
|
void |
remove(ColumnFamilyHandle columnFamilyHandle,
byte[] key)
If column family contains a mapping for "key", erase it.
|
void |
rollbackToSavePoint()
Remove all entries in this batch (Put, Merge, Delete, PutLogData) since
the most recent call to SetSavePoint() and removes the most recent save
point.
|
void |
setSavePoint()
Records the state of the batch for future calls to RollbackToSavePoint().
|
disposeInternal, disposeInternalclose, disOwnNativeHandle, isOwningHandledispose, finalizepublic int count()
WriteBatchInterfacecount in interface WriteBatchInterfacepublic void put(byte[] key,
byte[] value)
WriteBatchInterfaceStore the mapping "key->value" in the database.
put in interface WriteBatchInterfacekey - the specified key to be inserted.value - the value associated with the specified key.public void put(ColumnFamilyHandle columnFamilyHandle, byte[] key, byte[] value)
WriteBatchInterfaceStore the mapping "key->value" within given column family.
put in interface WriteBatchInterfacecolumnFamilyHandle - ColumnFamilyHandle
instancekey - the specified key to be inserted.value - the value associated with the specified key.public void merge(byte[] key,
byte[] value)
WriteBatchInterfaceMerge "value" with the existing value of "key" in the database. "key->merge(existing, value)"
merge in interface WriteBatchInterfacekey - the specified key to be merged.value - the value to be merged with the current value for
the specified key.public void merge(ColumnFamilyHandle columnFamilyHandle, byte[] key, byte[] value)
WriteBatchInterfaceMerge "value" with the existing value of "key" in given column family. "key->merge(existing, value)"
merge in interface WriteBatchInterfacecolumnFamilyHandle - ColumnFamilyHandle instancekey - the specified key to be merged.value - the value to be merged with the current value for
the specified key.public void remove(byte[] key)
WriteBatchInterfaceIf the database contains a mapping for "key", erase it. Else do nothing.
remove in interface WriteBatchInterfacekey - Key to delete within databasepublic void remove(ColumnFamilyHandle columnFamilyHandle, byte[] key)
WriteBatchInterfaceIf column family contains a mapping for "key", erase it. Else do nothing.
remove in interface WriteBatchInterfacecolumnFamilyHandle - ColumnFamilyHandle instancekey - Key to delete within databasepublic void deleteRange(byte[] beginKey,
byte[] endKey)
WriteBatchInterfacedeleteRange in interface WriteBatchInterfacebeginKey - First key to delete within database (included)endKey - Last key to delete within database (excluded)public void deleteRange(ColumnFamilyHandle columnFamilyHandle, byte[] beginKey, byte[] endKey)
WriteBatchInterfacedeleteRange in interface WriteBatchInterfacecolumnFamilyHandle - ColumnFamilyHandle instancebeginKey - First key to delete within database (included)endKey - Last key to delete within database (excluded)public void putLogData(byte[] blob)
WriteBatchInterfaceputLogData in interface WriteBatchInterfaceblob - binary object to be insertedpublic void clear()
WriteBatchInterfaceclear in interface WriteBatchInterfacepublic void setSavePoint()
WriteBatchInterfacesetSavePoint in interface WriteBatchInterfacepublic void rollbackToSavePoint()
throws RocksDBException
WriteBatchInterfacerollbackToSavePoint in interface WriteBatchInterfaceRocksDBException - if there is no previous call to SetSavePoint()