public abstract class AbstractEventListener extends RocksCallbackObject implements EventListener
| Modifier and Type | Class and Description |
|---|---|
static class |
AbstractEventListener.EnabledEventCallback |
nativeHandle_owningHandle_| Modifier | Constructor and Description |
|---|---|
protected |
AbstractEventListener()
Creates an Event Listener that will
received all callbacks from C++.
|
protected |
AbstractEventListener(AbstractEventListener.EnabledEventCallback... enabledEventCallbacks)
Creates an Event Listener that will
receive only certain callbacks from C++.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
disposeInternal()
Deletes underlying C++ native callback object pointer
|
protected long |
initializeNative(long... nativeParameterHandles)
Construct the Native C++ object which will callback
to our object methods
|
void |
onBackgroundError(BackgroundErrorReason backgroundErrorReason,
Status backgroundError)
A callback function for RocksDB which will be called before setting the
background error status to a non-OK value.
|
void |
onColumnFamilyHandleDeletionStarted(ColumnFamilyHandle columnFamilyHandle)
A callback function for RocksDB which will be called before
a column family handle is deleted.
|
void |
onCompactionBegin(RocksDB db,
CompactionJobInfo compactionJobInfo)
A callback function to RocksDB which will be called before a
RocksDB starts to compact.
|
void |
onCompactionCompleted(RocksDB db,
CompactionJobInfo compactionJobInfo)
A callback function for RocksDB which will be called whenever
a registered RocksDB compacts a file.
|
boolean |
onErrorRecoveryBegin(BackgroundErrorReason backgroundErrorReason,
Status backgroundError)
A callback function for RocksDB which will be called just before
starting the automatic recovery process for recoverable background
errors, such as NoSpace().
|
void |
onErrorRecoveryCompleted(Status oldBackgroundError)
A callback function for RocksDB which will be called once the database
is recovered from read-only mode after an error.
|
void |
onExternalFileIngested(RocksDB db,
ExternalFileIngestionInfo externalFileIngestionInfo)
A callback function for RocksDB which will be called after an external
file is ingested using IngestExternalFile.
|
void |
onFileCloseFinish(FileOperationInfo fileOperationInfo)
A callback function for RocksDB which will be called whenever a file close
operation finishes.
|
void |
onFileFlushFinish(FileOperationInfo fileOperationInfo)
A callback function for RocksDB which will be called whenever a file flush
operation finishes.
|
void |
onFileRangeSyncFinish(FileOperationInfo fileOperationInfo)
A callback function for RocksDB which will be called whenever a file
rangeSync operation finishes.
|
void |
onFileReadFinish(FileOperationInfo fileOperationInfo)
A callback function for RocksDB which will be called whenever a file read
operation finishes.
|
void |
onFileSyncFinish(FileOperationInfo fileOperationInfo)
A callback function for RocksDB which will be called whenever a file sync
operation finishes.
|
void |
onFileTruncateFinish(FileOperationInfo fileOperationInfo)
A callback function for RocksDB which will be called whenever a file
truncate operation finishes.
|
void |
onFileWriteFinish(FileOperationInfo fileOperationInfo)
A callback function for RocksDB which will be called whenever a file write
operation finishes.
|
void |
onFlushBegin(RocksDB db,
FlushJobInfo flushJobInfo)
A callback function to RocksDB which will be called before a
RocksDB starts to flush memtables.
|
void |
onFlushCompleted(RocksDB db,
FlushJobInfo flushJobInfo)
callback function to RocksDB which will be called whenever a
registered RocksDB flushes a file.
|
void |
onMemTableSealed(MemTableInfo memTableInfo)
A callback function for RocksDB which will be called before
a memtable is made immutable.
|
void |
onStallConditionsChanged(WriteStallInfo writeStallInfo)
A callback function for RocksDB which will be called whenever a change
of superversion triggers a change of the stall conditions.
|
void |
onTableFileCreated(TableFileCreationInfo tableFileCreationInfo)
A callback function for RocksDB which will be called whenever
a SST file is created.
|
void |
onTableFileCreationStarted(TableFileCreationBriefInfo tableFileCreationBriefInfo)
A callback function for RocksDB which will be called before
a SST file is being created.
|
void |
onTableFileDeleted(TableFileDeletionInfo tableFileDeletionInfo)
A callback function for RocksDB which will be called whenever
a SST file is deleted.
|
boolean |
shouldBeNotifiedOnFileIO()
If true, the
EventListener.onFileReadFinish(FileOperationInfo)
and EventListener.onFileWriteFinish(FileOperationInfo) will be called. |
close, disOwnNativeHandle, isOwningHandledispose, finalizeprotected AbstractEventListener()
AbstractEventListener(EnabledEventCallback...) instead.protected AbstractEventListener(AbstractEventListener.EnabledEventCallback... enabledEventCallbacks)
enabledEventCallbacks - callbacks to enable in Java.public void onFlushCompleted(RocksDB db, FlushJobInfo flushJobInfo)
EventListeneronFlushCompleted in interface EventListenerdb - the databaseflushJobInfo - the flush job info, contains data copied from
respective native structure.public void onFlushBegin(RocksDB db, FlushJobInfo flushJobInfo)
EventListeneronFlushBegin in interface EventListenerdb - the databaseflushJobInfo - the flush job info, contains data copied from
respective native structure.public void onTableFileDeleted(TableFileDeletionInfo tableFileDeletionInfo)
EventListenerEventListener.onCompactionCompleted(RocksDB, CompactionJobInfo) and
EventListener.onFlushCompleted(RocksDB, FlushJobInfo),
this callback is designed for external logging
service and thus only provide string parameters instead
of a pointer to DB. Applications that build logic basic based
on file creations and deletions is suggested to implement
EventListener.onFlushCompleted(RocksDB, FlushJobInfo) and
EventListener.onCompactionCompleted(RocksDB, CompactionJobInfo).
Note that if applications would like to use the passed reference
outside this function call, they should make copies from the
returned value.onTableFileDeleted in interface EventListenertableFileDeletionInfo - the table file deletion info,
contains data copied from respective native structure.public void onCompactionBegin(RocksDB db, CompactionJobInfo compactionJobInfo)
EventListeneronCompactionBegin in interface EventListenerdb - a pointer to the rocksdb instance which just compacted
a file.compactionJobInfo - a reference to a native CompactionJobInfo struct,
which is released after this function is returned, and must be copied
if it is needed outside of this function.public void onCompactionCompleted(RocksDB db, CompactionJobInfo compactionJobInfo)
EventListeneronCompactionCompleted in interface EventListenerdb - a pointer to the rocksdb instance which just compacted
a file.compactionJobInfo - a reference to a native CompactionJobInfo struct,
which is released after this function is returned, and must be copied
if it is needed outside of this function.public void onTableFileCreated(TableFileCreationInfo tableFileCreationInfo)
EventListeneronTableFileCreated in interface EventListenertableFileCreationInfo - the table file creation info,
contains data copied from respective native structure.public void onTableFileCreationStarted(TableFileCreationBriefInfo tableFileCreationBriefInfo)
EventListeneronTableFileCreationStarted in interface EventListenertableFileCreationBriefInfo - the table file creation brief info,
contains data copied from respective native structure.public void onMemTableSealed(MemTableInfo memTableInfo)
EventListeneronMemTableSealed in interface EventListenermemTableInfo - the mem table info, contains data
copied from respective native structure.public void onColumnFamilyHandleDeletionStarted(ColumnFamilyHandle columnFamilyHandle)
EventListeneronColumnFamilyHandleDeletionStarted in interface EventListenercolumnFamilyHandle - is a pointer to the column family handle to be
deleted which will become a dangling pointer after the deletion.public void onExternalFileIngested(RocksDB db, ExternalFileIngestionInfo externalFileIngestionInfo)
EventListeneronExternalFileIngested in interface EventListenerdb - the databaseexternalFileIngestionInfo - the external file ingestion info,
contains data copied from respective native structure.public void onBackgroundError(BackgroundErrorReason backgroundErrorReason, Status backgroundError)
EventListeneronBackgroundError in interface EventListenerbackgroundErrorReason - background error reason codebackgroundError - background error codespublic void onStallConditionsChanged(WriteStallInfo writeStallInfo)
EventListeneronStallConditionsChanged in interface EventListenerwriteStallInfo - write stall info,
contains data copied from respective native structure.public void onFileReadFinish(FileOperationInfo fileOperationInfo)
EventListeneronFileReadFinish in interface EventListenerfileOperationInfo - file operation info,
contains data copied from respective native structure.public void onFileWriteFinish(FileOperationInfo fileOperationInfo)
EventListeneronFileWriteFinish in interface EventListenerfileOperationInfo - file operation info,
contains data copied from respective native structure.public void onFileFlushFinish(FileOperationInfo fileOperationInfo)
EventListeneronFileFlushFinish in interface EventListenerfileOperationInfo - file operation info,
contains data copied from respective native structure.public void onFileSyncFinish(FileOperationInfo fileOperationInfo)
EventListeneronFileSyncFinish in interface EventListenerfileOperationInfo - file operation info,
contains data copied from respective native structure.public void onFileRangeSyncFinish(FileOperationInfo fileOperationInfo)
EventListeneronFileRangeSyncFinish in interface EventListenerfileOperationInfo - file operation info,
contains data copied from respective native structure.public void onFileTruncateFinish(FileOperationInfo fileOperationInfo)
EventListeneronFileTruncateFinish in interface EventListenerfileOperationInfo - file operation info,
contains data copied from respective native structure.public void onFileCloseFinish(FileOperationInfo fileOperationInfo)
EventListeneronFileCloseFinish in interface EventListenerfileOperationInfo - file operation info,
contains data copied from respective native structure.public boolean shouldBeNotifiedOnFileIO()
EventListenerEventListener.onFileReadFinish(FileOperationInfo)
and EventListener.onFileWriteFinish(FileOperationInfo) will be called. If
false, then they won't be called.
Default: falseshouldBeNotifiedOnFileIO in interface EventListenerfalse by defaultpublic boolean onErrorRecoveryBegin(BackgroundErrorReason backgroundErrorReason, Status backgroundError)
EventListeneronErrorRecoveryBegin in interface EventListenerbackgroundErrorReason - background error reason codebackgroundError - background error codesfalse if the automatic recovery should be suppressedpublic void onErrorRecoveryCompleted(Status oldBackgroundError)
EventListeneronErrorRecoveryCompleted in interface EventListeneroldBackgroundError - old background error codesprotected long initializeNative(long... nativeParameterHandles)
RocksCallbackObjectinitializeNative in class RocksCallbackObjectnativeParameterHandles - An array of native handles for any parameter
objects that are needed during constructionprotected void disposeInternal()
disposeInternal in class RocksCallbackObjectCopyright © 2021. All rights reserved.