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
optionsKEFCoreOptionsExtensioninfrastructureLoggerIDiagnosticsLogger<DbLoggerCategory.Infrastructure>tableFactoryIKEFCoreTableFactorycomplexTypeConverterFactoryIComplexTypeConverterFactoryvalueGeneratorSelectorIValueGeneratorSelectorupdateAdapterFactoryIUpdateAdapterFactorydesignModelIModel
Properties
ClusterId
The Apche Kafka cluster identifier
public virtual string ClusterId { get; }
Property Value
ComplexTypeConverterFactory
The global IComplexTypeConverterFactory
public virtual IComplexTypeConverterFactory ComplexTypeConverterFactory { get; }
Property Value
InfrastructureLogger
The IDiagnosticsLogger<TLoggerCategory> to be used to log info within the provider
public virtual IDiagnosticsLogger<DbLoggerCategory.Infrastructure> InfrastructureLogger { get; }
Property Value
Model
The associated IModel
public virtual IModel Model { get; }
Property Value
Options
public virtual KEFCoreOptionsExtension Options { get; }
Property Value
UpdateAdapterFactory
The associated IUpdateAdapterFactory
public virtual IUpdateAdapterFactory UpdateAdapterFactory { get; }
Property Value
ValueGeneratorSelector
Returns the IValueGeneratorSelector instance
public IValueGeneratorSelector ValueGeneratorSelector { get; }
Property Value
Methods
CreateTopicForEntity(IEntityType)
Creates a topic for IEntityType on Apache Kafka cluster
public virtual string CreateTopicForEntity(IEntityType entityType)
Parameters
entityTypeIEntityType
Returns
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public virtual void Dispose()
EnsureConnected(IDiagnosticsLogger<Update>)
Execute the EnsureDatabaseConnected()
public virtual bool EnsureConnected(IDiagnosticsLogger<DbLoggerCategory.Update> updateLogger)
Parameters
updateLoggerIDiagnosticsLogger<DbLoggerCategory.Update>
Returns
EnsureCreated(IDiagnosticsLogger<Update>)
Execute the EnsureDatabaseCreated()
public virtual bool EnsureCreated(IDiagnosticsLogger<DbLoggerCategory.Update> updateLogger)
Parameters
updateLoggerIDiagnosticsLogger<DbLoggerCategory.Update>
Returns
EnsureDeleted(IDiagnosticsLogger<Update>)
Execute the EnsureDatabaseDeleted()
public virtual bool EnsureDeleted(IDiagnosticsLogger<DbLoggerCategory.Update> updateLogger)
Parameters
updateLoggerIDiagnosticsLogger<DbLoggerCategory.Update>
Returns
EnsureSynchronized(long)
Verify if local instance is synchronized with the IKEFCoreCluster instance
public virtual bool? EnsureSynchronized(long timeout)
Parameters
timeoutlong
Returns
- bool?
ExecuteTransaction(IList<IUpdateEntry>, IDiagnosticsLogger<Update>)
Executes a transaction
public virtual int ExecuteTransaction(IList<IUpdateEntry> entries, IDiagnosticsLogger<DbLoggerCategory.Update> updateLogger)
Parameters
entriesIList<IUpdateEntry>updateLoggerIDiagnosticsLogger<DbLoggerCategory.Update>
Returns
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
entriesIList<IUpdateEntry>updateLoggerIDiagnosticsLogger<DbLoggerCategory.Update>cancellationTokenCancellationToken
Returns
GetTable(IEntityType)
Retrieves the IKEFCoreTable associated to IEntityType in the instance of IKEFCoreCluster
public IKEFCoreTable GetTable(IEntityType entityType)
Parameters
entityTypeIEntityType
Returns
GetValueBuffer(IEntityType, object[])
Retrieve the ValueBuffer for a specified key
public ValueBuffer? GetValueBuffer(IEntityType entityType, object[] keyValues)
Parameters
entityTypeIEntityTypekeyValuesobject[]
Returns
GetValueBuffers(IEntityType)
Retrieve the ValueBuffer
public virtual IEnumerable<ValueBuffer> GetValueBuffers(IEntityType entityType)
Parameters
entityTypeIEntityType
Returns
GetValueBuffersByPrefix(IEntityType, object[])
Retrieve the ValueBuffer using prefix scan
public IEnumerable<ValueBuffer> GetValueBuffersByPrefix(IEntityType entityType, object[] prefixValues)
Parameters
entityTypeIEntityTypeprefixValuesobject[]
Returns
GetValueBuffersRange(IEntityType, object[], object[])
Retrieve the ValueBuffer in a range of keys
public IEnumerable<ValueBuffer> GetValueBuffersRange(IEntityType entityType, object[] rangeStart, object[] rangeEnd)
Parameters
entityTypeIEntityTyperangeStartobject[]rangeEndobject[]
Returns
GetValueBuffersReverse(IEntityType)
Retrieve the ValueBuffer in reverse order
public IEnumerable<ValueBuffer> GetValueBuffersReverse(IEntityType entityType)
Parameters
entityTypeIEntityType
Returns
GetValueBuffersReverseRange(IEntityType, object[], object[])
Retrieve the ValueBuffer in a range of keys
public IEnumerable<ValueBuffer> GetValueBuffersReverseRange(IEntityType entityType, object[] rangeStart, object[] rangeEnd)
Parameters
entityTypeIEntityTyperangeStartobject[]rangeEndobject[]
Returns
LatestOffsetForEntity(IEntityType)
Returns the latest offset for each partition associated to entityType
public IDictionary<int, long> LatestOffsetForEntity(IEntityType entityType)
Parameters
entityTypeIEntityTypeThe 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()