Package org.rocksdb

Class RocksCallbackObject

All Implemented Interfaces:
AutoCloseable
Direct Known Subclasses:
AbstractCompactionFilterFactory, AbstractComparator, AbstractEventListener, AbstractTableFilter, AbstractTraceWriter, AbstractTransactionNotifier, AbstractWalFilter, Logger, WriteBatch.Handler

public abstract class RocksCallbackObject extends AbstractImmutableNativeReference
RocksCallbackObject is similar to RocksObject but varies in its construction as it is designed for Java objects which have functions which are called from C++ via JNI.

RocksCallbackObject is the base-class any RocksDB classes that acts as a callback from some underlying underlying native C++ rocksdb object.

The use of RocksObject should always be preferred over RocksCallbackObject if callbacks are not required.

  • Field Details

    • nativeHandle_

      protected final long nativeHandle_
  • Constructor Details

    • RocksCallbackObject

      protected RocksCallbackObject(long... nativeParameterHandles)
  • Method Details

    • initializeNative

      protected abstract long initializeNative(long... nativeParameterHandles)
      Construct the Native C++ object which will callback to our object methods
      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
    • disposeInternal

      protected void disposeInternal()
      Deletes underlying C++ native callback object pointer
      Specified by:
      disposeInternal in class AbstractImmutableNativeReference