Table of Contents

Class KEFCoreCluster

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 class KEFCoreCluster : IKEFCoreCluster, IDisposable
Inheritance
KEFCoreCluster
Implements
Inherited Members

Constructors

KEFCoreCluster(KEFCoreOptionsExtension, IDiagnosticsLogger<Infrastructure>, IKEFCoreTableFactory, IComplexTypeConverterFactory, IValueGeneratorSelector, IUpdateAdapterFactory, IModel)

Dfault initializer

public KEFCoreCluster(KEFCoreOptionsExtension options, IDiagnosticsLogger<DbLoggerCategory.Infrastructure> infrastructureLogger, IKEFCoreTableFactory tableFactory, IComplexTypeConverterFactory complexTypeConverterFactory, IValueGeneratorSelector valueGeneratorSelector, IUpdateAdapterFactory updateAdapterFactory, IModel designModel)

Parameters

options KEFCoreOptionsExtension
infrastructureLogger IDiagnosticsLogger<DbLoggerCategory.Infrastructure>
tableFactory IKEFCoreTableFactory
complexTypeConverterFactory IComplexTypeConverterFactory
valueGeneratorSelector IValueGeneratorSelector
updateAdapterFactory IUpdateAdapterFactory
designModel IModel

Properties

ClusterId

The Apche Kafka cluster identifier

public virtual string ClusterId { get; }

Property Value

string

ComplexTypeConverterFactory

public virtual IComplexTypeConverterFactory ComplexTypeConverterFactory { get; }

Property Value

IComplexTypeConverterFactory

InfrastructureLogger

The IDiagnosticsLogger<TLoggerCategory> to be used to log info within the provider

public virtual IDiagnosticsLogger<DbLoggerCategory.Infrastructure> InfrastructureLogger { get; }

Property Value

IDiagnosticsLogger<DbLoggerCategory.Infrastructure>

Model

The associated IModel

public virtual IModel Model { get; }

Property Value

IModel

Options

public virtual KEFCoreOptionsExtension Options { get; }

Property Value

KEFCoreOptionsExtension

UpdateAdapterFactory

The associated IUpdateAdapterFactory

public virtual IUpdateAdapterFactory UpdateAdapterFactory { get; }

Property Value

IUpdateAdapterFactory

ValueGeneratorSelector

Returns the IValueGeneratorSelector instance

public IValueGeneratorSelector ValueGeneratorSelector { get; }

Property Value

IValueGeneratorSelector

Methods

CreateTopicForEntity(IEntityType)

Creates a topic for IEntityType on Apache Kafka cluster

public virtual string CreateTopicForEntity(IEntityType entityType)

Parameters

entityType IEntityType

Returns

string

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public virtual void Dispose()

EnsureConnected(IDiagnosticsLogger<Update>)

public virtual bool EnsureConnected(IDiagnosticsLogger<DbLoggerCategory.Update> updateLogger)

Parameters

updateLogger IDiagnosticsLogger<DbLoggerCategory.Update>

Returns

bool

EnsureCreated(IDiagnosticsLogger<Update>)

public virtual bool EnsureCreated(IDiagnosticsLogger<DbLoggerCategory.Update> updateLogger)

Parameters

updateLogger IDiagnosticsLogger<DbLoggerCategory.Update>

Returns

bool

EnsureDeleted(IDiagnosticsLogger<Update>)

public virtual bool EnsureDeleted(IDiagnosticsLogger<DbLoggerCategory.Update> updateLogger)

Parameters

updateLogger IDiagnosticsLogger<DbLoggerCategory.Update>

Returns

bool

EnsureSynchronized(long)

Verify if local instance is synchronized with the IKEFCoreCluster instance

public virtual bool? EnsureSynchronized(long timeout)

Parameters

timeout long

Returns

bool?

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

Executes a transaction

public virtual int ExecuteTransaction(IList<IUpdateEntry> entries, IDiagnosticsLogger<DbLoggerCategory.Update> updateLogger)

Parameters

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

Returns

int

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

Executes a transaction in async

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

Parameters

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

Returns

Task<int>

GetTable(IEntityType)

Retrieves the IKEFCoreTable associated to IEntityType in the instance of IKEFCoreCluster

public IKEFCoreTable GetTable(IEntityType entityType)

Parameters

entityType IEntityType

Returns

IKEFCoreTable

GetValueBuffer(IEntityType, object[])

Retrieve the ValueBuffer for a specified key

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

Parameters

entityType IEntityType
keyValues object[]

Returns

ValueBuffer?

GetValueBuffers(IEntityType)

Retrieve the ValueBuffer

public virtual IEnumerable<ValueBuffer> GetValueBuffers(IEntityType entityType)

Parameters

entityType IEntityType

Returns

IEnumerable<ValueBuffer>

GetValueBuffersByPrefix(IEntityType, object[])

Retrieve the ValueBuffer using prefix scan

public IEnumerable<ValueBuffer> GetValueBuffersByPrefix(IEntityType entityType, object[] prefixValues)

Parameters

entityType IEntityType
prefixValues object[]

Returns

IEnumerable<ValueBuffer>

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

Retrieve the ValueBuffer in a range of keys

public IEnumerable<ValueBuffer> GetValueBuffersRange(IEntityType entityType, object[] rangeStart, object[] rangeEnd)

Parameters

entityType IEntityType
rangeStart object[]
rangeEnd object[]

Returns

IEnumerable<ValueBuffer>

GetValueBuffersReverse(IEntityType)

Retrieve the ValueBuffer in reverse order

public IEnumerable<ValueBuffer> GetValueBuffersReverse(IEntityType entityType)

Parameters

entityType IEntityType

Returns

IEnumerable<ValueBuffer>

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

Retrieve the ValueBuffer in a range of keys

public IEnumerable<ValueBuffer> GetValueBuffersReverseRange(IEntityType entityType, object[] rangeStart, object[] rangeEnd)

Parameters

entityType IEntityType
rangeStart object[]
rangeEnd object[]

Returns

IEnumerable<ValueBuffer>

LatestOffsetForEntity(IEntityType)

Returns the latest offset for each partition associated to entityType

public IDictionary<int, long> LatestOffsetForEntity(IEntityType entityType)

Parameters

entityType IEntityType

The IEntityType to check

Returns

IDictionary<int, long>

A IDictionary<TKey, TValue> containing the values

ResetStreams()

Resets the Apache Kafka streams application associated to this IKEFCoreCluster instance

public void ResetStreams()