Table of Contents

Class EventListener

Namespace
Org.Rocksdb
Assembly
MASES.KNet.dll
public class EventListener : JVMBridgeListener, IDynamicMetaObjectProvider, IJVMBridgeCore, IEquatable<IJVMBridgeBaseInstance>, IDisposable, IJVMBridgeBaseStatic, IJVMBridgeBase, IJVMBridgeBaseInstance, IJVMBridgeDefinition, IEventListener
Inheritance
EventListener
Implements
Derived

Constructors

EventListener(IJVMBridgeBaseInitializer)

Initializer used internally by JCOBridge. Do not use directly.

[Obsolete("This public initializer is needed for JCOBridge internal use, other uses can produce unidentifiable behaviors.")]
public EventListener(IJVMBridgeBaseInitializer initializer)

Parameters

initializer IJVMBridgeBaseInitializer

EventListener(params object[])

Generic constructor used by JCOBridge when a derived class needs to forward arguments to the base JVMBridgeBase class.

public EventListener(params object[] args)

Parameters

args object[]

Properties

BridgeClassName

Java class name to be instantiated

public override string BridgeClassName { get; }

Property Value

string

OnOnBackgroundError

public Action<BackgroundErrorReason, Status> OnOnBackgroundError { get; set; }

Property Value

Action<BackgroundErrorReason, Status>

Remarks

Assign a delegate to handle the event without subclassing. If both this handler and a virtual method override are present, the delegate takes precedence. Set to null to delegate to the virtual method.

OnOnColumnFamilyHandleDeletionStarted

public Action<ColumnFamilyHandle> OnOnColumnFamilyHandleDeletionStarted { get; set; }

Property Value

Action<ColumnFamilyHandle>

Remarks

Assign a delegate to handle the event without subclassing. If both this handler and a virtual method override are present, the delegate takes precedence. Set to null to delegate to the virtual method.

OnOnCompactionBegin

public Action<RocksDB, CompactionJobInfo> OnOnCompactionBegin { get; set; }

Property Value

Action<RocksDB, CompactionJobInfo>

Remarks

Assign a delegate to handle the event without subclassing. If both this handler and a virtual method override are present, the delegate takes precedence. Set to null to delegate to the virtual method.

OnOnCompactionCompleted

public Action<RocksDB, CompactionJobInfo> OnOnCompactionCompleted { get; set; }

Property Value

Action<RocksDB, CompactionJobInfo>

Remarks

Assign a delegate to handle the event without subclassing. If both this handler and a virtual method override are present, the delegate takes precedence. Set to null to delegate to the virtual method.

OnOnErrorRecoveryBegin

public Func<BackgroundErrorReason, Status, bool> OnOnErrorRecoveryBegin { get; set; }

Property Value

Func<BackgroundErrorReason, Status, bool>

Remarks

Assign a delegate to handle the event without subclassing. If both this handler and a virtual method override are present, the delegate takes precedence. Set to null to delegate to the virtual method.

OnOnErrorRecoveryBeginDispose

Optional handler invoked after the event handler returns, to dispose the JVM object returned by this event.

public Action<bool> OnOnErrorRecoveryBeginDispose { get; set; }

Property Value

Action<bool>

Remarks

Set OnOnErrorRecoveryBeginDispose when the event handler returns a JVM-backed object that is no longer needed after the call. The handler receives the return value and is responsible for calling Dispose() on it, releasing the underlying JVM global reference immediately instead of waiting for the .NET garbage collector to finalize it. If not set, the return value is not disposed automatically.

OnOnErrorRecoveryCompleted

public Action<Status> OnOnErrorRecoveryCompleted { get; set; }

Property Value

Action<Status>

Remarks

Assign a delegate to handle the event without subclassing. If both this handler and a virtual method override are present, the delegate takes precedence. Set to null to delegate to the virtual method.

OnOnExternalFileIngested

public Action<RocksDB, ExternalFileIngestionInfo> OnOnExternalFileIngested { get; set; }

Property Value

Action<RocksDB, ExternalFileIngestionInfo>

Remarks

Assign a delegate to handle the event without subclassing. If both this handler and a virtual method override are present, the delegate takes precedence. Set to null to delegate to the virtual method.

OnOnFileCloseFinish

public Action<FileOperationInfo> OnOnFileCloseFinish { get; set; }

Property Value

Action<FileOperationInfo>

Remarks

Assign a delegate to handle the event without subclassing. If both this handler and a virtual method override are present, the delegate takes precedence. Set to null to delegate to the virtual method.

OnOnFileFlushFinish

public Action<FileOperationInfo> OnOnFileFlushFinish { get; set; }

Property Value

Action<FileOperationInfo>

Remarks

Assign a delegate to handle the event without subclassing. If both this handler and a virtual method override are present, the delegate takes precedence. Set to null to delegate to the virtual method.

OnOnFileRangeSyncFinish

public Action<FileOperationInfo> OnOnFileRangeSyncFinish { get; set; }

Property Value

Action<FileOperationInfo>

Remarks

Assign a delegate to handle the event without subclassing. If both this handler and a virtual method override are present, the delegate takes precedence. Set to null to delegate to the virtual method.

OnOnFileReadFinish

public Action<FileOperationInfo> OnOnFileReadFinish { get; set; }

Property Value

Action<FileOperationInfo>

Remarks

Assign a delegate to handle the event without subclassing. If both this handler and a virtual method override are present, the delegate takes precedence. Set to null to delegate to the virtual method.

OnOnFileSyncFinish

public Action<FileOperationInfo> OnOnFileSyncFinish { get; set; }

Property Value

Action<FileOperationInfo>

Remarks

Assign a delegate to handle the event without subclassing. If both this handler and a virtual method override are present, the delegate takes precedence. Set to null to delegate to the virtual method.

OnOnFileTruncateFinish

public Action<FileOperationInfo> OnOnFileTruncateFinish { get; set; }

Property Value

Action<FileOperationInfo>

Remarks

Assign a delegate to handle the event without subclassing. If both this handler and a virtual method override are present, the delegate takes precedence. Set to null to delegate to the virtual method.

OnOnFileWriteFinish

public Action<FileOperationInfo> OnOnFileWriteFinish { get; set; }

Property Value

Action<FileOperationInfo>

Remarks

Assign a delegate to handle the event without subclassing. If both this handler and a virtual method override are present, the delegate takes precedence. Set to null to delegate to the virtual method.

OnOnFlushBegin

public Action<RocksDB, FlushJobInfo> OnOnFlushBegin { get; set; }

Property Value

Action<RocksDB, FlushJobInfo>

Remarks

Assign a delegate to handle the event without subclassing. If both this handler and a virtual method override are present, the delegate takes precedence. Set to null to delegate to the virtual method.

OnOnFlushCompleted

public Action<RocksDB, FlushJobInfo> OnOnFlushCompleted { get; set; }

Property Value

Action<RocksDB, FlushJobInfo>

Remarks

Assign a delegate to handle the event without subclassing. If both this handler and a virtual method override are present, the delegate takes precedence. Set to null to delegate to the virtual method.

OnOnMemTableSealed

public Action<MemTableInfo> OnOnMemTableSealed { get; set; }

Property Value

Action<MemTableInfo>

Remarks

Assign a delegate to handle the event without subclassing. If both this handler and a virtual method override are present, the delegate takes precedence. Set to null to delegate to the virtual method.

OnOnStallConditionsChanged

public Action<WriteStallInfo> OnOnStallConditionsChanged { get; set; }

Property Value

Action<WriteStallInfo>

Remarks

Assign a delegate to handle the event without subclassing. If both this handler and a virtual method override are present, the delegate takes precedence. Set to null to delegate to the virtual method.

OnOnTableFileCreated

public Action<TableFileCreationInfo> OnOnTableFileCreated { get; set; }

Property Value

Action<TableFileCreationInfo>

Remarks

Assign a delegate to handle the event without subclassing. If both this handler and a virtual method override are present, the delegate takes precedence. Set to null to delegate to the virtual method.

OnOnTableFileCreationStarted

public Action<TableFileCreationBriefInfo> OnOnTableFileCreationStarted { get; set; }

Property Value

Action<TableFileCreationBriefInfo>

Remarks

Assign a delegate to handle the event without subclassing. If both this handler and a virtual method override are present, the delegate takes precedence. Set to null to delegate to the virtual method.

OnOnTableFileDeleted

public Action<TableFileDeletionInfo> OnOnTableFileDeleted { get; set; }

Property Value

Action<TableFileDeletionInfo>

Remarks

Assign a delegate to handle the event without subclassing. If both this handler and a virtual method override are present, the delegate takes precedence. Set to null to delegate to the virtual method.

OnShouldBeNotifiedOnFileIO

public Func<bool> OnShouldBeNotifiedOnFileIO { get; set; }

Property Value

Func<bool>

Remarks

Assign a delegate to handle the event without subclassing. If both this handler and a virtual method override are present, the delegate takes precedence. Set to null to delegate to the virtual method.

OnShouldBeNotifiedOnFileIODispose

Optional handler invoked after the event handler returns, to dispose the JVM object returned by this event.

public Action<bool> OnShouldBeNotifiedOnFileIODispose { get; set; }

Property Value

Action<bool>

Remarks

Set OnShouldBeNotifiedOnFileIODispose when the event handler returns a JVM-backed object that is no longer needed after the call. The handler receives the return value and is responsible for calling Dispose() on it, releasing the underlying JVM global reference immediately instead of waiting for the .NET garbage collector to finalize it. If not set, the return value is not disposed automatically.

Methods

InitializeHandlers(Type)

Handlers initializer for EventListener

protected virtual void InitializeHandlers(Type listenerRuntimeType)

Parameters

listenerRuntimeType Type

ListenerShallManageEvent(int)

Invoked from the JVMBridgeListener on each received event to notify the user which can decide to abort the execution for the specific event returning false

protected override bool ListenerShallManageEvent(int eventIndex)

Parameters

eventIndex int

The index of the event triggered as returned from AddEventHandler(string, EventHandler) or AddEventHandler<TDataClass>(string, EventHandler<CLRListenerEventArgs<TDataClass>>)

Returns

bool

Returns true to continue event evaluation, false to return the control to the JVM

Remarks

By default every event continues the execution and reads the data from JVM; this implies an extra cost which can be limited using ListenerShallManageEvent(int) or the ListenerShallManageEventIndex/ListenerShallManageEventName handlers. Returning false the control is immediately returned to the JVM, anyway the user has received the notification. It can be useful in scenarios where the user is interested in few events and the other are simply discarded to optimize the execution speed. By default, this function invokes ListenerShallManageEventIndex, then try ListenerShallManageEventName if they are set or return true

ListenerShallManageEventHandlers(int)

protected virtual bool ListenerShallManageEventHandlers(int eventIndex)

Parameters

eventIndex int

Returns

bool

OnBackgroundError(BackgroundErrorReason, Status)

public virtual void OnBackgroundError(BackgroundErrorReason arg0, Status arg1)

Parameters

arg0 BackgroundErrorReason

BackgroundErrorReason

arg1 Status

Status

OnColumnFamilyHandleDeletionStarted(ColumnFamilyHandle)

public virtual void OnColumnFamilyHandleDeletionStarted(ColumnFamilyHandle arg0)

Parameters

arg0 ColumnFamilyHandle

ColumnFamilyHandle

OnCompactionBegin(RocksDB, CompactionJobInfo)

public virtual void OnCompactionBegin(RocksDB arg0, CompactionJobInfo arg1)

Parameters

arg0 RocksDB

RocksDB

arg1 CompactionJobInfo

CompactionJobInfo

OnCompactionCompleted(RocksDB, CompactionJobInfo)

public virtual void OnCompactionCompleted(RocksDB arg0, CompactionJobInfo arg1)

Parameters

arg0 RocksDB

RocksDB

arg1 CompactionJobInfo

CompactionJobInfo

OnErrorRecoveryBegin(BackgroundErrorReason, Status)

public virtual bool OnErrorRecoveryBegin(BackgroundErrorReason arg0, Status arg1)

Parameters

arg0 BackgroundErrorReason

BackgroundErrorReason

arg1 Status

Status

Returns

bool

bool

OnErrorRecoveryCompleted(Status)

public virtual void OnErrorRecoveryCompleted(Status arg0)

Parameters

arg0 Status

Status

OnExternalFileIngested(RocksDB, ExternalFileIngestionInfo)

public virtual void OnExternalFileIngested(RocksDB arg0, ExternalFileIngestionInfo arg1)

Parameters

arg0 RocksDB

RocksDB

arg1 ExternalFileIngestionInfo

ExternalFileIngestionInfo

OnFileCloseFinish(FileOperationInfo)

public virtual void OnFileCloseFinish(FileOperationInfo arg0)

Parameters

arg0 FileOperationInfo

FileOperationInfo

OnFileFlushFinish(FileOperationInfo)

public virtual void OnFileFlushFinish(FileOperationInfo arg0)

Parameters

arg0 FileOperationInfo

FileOperationInfo

OnFileRangeSyncFinish(FileOperationInfo)

public virtual void OnFileRangeSyncFinish(FileOperationInfo arg0)

Parameters

arg0 FileOperationInfo

FileOperationInfo

OnFileReadFinish(FileOperationInfo)

public virtual void OnFileReadFinish(FileOperationInfo arg0)

Parameters

arg0 FileOperationInfo

FileOperationInfo

OnFileSyncFinish(FileOperationInfo)

public virtual void OnFileSyncFinish(FileOperationInfo arg0)

Parameters

arg0 FileOperationInfo

FileOperationInfo

OnFileTruncateFinish(FileOperationInfo)

public virtual void OnFileTruncateFinish(FileOperationInfo arg0)

Parameters

arg0 FileOperationInfo

FileOperationInfo

OnFileWriteFinish(FileOperationInfo)

public virtual void OnFileWriteFinish(FileOperationInfo arg0)

Parameters

arg0 FileOperationInfo

FileOperationInfo

OnFlushBegin(RocksDB, FlushJobInfo)

public virtual void OnFlushBegin(RocksDB arg0, FlushJobInfo arg1)

Parameters

arg0 RocksDB

RocksDB

arg1 FlushJobInfo

FlushJobInfo

OnFlushCompleted(RocksDB, FlushJobInfo)

public virtual void OnFlushCompleted(RocksDB arg0, FlushJobInfo arg1)

Parameters

arg0 RocksDB

RocksDB

arg1 FlushJobInfo

FlushJobInfo

OnMemTableSealed(MemTableInfo)

public virtual void OnMemTableSealed(MemTableInfo arg0)

Parameters

arg0 MemTableInfo

MemTableInfo

OnStallConditionsChanged(WriteStallInfo)

public virtual void OnStallConditionsChanged(WriteStallInfo arg0)

Parameters

arg0 WriteStallInfo

WriteStallInfo

OnTableFileCreated(TableFileCreationInfo)

public virtual void OnTableFileCreated(TableFileCreationInfo arg0)

Parameters

arg0 TableFileCreationInfo

TableFileCreationInfo

OnTableFileCreationStarted(TableFileCreationBriefInfo)

public virtual void OnTableFileCreationStarted(TableFileCreationBriefInfo arg0)

Parameters

arg0 TableFileCreationBriefInfo

TableFileCreationBriefInfo

OnTableFileDeleted(TableFileDeletionInfo)

public virtual void OnTableFileDeleted(TableFileDeletionInfo arg0)

Parameters

arg0 TableFileDeletionInfo

TableFileDeletionInfo

ShouldBeNotifiedOnFileIO()

public virtual bool ShouldBeNotifiedOnFileIO()

Returns

bool

bool