public class WriteBatch extends AbstractWriteBatch
| Modifier and Type | Class and Description |
|---|---|
static class |
WriteBatch.Handler
Handler callback for iterating over the contents of a batch.
|
static class |
WriteBatch.SavePoint
A structure for describing the save point in the Write Batch.
|
nativeHandle_| Constructor and Description |
|---|
WriteBatch()
Constructs a WriteBatch instance.
|
WriteBatch(byte[] serialized)
Constructs a WriteBatch instance from a serialized representation
as returned by
data(). |
WriteBatch(int reserved_bytes)
Constructs a WriteBatch instance with a given size.
|
| Modifier and Type | Method and Description |
|---|---|
byte[] |
data()
Retrieve the serialized version of this batch.
|
protected void |
disposeInternal(long handle) |
long |
getDataSize()
Retrieve data size of the batch.
|
WriteBatch.SavePoint |
getWalTerminationPoint()
Gets the WAL termination point.
|
WriteBatch |
getWriteBatch()
Get the underlying Write Batch.
|
boolean |
hasBeginPrepare()
Returns true if MarkBeginPrepare will be called during Iterate.
|
boolean |
hasCommit()
Returns true if MarkCommit will be called during Iterate.
|
boolean |
hasDelete()
Returns true if DeleteCF will be called during Iterate.
|
boolean |
hasDeleteRange()
Returns true if DeleteRangeCF will be called during Iterate.
|
boolean |
hasEndPrepare()
Returns true if MarkEndPrepare will be called during Iterate.
|
boolean |
hasMerge()
Returns true if MergeCF will be called during Iterate.
|
boolean |
hasPut()
Returns true if PutCF will be called during Iterate.
|
boolean |
hasRollback()
Returns true if MarkRollback will be called during Iterate.
|
boolean |
hasSingleDelete()
Returns true if SingleDeleteCF will be called during Iterate.
|
void |
iterate(WriteBatch.Handler handler)
Support for iterating over the contents of a batch.
|
void |
markWalTerminationPoint()
Marks this point in the WriteBatch as the last record to
be inserted into the WAL, provided the WAL is enabled.
|
clear, count, delete, delete, deleteRange, deleteRange, merge, merge, popSavePoint, put, put, putLogData, remove, remove, rollbackToSavePoint, setMaxBytes, setSavePoint, singleDelete, singleDeletedisposeInternalclose, disOwnNativeHandle, isOwningHandledispose, finalizepublic WriteBatch()
public WriteBatch(int reserved_bytes)
reserved_bytes - reserved size for WriteBatchpublic WriteBatch(byte[] serialized)
data().public void iterate(WriteBatch.Handler handler) throws RocksDBException
handler - A handler that is called back for each
update present in the batchRocksDBException - If we cannot iterate over the batchpublic byte[] data()
public long getDataSize()
public boolean hasPut()
public boolean hasDelete()
public boolean hasSingleDelete()
public boolean hasDeleteRange()
public boolean hasMerge()
public boolean hasBeginPrepare()
public boolean hasEndPrepare()
public boolean hasCommit()
public boolean hasRollback()
public WriteBatch getWriteBatch()
WriteBatchInterfacegetWriteBatch in interface WriteBatchInterfacegetWriteBatch in class AbstractWriteBatchpublic void markWalTerminationPoint()
public WriteBatch.SavePoint getWalTerminationPoint()
markWalTerminationPoint()protected final void disposeInternal(long handle)
disposeInternal in class RocksObject