public RebuildProjectionEngine( EventUnwinder eventUnwinder, IConcurrentCheckpointTracker checkpointTracker, IProjection[] projections, IRebuildContext rebuildContext, ProjectionEngineConfig config, ProjectionEventInspector projectionInspector, ILoggerThreadContextManager loggerThreadContextManager) { _eventUnwinder = eventUnwinder; _checkpointTracker = checkpointTracker; _rebuildContext = rebuildContext; _config = config; _projectionInspector = projectionInspector; if (_config.Slots[0] != "*") { projections = projections .Where(x => _config.Slots.Any(y => y == x.Info.SlotName)) .ToArray(); } _allProjections = projections; _projectionsBySlot = projections .GroupBy(x => x.Info.SlotName) .ToDictionary(x => x.Key, x => x.OrderByDescending(p => p.Priority).ToArray()); _metrics = new ProjectionMetrics(_allProjections); _loggerThreadContextManager = loggerThreadContextManager; HealthChecks.RegisterHealthCheck("RebuildProjectionEngine", (Func <HealthCheckResult>)HealthCheck); }
public RebuildProjectionEngine( EventUnwinder eventUnwinder, IConcurrentCheckpointTracker checkpointTracker, IProjection[] projections, IRebuildContext rebuildContext, ProjectionEngineConfig config, ProjectionEventInspector projectionInspector) { _eventUnwinder = eventUnwinder; _checkpointTracker = checkpointTracker; _rebuildContext = rebuildContext; _config = config; _projectionInspector = projectionInspector; if (_config.Slots[0] != "*") { projections = projections .Where(x => _config.Slots.Any(y => y == x.GetSlotName())) .ToArray(); } _allProjections = projections; _projectionsBySlot = projections .GroupBy(x => x.GetSlotName()) .ToDictionary(x => x.Key, x => x.OrderByDescending(p => p.Priority).ToArray()); _metrics = new ProjectionMetrics(_allProjections); }
public ConcurrentProjectionsEngine( IConcurrentCheckpointTracker checkpointTracker, IProjection[] projections, IPollingClient client, IHousekeeper housekeeper, IRebuildContext rebuildContext, INotifyCommitHandled notifyCommitHandled, ProjectionEngineConfig config) { _checkpointTracker = checkpointTracker; _client = client; _housekeeper = housekeeper; _rebuildContext = rebuildContext; _notifyCommitHandled = notifyCommitHandled; _config = config; if (_config.Slots[0] != "*") { projections = projections .Where(x => _config.Slots.Any(y => y == x.GetSlotName())) .ToArray(); } _allProjections = projections; _projectionsBySlot = projections .GroupBy(x => x.GetSlotName()) .ToDictionary(x => x.Key, x => x.OrderByDescending(p => p.Priority).ToArray()); _metrics = new ProjectionMetrics(_allProjections); }
public ProjectionEngine( Func <IPersistStreams, CommitPollingClient> pollingClientFactory, IConcurrentCheckpointTracker checkpointTracker, IProjection[] projections, IHousekeeper housekeeper, IRebuildContext rebuildContext, INotifyCommitHandled notifyCommitHandled, ProjectionEngineConfig config) { _pollingClientFactory = pollingClientFactory; _checkpointTracker = checkpointTracker; _housekeeper = housekeeper; _rebuildContext = rebuildContext; _notifyCommitHandled = notifyCommitHandled; _config = config; if (_config.Slots[0] != "*") { projections = projections .Where(x => _config.Slots.Any(y => y == x.GetSlotName())) .ToArray(); } _allProjections = projections; _projectionsBySlot = projections .GroupBy(x => x.GetSlotName()) .ToDictionary(x => x.Key, x => x.OrderByDescending(p => p.Priority).ToArray()); _metrics = new ProjectionMetrics(_allProjections); _clients = new List <CommitPollingClient>(); _bucketToClient = new Dictionary <BucketInfo, CommitPollingClient>(); }
public virtual async Task StopRebuildAsync() { foreach (var observer in _observers) { await observer.RebuildEndedAsync().ConfigureAwait(false); } this.RebuildContext = null; }
public virtual async Task StartRebuildAsync(IRebuildContext context) { this.RebuildContext = context; foreach (var observer in _observers) { await observer.RebuildStartedAsync().ConfigureAwait(false); } }
public virtual void StopRebuild() { foreach (var observer in _observers) { observer.RebuildEnded(); } this.RebuildContext = null; }
public virtual void StartRebuild(IRebuildContext context) { this.RebuildContext = context; foreach (var observer in _observers) { observer.RebuildStarted(); } }
public ProjectionEngine( ICommitPollingClientFactory pollingClientFactory, IConcurrentCheckpointTracker checkpointTracker, IProjection[] projections, IHousekeeper housekeeper, IRebuildContext rebuildContext, INotifyCommitHandled notifyCommitHandled, ProjectionEngineConfig config) { Logger = NullLogger.Instance; _engineFatalErrors = new ConcurrentBag <string>(); _pollingClientFactory = pollingClientFactory; _checkpointTracker = checkpointTracker; _housekeeper = housekeeper; _rebuildContext = rebuildContext; _notifyCommitHandled = notifyCommitHandled; _config = config; if (_config.Slots[0] != "*") { projections = projections .Where(x => _config.Slots.Any(y => y == x.GetSlotName())) .ToArray(); } _allProjections = projections; _projectionsBySlot = projections .GroupBy(x => x.GetSlotName()) .ToDictionary(x => x.Key, x => x.OrderByDescending(p => p.Priority).ToArray()); _metrics = new ProjectionMetrics(_allProjections); _bucketToClient = new Dictionary <BucketInfo, ICommitPollingClient>(); RegisterHealthCheck(); }
public MongoStorageFactory(IMongoDatabase db, IRebuildContext rebuildContext) { _db = db; _rebuildContext = rebuildContext; }