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
ComplexTypeConverterFactory
The global IComplexTypeConverterFactory
IComplexTypeConverterFactory ComplexTypeConverterFactory { get; }
Property Value
InfrastructureLogger
Reference to IDiagnosticsLogger<TLoggerCategory> received
IDiagnosticsLogger<DbLoggerCategory.Infrastructure> InfrastructureLogger { get; }
Property Value
ValueGeneratorSelector
The global IValueGeneratorSelector
IValueGeneratorSelector ValueGeneratorSelector { get; }
Property Value
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
transactionGroupstring
BeginTransactions(string)
Calls BeginTransaction() on the transactional producer for transactionGroup.
void BeginTransactions(string transactionGroup)
Parameters
transactionGroupstring
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
transactionGroupstring
CreateTopicForEntity(IKEFCoreDatabase, IEntityType)
Creates a topic for IEntityType on Apache Kafka cluster
string CreateTopicForEntity(IKEFCoreDatabase database, IEntityType entityType)
Parameters
databaseIKEFCoreDatabaseentityTypeIEntityType
Returns
EnsureConnected(IKEFCoreDatabase, IDiagnosticsLogger<Update>)
Execute the EnsureDatabaseConnected()
bool EnsureConnected(IKEFCoreDatabase database, IDiagnosticsLogger<DbLoggerCategory.Update> updateLogger)
Parameters
databaseIKEFCoreDatabaseupdateLoggerIDiagnosticsLogger<DbLoggerCategory.Update>
Returns
EnsureCreated(IKEFCoreDatabase, IDiagnosticsLogger<Update>)
Execute the EnsureDatabaseCreated()
bool EnsureCreated(IKEFCoreDatabase database, IDiagnosticsLogger<DbLoggerCategory.Update> updateLogger)
Parameters
databaseIKEFCoreDatabaseupdateLoggerIDiagnosticsLogger<DbLoggerCategory.Update>
Returns
EnsureDeleted(IKEFCoreDatabase, IDiagnosticsLogger<Update>)
Execute the EnsureDatabaseDeleted()
bool EnsureDeleted(IKEFCoreDatabase database, IDiagnosticsLogger<DbLoggerCategory.Update> updateLogger)
Parameters
databaseIKEFCoreDatabaseupdateLoggerIDiagnosticsLogger<DbLoggerCategory.Update>
Returns
EnsureSynchronized(IKEFCoreDatabase, long)
Verify if local instance is synchronized with the IKEFCoreCluster instance
bool? EnsureSynchronized(IKEFCoreDatabase database, long timeout)
Parameters
databaseIKEFCoreDatabasetimeoutlong
Returns
- bool?
ExecuteTransaction(IKEFCoreDatabase, IList<IUpdateEntry>, IDiagnosticsLogger<Update>)
Executes a transaction
int ExecuteTransaction(IKEFCoreDatabase database, IList<IUpdateEntry> entries, IDiagnosticsLogger<DbLoggerCategory.Update> updateLogger)
Parameters
databaseIKEFCoreDatabaseentriesIList<IUpdateEntry>updateLoggerIDiagnosticsLogger<DbLoggerCategory.Update>
Returns
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
databaseIKEFCoreDatabaseentriesIList<IUpdateEntry>updateLoggerIDiagnosticsLogger<DbLoggerCategory.Update>cancellationTokenCancellationToken
Returns
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
transactionGroupstringThe transaction group name.
entityTypeProducerITransactionalEntityTypeProducerThe 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
databaseIKEFCoreDatabasecreateFuncFunc<IKEFCoreDatabase, IStreamsManager>
Returns
GetTable(IEntityType)
Retrieves the IKEFCoreTable associated to IEntityType in the instance of IKEFCoreCluster
IKEFCoreTable GetTable(IEntityType entityType)
Parameters
entityTypeIEntityType
Returns
GetValueBuffer(IKEFCoreDatabase, IEntityType, object?[])
Retrieve the ValueBuffer for a specified key
ValueBuffer? GetValueBuffer(IKEFCoreDatabase database, IEntityType entityType, object?[] keyValues)
Parameters
databaseIKEFCoreDatabaseentityTypeIEntityTypekeyValuesobject[]
Returns
GetValueBuffers(IKEFCoreDatabase, IEntityType)
Retrieve the ValueBuffer
IEnumerable<ValueBuffer> GetValueBuffers(IKEFCoreDatabase database, IEntityType entityType)
Parameters
databaseIKEFCoreDatabaseentityTypeIEntityType
Returns
GetValueBuffersByPrefix(IKEFCoreDatabase, IEntityType, object?[])
Retrieve the ValueBuffer using prefix scan
IEnumerable<ValueBuffer> GetValueBuffersByPrefix(IKEFCoreDatabase database, IEntityType entityType, object?[] prefixValues)
Parameters
databaseIKEFCoreDatabaseentityTypeIEntityTypeprefixValuesobject[]
Returns
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
databaseIKEFCoreDatabaseentityTypeIEntityTyperangeStartobject[]rangeEndobject[]
Returns
GetValueBuffersReverse(IKEFCoreDatabase, IEntityType)
Retrieve the ValueBuffer in reverse order
IEnumerable<ValueBuffer> GetValueBuffersReverse(IKEFCoreDatabase database, IEntityType entityType)
Parameters
databaseIKEFCoreDatabaseentityTypeIEntityType
Returns
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
databaseIKEFCoreDatabaseentityTypeIEntityTyperangeStartobject[]rangeEndobject[]
Returns
LatestOffsetForEntity(IEntityType)
Returns the latest offset for each partition associated to entityType
IDictionary<int, long> LatestOffsetForEntity(IEntityType entityType)
Parameters
entityTypeIEntityTypeThe 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
databaseIKEFCoreDatabaseThe instance of IKEFCoreDatabase to be registered
ResetStreams(IKEFCoreDatabase)
Resets the Apache Kafka streams application associated to this IKEFCoreCluster instance
void ResetStreams(IKEFCoreDatabase database)
Parameters
databaseIKEFCoreDatabase
Unregister(IKEFCoreDatabase)
Unregister a previously registered instance of IKEFCoreDatabase from an instance of IKEFCoreCluster
void Unregister(IKEFCoreDatabase database)
Parameters
databaseIKEFCoreDatabaseThe instance of IKEFCoreDatabase to be unregistered