Table of Contents

Class RocksDbLifecycleDelegateHandler

Namespace
Org.Apache.Kafka.Streams.State
Assembly
MASES.KNet.dll

Internal IRocksDbLifecycleHandler implementation wrapping the callback handlers configured through Fluent API.

public sealed class RocksDbLifecycleDelegateHandler : IRocksDbLifecycleHandler
Inheritance
RocksDbLifecycleDelegateHandler
Implements
Inherited Members

Remarks

This type is used to unify callback-based configuration and type-based configuration behind the same runtime contract, IRocksDbLifecycleHandler.

Constructors

RocksDbLifecycleDelegateHandler(Action<Options, IKNetConfigurationFromMap, IDictionary<string, object>>, Action<Options, IDictionary<string, object>>)

Internal IRocksDbLifecycleHandler implementation wrapping the callback handlers configured through Fluent API.

public RocksDbLifecycleDelegateHandler(Action<Options, IKNetConfigurationFromMap, IDictionary<string, object>> onSetConfig, Action<Options, IDictionary<string, object>> onClose)

Parameters

onSetConfig Action<Options, IKNetConfigurationFromMap, IDictionary<string, object>>

Callback invoked when RocksDB configures the state store. The data dictionary supplied to this callback is the per-store lifetime container that must retain any managed object still referenced by native RocksDB components for the whole lifetime of the store.

onClose Action<Options, IDictionary<string, object>>

Callback invoked when RocksDB closes the state store. The same per-store lifetime dictionary previously supplied to the onSetConfig callback is passed back so that retained resources can be retrieved and disposed explicitly.

Remarks

This type is used to unify callback-based configuration and type-based configuration behind the same runtime contract, IRocksDbLifecycleHandler.

Fields

Null

Returns a no-op implementation of IRocksDbLifecycleHandler

public static readonly IRocksDbLifecycleHandler Null

Field Value

IRocksDbLifecycleHandler

Methods

OnClose(Options, IDictionary<string, object>)

Invoked when RocksDB is closing the state store associated to the current entity storage.

public void OnClose(Options options, IDictionary<string, object> data)

Parameters

options Options

The RocksDB Options instance associated to the store.

data IDictionary<string, object>

The same per-store dictionary previously provided to OnSetConfig(Options, IKNetConfigurationFromMap, IDictionary<string, object>).

Remarks

Implementations should retrieve from data any resource created during OnSetConfig(Options, IKNetConfigurationFromMap, IDictionary<string, object>) and dispose it explicitly if needed.

OnSetConfig(Options, IKNetConfigurationFromMap, IDictionary<string, object>)

Invoked when RocksDB is configuring the state store associated to the current entity storage.

public void OnSetConfig(Options options, IKNetConfigurationFromMap configuration, IDictionary<string, object> data)

Parameters

options Options

The RocksDB Options instance to be configured.

configuration IKNetConfigurationFromMap

The KNet IKNetConfigurationFromMap map associated to the callback.

data IDictionary<string, object>

A per-store dictionary used to keep managed objects alive for the whole lifetime of the underlying RocksDB store instance.

Remarks

Any managed object created during configuration and referenced natively by RocksDB (for example LRUCache, BlockBasedTableConfig, or similar objects) must be stored in data. Otherwise the .NET GC may collect it while RocksDB is still holding the native reference, causing non-deterministic crashes.

The same dictionary instance is later passed back to OnClose(Options, IDictionary<string, object>), so implementations can retrieve and explicitly dispose the resources that were stored here.