Package org.rocksdb
Class WriteBatch.Handler
java.lang.Object
org.rocksdb.AbstractNativeReference
org.rocksdb.AbstractImmutableNativeReference
org.rocksdb.RocksCallbackObject
org.rocksdb.WriteBatch.Handler
- All Implemented Interfaces:
AutoCloseable
- Enclosing class:
WriteBatch
Handler callback for iterating over the contents of a batch.
-
Field Summary
Fields inherited from class org.rocksdb.RocksCallbackObject
nativeHandle_Fields inherited from class org.rocksdb.AbstractImmutableNativeReference
owningHandle_ -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voiddelete(byte[] key) abstract voiddelete(int columnFamilyId, byte[] key) abstract voiddeleteRange(byte[] beginKey, byte[] endKey) abstract voiddeleteRange(int columnFamilyId, byte[] beginKey, byte[] endKey) protected longinitializeNative(long... nativeParameterHandles) Construct the Native C++ object which will callback to our object methodsabstract voidlogData(byte[] blob) abstract voidabstract voidmarkCommit(byte[] xid) abstract voidmarkCommitWithTimestamp(byte[] xid, byte[] ts) abstract voidmarkEndPrepare(byte[] xid) abstract voidmarkNoop(boolean emptyBatch) abstract voidmarkRollback(byte[] xid) abstract voidmerge(byte[] key, byte[] value) abstract voidmerge(int columnFamilyId, byte[] key, byte[] value) abstract voidput(byte[] key, byte[] value) abstract voidput(int columnFamilyId, byte[] key, byte[] value) abstract voidputBlobIndex(int columnFamilyId, byte[] key, byte[] value) booleanshouldContinue is called by the underlying iteratorWriteBatch.iterate(Handler).abstract voidsingleDelete(byte[] key) abstract voidsingleDelete(int columnFamilyId, byte[] key) Methods inherited from class org.rocksdb.RocksCallbackObject
disposeInternalMethods inherited from class org.rocksdb.AbstractImmutableNativeReference
close, disOwnNativeHandle, isOwningHandle
-
Constructor Details
-
Handler
public Handler()
-
-
Method Details
-
initializeNative
protected long initializeNative(long... nativeParameterHandles) Description copied from class:RocksCallbackObjectConstruct the Native C++ object which will callback to our object methods- Specified by:
initializeNativein classRocksCallbackObject- Parameters:
nativeParameterHandles- An array of native handles for any parameter objects that are needed during construction- Returns:
- The native handle of the C++ object which will callback to us
-
put
- Throws:
RocksDBException
-
put
public abstract void put(byte[] key, byte[] value) -
merge
- Throws:
RocksDBException
-
merge
public abstract void merge(byte[] key, byte[] value) -
delete
- Throws:
RocksDBException
-
delete
public abstract void delete(byte[] key) -
singleDelete
- Throws:
RocksDBException
-
singleDelete
public abstract void singleDelete(byte[] key) -
deleteRange
public abstract void deleteRange(int columnFamilyId, byte[] beginKey, byte[] endKey) throws RocksDBException - Throws:
RocksDBException
-
deleteRange
public abstract void deleteRange(byte[] beginKey, byte[] endKey) -
logData
public abstract void logData(byte[] blob) -
putBlobIndex
public abstract void putBlobIndex(int columnFamilyId, byte[] key, byte[] value) throws RocksDBException - Throws:
RocksDBException
-
markBeginPrepare
- Throws:
RocksDBException
-
markEndPrepare
- Throws:
RocksDBException
-
markNoop
- Throws:
RocksDBException
-
markRollback
- Throws:
RocksDBException
-
markCommit
- Throws:
RocksDBException
-
markCommitWithTimestamp
- Throws:
RocksDBException
-
shouldContinue
public boolean shouldContinue()shouldContinue is called by the underlying iteratorWriteBatch.iterate(Handler). If it returns false, iteration is halted. Otherwise, it continues iterating. The default implementation always returns true.- Returns:
- boolean value indicating if the iteration is halted.
-