Table of Contents

Interface IKEFCoreCluster

Namespace
MASES.EntityFrameworkCore.KNet.Storage.Internal
Assembly
MASES.EntityFrameworkCore.KNet.dll

This is an internal API that supports the Entity Framework Core infrastructure and not subject to the same compatibility standards as public APIs. It may be changed or removed without notice in any release. You should only use it directly in your code with extreme caution and knowing that doing so can result in application failures when updating to a new Entity Framework Core release.

public interface IKEFCoreCluster : IDisposable
Inherited Members

Properties

ClusterId

The Apche Kafka cluster identifier

string ClusterId { get; }

Property Value

string

ComplexTypeConverterFactory

IComplexTypeConverterFactory ComplexTypeConverterFactory { get; }

Property Value

IComplexTypeConverterFactory

InfrastructureLogger

IDiagnosticsLogger<DbLoggerCategory.Infrastructure> InfrastructureLogger { get; }

Property Value

IDiagnosticsLogger<DbLoggerCategory.Infrastructure>

ValueGeneratorSelector

IValueGeneratorSelector ValueGeneratorSelector { get; }

Property Value

IValueGeneratorSelector

Methods

AbortTransactions(string)

Calls AbortTransaction() on the transactional producer for transactionGroup, then calls AbortPendingOffsets() on all IEntityTypeProducer registered in the group.

void AbortTransactions(string transactionGroup)

Parameters

transactionGroup string

BeginTransactions(string)

Calls BeginTransaction() on the transactional producer for transactionGroup.

void BeginTransactions(string transactionGroup)

Parameters

transactionGroup string

CommitTransactions(string)

Calls CommitTransaction() on the transactional producer for transactionGroup, then calls CommitPendingOffsets() on all IEntityTypeProducer registered in the group.

void CommitTransactions(string transactionGroup)

Parameters

transactionGroup string

CreateTopicForEntity(IKEFCoreDatabase, IEntityType)

Creates a topic for IEntityType on Apache Kafka cluster

string CreateTopicForEntity(IKEFCoreDatabase database, IEntityType entityType)

Parameters

database IKEFCoreDatabase
entityType IEntityType

Returns

string

EnsureConnected(IKEFCoreDatabase, IDiagnosticsLogger<Update>)

bool EnsureConnected(IKEFCoreDatabase database, IDiagnosticsLogger<DbLoggerCategory.Update> updateLogger)

Parameters

database IKEFCoreDatabase
updateLogger IDiagnosticsLogger<DbLoggerCategory.Update>

Returns

bool

EnsureCreated(IKEFCoreDatabase, IDiagnosticsLogger<Update>)

bool EnsureCreated(IKEFCoreDatabase database, IDiagnosticsLogger<DbLoggerCategory.Update> updateLogger)

Parameters

database IKEFCoreDatabase
updateLogger IDiagnosticsLogger<DbLoggerCategory.Update>

Returns

bool

EnsureDeleted(IKEFCoreDatabase, IDiagnosticsLogger<Update>)

bool EnsureDeleted(IKEFCoreDatabase database, IDiagnosticsLogger<DbLoggerCategory.Update> updateLogger)

Parameters

database IKEFCoreDatabase
updateLogger IDiagnosticsLogger<DbLoggerCategory.Update>

Returns

bool

EnsureSynchronized(IKEFCoreDatabase, long)

Verify if local instance is synchronized with the IKEFCoreCluster instance

bool? EnsureSynchronized(IKEFCoreDatabase database, long timeout)

Parameters

database IKEFCoreDatabase
timeout long

Returns

bool?

ExecuteTransaction(IKEFCoreDatabase, IList<IUpdateEntry>, IDiagnosticsLogger<Update>)

Executes a transaction

int ExecuteTransaction(IKEFCoreDatabase database, IList<IUpdateEntry> entries, IDiagnosticsLogger<DbLoggerCategory.Update> updateLogger)

Parameters

database IKEFCoreDatabase
entries IList<IUpdateEntry>
updateLogger IDiagnosticsLogger<DbLoggerCategory.Update>

Returns

int

ExecuteTransactionAsync(IKEFCoreDatabase, IList<IUpdateEntry>, IDiagnosticsLogger<Update>, CancellationToken)

Executes a transaction in async

Task<int> ExecuteTransactionAsync(IKEFCoreDatabase database, IList<IUpdateEntry> entries, IDiagnosticsLogger<DbLoggerCategory.Update> updateLogger, CancellationToken cancellationToken = default)

Parameters

database IKEFCoreDatabase
entries IList<IUpdateEntry>
updateLogger IDiagnosticsLogger<DbLoggerCategory.Update>
cancellationToken CancellationToken

Returns

Task<int>

GetOrCreateTransactionalProducer(string, ITransactionalEntityTypeProducer)

Returns or creates the transactional KafkaProducer<K, V> for the given transactionGroup, calling InitTransactions() on first creation. Registers entityTypeProducer in the group in the same call.

IProducer GetOrCreateTransactionalProducer(string transactionGroup, ITransactionalEntityTypeProducer entityTypeProducer)

Parameters

transactionGroup string

The transaction group name.

entityTypeProducer ITransactionalEntityTypeProducer

The ITransactionalEntityTypeProducer joining the group.

Returns

IProducer

The shared transactional producer for the group.

GetStreamsManager(IKEFCoreDatabase, Func<IKEFCoreDatabase, IStreamsManager>)

Retrieves the IStreamsManager associated to IKEFCoreDatabase in the instance of IKEFCoreCluster

IStreamsManager GetStreamsManager(IKEFCoreDatabase database, Func<IKEFCoreDatabase, IStreamsManager> createFunc)

Parameters

database IKEFCoreDatabase
createFunc Func<IKEFCoreDatabase, IStreamsManager>

Returns

IStreamsManager

GetTable(IEntityType)

Retrieves the IKEFCoreTable associated to IEntityType in the instance of IKEFCoreCluster

IKEFCoreTable GetTable(IEntityType entityType)

Parameters

entityType IEntityType

Returns

IKEFCoreTable

GetValueBuffer(IKEFCoreDatabase, IEntityType, object?[])

Retrieve the ValueBuffer for a specified key

ValueBuffer? GetValueBuffer(IKEFCoreDatabase database, IEntityType entityType, object?[] keyValues)

Parameters

database IKEFCoreDatabase
entityType IEntityType
keyValues object[]

Returns

ValueBuffer?

GetValueBuffers(IKEFCoreDatabase, IEntityType)

Retrieve the ValueBuffer

IEnumerable<ValueBuffer> GetValueBuffers(IKEFCoreDatabase database, IEntityType entityType)

Parameters

database IKEFCoreDatabase
entityType IEntityType

Returns

IEnumerable<ValueBuffer>

GetValueBuffersByPrefix(IKEFCoreDatabase, IEntityType, object?[])

Retrieve the ValueBuffer using prefix scan

IEnumerable<ValueBuffer> GetValueBuffersByPrefix(IKEFCoreDatabase database, IEntityType entityType, object?[] prefixValues)

Parameters

database IKEFCoreDatabase
entityType IEntityType
prefixValues object[]

Returns

IEnumerable<ValueBuffer>

GetValueBuffersRange(IKEFCoreDatabase, IEntityType, object?[]?, object?[]?)

Retrieve the ValueBuffer in a range of keys

IEnumerable<ValueBuffer> GetValueBuffersRange(IKEFCoreDatabase database, IEntityType entityType, object?[]? rangeStart, object?[]? rangeEnd)

Parameters

database IKEFCoreDatabase
entityType IEntityType
rangeStart object[]
rangeEnd object[]

Returns

IEnumerable<ValueBuffer>

GetValueBuffersReverse(IKEFCoreDatabase, IEntityType)

Retrieve the ValueBuffer in reverse order

IEnumerable<ValueBuffer> GetValueBuffersReverse(IKEFCoreDatabase database, IEntityType entityType)

Parameters

database IKEFCoreDatabase
entityType IEntityType

Returns

IEnumerable<ValueBuffer>

GetValueBuffersReverseRange(IKEFCoreDatabase, IEntityType, object?[]?, object?[]?)

Retrieve the ValueBuffer in a range of keys

IEnumerable<ValueBuffer> GetValueBuffersReverseRange(IKEFCoreDatabase database, IEntityType entityType, object?[]? rangeStart, object?[]? rangeEnd)

Parameters

database IKEFCoreDatabase
entityType IEntityType
rangeStart object[]
rangeEnd object[]

Returns

IEnumerable<ValueBuffer>

LatestOffsetForEntity(IEntityType)

Returns the latest offset for each partition associated to entityType

IDictionary<int, long> LatestOffsetForEntity(IEntityType entityType)

Parameters

entityType IEntityType

The IEntityType to check

Returns

IDictionary<int, long>

A IDictionary<TKey, TValue> containing the values

Register(IKEFCoreDatabase)

Register an instance of IKEFCoreDatabase in an instance of IKEFCoreCluster

void Register(IKEFCoreDatabase database)

Parameters

database IKEFCoreDatabase

The instance of IKEFCoreDatabase to be registered

ResetStreams(IKEFCoreDatabase)

Resets the Apache Kafka streams application associated to this IKEFCoreCluster instance

void ResetStreams(IKEFCoreDatabase database)

Parameters

database IKEFCoreDatabase

Unregister(IKEFCoreDatabase)

Unregister a previously registered instance of IKEFCoreDatabase from an instance of IKEFCoreCluster

void Unregister(IKEFCoreDatabase database)

Parameters

database IKEFCoreDatabase

The instance of IKEFCoreDatabase to be unregistered