Interface IKNetCompactedReplicator<K, V, TJVMK, TJVMV>
- Namespace
- MASES.KNet.Replicator
- Assembly
- MASES.KNet.dll
Public interface for KNetCompactedReplicator<K, V, TJVMK, TJVMV>
public interface IKNetCompactedReplicator<K, V, TJVMK, TJVMV> : IDictionary<K, V>, ICollection<KeyValuePair<K, V>>, IEnumerable<KeyValuePair<K, V>>, IEnumerable, IDisposable where V : class
Type Parameters
K
The type of keys in the dictionary
V
The type of values in the dictionary. Must be a nullable type
TJVMK
The JVM type of
K
TJVMV
The JVM type of
V
- Inherited Members
Properties
AccessRights
Get or set AccessRightsType
AccessRightsType AccessRights { get; }
Property Value
BootstrapServers
Get or set bootstrap servers
string BootstrapServers { get; }
Property Value
ConsumePollTimeout
Get or set the poll timeout to be used for ConsumeAsync(long)
long ConsumePollTimeout { get; }
Property Value
ConsumerConfig
Get or set ConsumerConfigBuilder to use in KNetCompactedReplicator<K, V, TJVMK, TJVMV>
ConsumerConfigBuilder ConsumerConfig { get; }
Property Value
ConsumerInstances
Get or set the number of KNetConsumer<K, V, TJVMK, TJVMV> instances to be used, null to allocate KNetConsumer<K, V, TJVMK, TJVMV> based on Partitions
int? ConsumerInstances { get; }
Property Value
- int?
CurrentConsumersSyncState
Reports a snapshot of current sync state the value (true means it is in sync) associated to each consumer (the key).
IReadOnlyDictionary<int, bool> CurrentConsumersSyncState { get; }
Property Value
Remarks
It is only a snapshot when the property is read and cannot reflect real conditions
CurrentPartitionLags
Reports a snapshot of current lags (the value) associated to each partition (the key).
IReadOnlyDictionary<int, long> CurrentPartitionLags { get; }
Property Value
Remarks
It is only a snapshot when the property is read and cannot reflect real conditions
GroupId
Get or set the group id, if not set a value is generated
string GroupId { get; }
Property Value
IsAssigned
true if the instance was started
bool IsAssigned { get; }
Property Value
IsStarted
true if the instance was started
bool IsStarted { get; }
Property Value
KeySerDes
Get or set an instance of ISerDes<T, TJVMT> to use in KNetCompactedReplicator<K, V, TJVMK, TJVMV>, by default it creates a default one based on K
ISerDes<K, TJVMK> KeySerDes { get; }
Property Value
- ISerDes<K, TJVMK>
KeySerDesSelector
Type KeySerDesSelector { get; }
Property Value
OnDelayedStore
It is called to request if the [K
, V
] can be stored in the IKNetCompactedReplicator<K, V, TJVMK, TJVMV> instance.
Func<IKNetCompactedReplicator<K, V, TJVMK, TJVMV>, bool, KeyValuePair<K, V>, bool> OnDelayedStore { get; }
Property Value
- Func<IKNetCompactedReplicator<K, V, TJVMK, TJVMV>, bool, KeyValuePair<K, V>, bool>
Remarks
The second parameter reports the current value that depends on values set to UpdateMode and if it contains the Delayed
Partitions
Get or set partitions to use when topic is created for the first time, otherwise reports the partiions of the topic
int Partitions { get; }
Property Value
ProducerConfig
Get or set ProducerConfigBuilder to use in KNetCompactedReplicator<K, V, TJVMK, TJVMV>
ProducerConfigBuilder ProducerConfig { get; }
Property Value
ReplicationFactor
Get or set replication factor to use when topic is created for the first time, otherwise reports the replication factor of the topic
short ReplicationFactor { get; }
Property Value
StateName
Get or set topic name
string StateName { get; }
Property Value
TopicConfig
Get or set TopicConfigBuilder to use when topic is created for the first time
TopicConfigBuilder TopicConfig { get; }
Property Value
UpdateMode
Get or set UpdateModeTypes
UpdateModeTypes UpdateMode { get; }
Property Value
ValueSerDes
Get or set an instance of ISerDes<T, TJVMT> to use in KNetCompactedReplicator<K, V, TJVMK, TJVMV>, by default it creates a default one based on V
ISerDes<V, TJVMV> ValueSerDes { get; }
Property Value
- ISerDes<V, TJVMV>
ValueSerDesSelector
The Type used to create an instance of ValueSerDes"/>
Type ValueSerDesSelector { get; }
Property Value
Methods
ConsumerMetrics<TMetric>()
Reports the KNetConsumer<K, V, TJVMK, TJVMV> metrics. Metrics()
IReadOnlyDictionary<int, Map<MetricName, TMetric>> ConsumerMetrics<TMetric>() where TMetric : Metric
Returns
- IReadOnlyDictionary<int, Map<MetricName, TMetric>>
An IReadOnlyDictionary<TKey, TValue> where the key is the current allocated KNetConsumer<K, V, TJVMK, TJVMV> and value is a Map of MetricName and
TMetric
Type Parameters
TMetric
Extends Metric
Flush()
Waits until all outstanding produce requests and delivery report callbacks are completed
void Flush()
ProducerMetrics<TMetric>()
Reports the KNetProducer<K, V, TJVMK, TJVMV> metrics. Metrics()
Map<MetricName, TMetric> ProducerMetrics<TMetric>() where TMetric : Metric
Returns
- Map<MetricName, TMetric>
A Map of MetricName and
TMetric
Type Parameters
TMetric
Extends Metric
Start()
Start this KNetCompactedReplicator<K, V, TJVMK, TJVMV>: create the StateName topic if not available, allocates Producer and Consumer, sets serializer/deserializer
void Start()
Exceptions
- InvalidOperationException
Some errors occurred
StartAndWait(int)
Start this KNetCompactedReplicator<K, V, TJVMK, TJVMV>: create the StateName topic if not available, allocates Producer and Consumers, sets serializer/deserializer Then waits its synchronization with StateName topic which stores dictionary data
bool StartAndWait(int timeout = -1)
Parameters
Returns
Exceptions
- InvalidOperationException
Some errors occurred or the provided AccessRights do not include the Read flag
SyncWait(int)
Waits that KNetCompactedReplicator<K, V, TJVMK, TJVMV> is synchronized to the StateName topic which stores dictionary data
bool SyncWait(int timeout = -1)
Parameters
Returns
Exceptions
- InvalidOperationException
The provided AccessRights do not include the Read flag
WaitForStateAssignment(int)
Waits for all paritions assignment of the StateName topic which stores dictionary data
bool WaitForStateAssignment(int timeout = -1)
Parameters
Returns
Exceptions
- InvalidOperationException
The provided AccessRights do not include the Read flag
Events
OnLocalAdd
Called when a [K
, V
] is added on this IKNetCompactedReplicator<K, V, TJVMK, TJVMV>
event Action<IKNetCompactedReplicator<K, V, TJVMK, TJVMV>, KeyValuePair<K, V>> OnLocalAdd
Event Type
- Action<IKNetCompactedReplicator<K, V, TJVMK, TJVMV>, KeyValuePair<K, V>>
OnLocalRemove
Called when a [K
, V
] is removed from this IKNetCompactedReplicator<K, V, TJVMK, TJVMV>
event Action<IKNetCompactedReplicator<K, V, TJVMK, TJVMV>, KeyValuePair<K, V>> OnLocalRemove
Event Type
- Action<IKNetCompactedReplicator<K, V, TJVMK, TJVMV>, KeyValuePair<K, V>>
OnLocalUpdate
Called when a [K
, V
] is updated on this IKNetCompactedReplicator<K, V, TJVMK, TJVMV>
event Action<IKNetCompactedReplicator<K, V, TJVMK, TJVMV>, KeyValuePair<K, V>> OnLocalUpdate
Event Type
- Action<IKNetCompactedReplicator<K, V, TJVMK, TJVMV>, KeyValuePair<K, V>>
OnRemoteAdd
Called when a [K
, V
] is added by consuming data from the others IKNetCompactedReplicator<K, V, TJVMK, TJVMV>
event Action<IKNetCompactedReplicator<K, V, TJVMK, TJVMV>, KeyValuePair<K, V>> OnRemoteAdd
Event Type
- Action<IKNetCompactedReplicator<K, V, TJVMK, TJVMV>, KeyValuePair<K, V>>
OnRemoteRemove
Called when a [K
, V
] is removed by consuming data from the others IKNetCompactedReplicator<K, V, TJVMK, TJVMV>
event Action<IKNetCompactedReplicator<K, V, TJVMK, TJVMV>, KeyValuePair<K, V>> OnRemoteRemove
Event Type
- Action<IKNetCompactedReplicator<K, V, TJVMK, TJVMV>, KeyValuePair<K, V>>
OnRemoteUpdate
Called when a [K
, V
] is updated by consuming data from the others IKNetCompactedReplicator<K, V, TJVMK, TJVMV>
event Action<IKNetCompactedReplicator<K, V, TJVMK, TJVMV>, KeyValuePair<K, V>> OnRemoteUpdate
Event Type
- Action<IKNetCompactedReplicator<K, V, TJVMK, TJVMV>, KeyValuePair<K, V>>