public void DeleteProjectionStreams()
        {
            var sourceDefinition       = PersistedProjectionState.SourceDefinition ?? new ProjectionSourceDefinition();
            var projectionNamesBuilder = new ProjectionNamesBuilder(_name, sourceDefinition);

            if (PersistedProjectionState.DeleteCheckpointStream)
            {
                DeleteStream(projectionNamesBuilder.MakeCheckpointStreamName(), DeleteIfConditionsAreMet);
            }
            if (PersistedProjectionState.DeleteEmittedStreams)
            {
                if (_emittedStreamsDeleter == null)
                {
                    _emittedStreamsDeleter = new EmittedStreamsDeleter(
                        _ioDispatcher,
                        projectionNamesBuilder.GetEmittedStreamsName(),
                        projectionNamesBuilder.GetEmittedStreamsCheckpointName());
                }
                _emittedStreamsDeleter.DeleteEmittedStreams(DeleteIfConditionsAreMet);
            }
            if (!PersistedProjectionState.DeleteCheckpointStream &&
                !PersistedProjectionState.DeleteEmittedStreams)
            {
                DeleteIfConditionsAreMet();
            }
        }
 protected override void Given()
 {
     _ioDispatcher = new IODispatcher(_node.Node.MainQueue, new PublishEnvelope(_node.Node.MainQueue));
     _node.Node.MainBus.Subscribe(_ioDispatcher.BackwardReader);
     _node.Node.MainBus.Subscribe(_ioDispatcher.ForwardReader);
     _node.Node.MainBus.Subscribe(_ioDispatcher.Writer);
     _node.Node.MainBus.Subscribe(_ioDispatcher.StreamDeleter);
     _node.Node.MainBus.Subscribe(_ioDispatcher.Awaker);
     _node.Node.MainBus.Subscribe(_ioDispatcher);
     _projectionNamesBuilder = ProjectionNamesBuilder.CreateForTest(_projectionName);
     _emittedStreamsTracker  = new EmittedStreamsTracker(_ioDispatcher, new ProjectionConfig(null, 1000, 1000 * 1000, 100, 500, true, true, false, false, false, _trackEmittedStreams), _projectionNamesBuilder);
     _emittedStreamsDeleter  = new EmittedStreamsDeleter(_ioDispatcher, _projectionNamesBuilder.GetEmittedStreamsName(), _projectionNamesBuilder.GetEmittedStreamsCheckpointName());
 }
 protected override void Given()
 {
     _ioDispatcher = new IODispatcher(_node.Node.MainQueue, new PublishEnvelope(_node.Node.MainQueue));
     _node.Node.MainBus.Subscribe(_ioDispatcher.BackwardReader);
     _node.Node.MainBus.Subscribe(_ioDispatcher.ForwardReader);
     _node.Node.MainBus.Subscribe(_ioDispatcher.Writer);
     _node.Node.MainBus.Subscribe(_ioDispatcher.StreamDeleter);
     _node.Node.MainBus.Subscribe(_ioDispatcher.Awaker);
     _node.Node.MainBus.Subscribe(_ioDispatcher);
     _projectionNamesBuilder = ProjectionNamesBuilder.CreateForTest(_projectionName);
     _emittedStreamsTracker = new EmittedStreamsTracker(_ioDispatcher, new ProjectionConfig(null, 1000, 1000 * 1000, 100, 500, true, true, false, false, false, _trackEmittedStreams), _projectionNamesBuilder);
     _emittedStreamsDeleter = new EmittedStreamsDeleter(_ioDispatcher, _projectionNamesBuilder.GetEmittedStreamsName(), _projectionNamesBuilder.GetEmittedStreamsCheckpointName());
 }
Пример #4
0
 protected override Task Given()
 {
     _ioDispatcher = new IODispatcher(_node.Node.MainQueue, new PublishEnvelope(_node.Node.MainQueue), true);
     _node.Node.MainBus.Subscribe(_ioDispatcher.BackwardReader);
     _node.Node.MainBus.Subscribe(_ioDispatcher.ForwardReader);
     _node.Node.MainBus.Subscribe(_ioDispatcher.Writer);
     _node.Node.MainBus.Subscribe(_ioDispatcher.StreamDeleter);
     _node.Node.MainBus.Subscribe(_ioDispatcher.Awaker);
     _node.Node.MainBus.Subscribe <IODispatcherDelayedMessage>(_ioDispatcher);
     _node.Node.MainBus.Subscribe <ClientMessage.NotHandled>(_ioDispatcher);
     _projectionNamesBuilder = ProjectionNamesBuilder.CreateForTest(_projectionName);
     _emittedStreamsTracker  = new EmittedStreamsTracker(_ioDispatcher,
                                                         new ProjectionConfig(null, 1000, 1000 * 1000, 100, 500, true, true, false, false,
                                                                              _trackEmittedStreams, 10000, 1), _projectionNamesBuilder);
     _emittedStreamsDeleter = new EmittedStreamsDeleter(_ioDispatcher,
                                                        _projectionNamesBuilder.GetEmittedStreamsName(),
                                                        _projectionNamesBuilder.GetEmittedStreamsCheckpointName());
     return(Task.CompletedTask);
 }
Пример #5
0
 public void DeleteProjectionStreams()
 {
     var sourceDefinition = PersistedProjectionState.SourceDefinition ?? new ProjectionSourceDefinition();
     var projectionNamesBuilder = new ProjectionNamesBuilder(_name, sourceDefinition);
     if (PersistedProjectionState.DeleteCheckpointStream)
     {
         DeleteStream(projectionNamesBuilder.MakeCheckpointStreamName(), DeleteIfConditionsAreMet);
     }
     if (PersistedProjectionState.DeleteEmittedStreams)
     {
         if (_emittedStreamsDeleter == null)
         {
             _emittedStreamsDeleter = new EmittedStreamsDeleter(
                 _ioDispatcher, 
                 projectionNamesBuilder.GetEmittedStreamsName(), 
                 projectionNamesBuilder.GetEmittedStreamsCheckpointName());
         }
         _emittedStreamsDeleter.DeleteEmittedStreams(DeleteIfConditionsAreMet);
     }
     if(!PersistedProjectionState.DeleteCheckpointStream &&
        !PersistedProjectionState.DeleteEmittedStreams)
     {
         DeleteIfConditionsAreMet();
     }
 }