/// <summary> /// Initializes a new instance of the <see cref="StateProviderMetadataManager"/> class. /// </summary> public StateProviderMetadataManager(ILoggingReplicator loggingReplicator, string traceType) { this.TraceType = traceType; this.keylocks = new ConcurrentDictionary <Uri, StateManagerLockContext>(AbsoluteUriEqualityComparer.Comparer); this.inMemoryState = new ConcurrentDictionary <Uri, Metadata>(AbsoluteUriEqualityComparer.Comparer); this.DeletedStateProviders = new ConcurrentDictionary <long, Metadata>(); this.LoggingReplicator = loggingReplicator; this.CopyOrCheckpointMetadataSnapshot = new Dictionary <long, Metadata>(); this.CopyOrCheckpointLock = new ReaderWriterLockSlim(); this.InflightTransactions = new ConcurrentDictionary <long, HashSet <Uri> >(); this.stateProviderIdMap = new ConcurrentDictionary <long, Metadata>(); this.ParentToChildernStateProviderMap = new ConcurrentDictionary <long, IList <Metadata> >(); }
/// <summary> /// Initializes a new instance of the <see cref="TransactionalReplicator"/> class for unit tests /// </summary> /// <param name="loggingReplicator">logging replicator</param> /// <param name="onDataLossCallback">On data loss callback. Called when a data loss is suspected.</param> internal TransactionalReplicator(ILoggingReplicator loggingReplicator, Func <CancellationToken, Task <bool> > onDataLossCallback) { this.metricManager = new MetricManager(); this.stateManager = new DynamicStateManager(this, loggingReplicator); this.onDataLossCallback = onDataLossCallback; }