public WriteQueryResultProjectionProcessingPhaseBase(
            IPublisher publisher,
            int phase,
            string resultStream,
            ICoreProjectionForProcessingPhase coreProjection,
            PartitionStateCache stateCache,
            ICoreProjectionCheckpointManager checkpointManager,
            IEmittedEventWriter emittedEventWriter,
            IEmittedStreamsTracker emittedStreamsTracker)
        {
            if (resultStream == null) throw new ArgumentNullException("resultStream");
            if (coreProjection == null) throw new ArgumentNullException("coreProjection");
            if (stateCache == null) throw new ArgumentNullException("stateCache");
            if (checkpointManager == null) throw new ArgumentNullException("checkpointManager");
            if (emittedEventWriter == null) throw new ArgumentNullException("emittedEventWriter");
            if (emittedStreamsTracker == null) throw new ArgumentNullException("emittedStreamsTracker");
            if (string.IsNullOrEmpty(resultStream)) throw new ArgumentException("resultStream");

            _publisher = publisher;
            _phase = phase;
            _resultStream = resultStream;
            _coreProjection = coreProjection;
            _stateCache = stateCache;
            _checkpointManager = checkpointManager;
            _emittedEventWriter = emittedEventWriter;
            _emittedStreamsTracker = emittedStreamsTracker;
        }
 public WriteQueryEofProjectionProcessingPhase(
     int phase, string resultStream, ICoreProjectionForProcessingPhase coreProjection,
     PartitionStateCache stateCache, ICoreProjectionCheckpointManager checkpointManager,
     IEmittedEventWriter emittedEventWriter)
     : base(phase, resultStream, coreProjection, stateCache, checkpointManager, emittedEventWriter)
 {
 }
 public ProgressWorkItem(
     CoreProjection projection, ICoreProjectionCheckpointManager checkpointManager, float progress)
     : base(projection, null) 
 {
     _checkpointManager = checkpointManager;
     _progress = progress;
 }
 public ProgressWorkItem(ICoreProjectionCheckpointManager checkpointManager, IProgressResultWriter resultWriter, float progress)
     : base(null) 
 {
     _checkpointManager = checkpointManager;
     _resultWriter = resultWriter;
     _progress = progress;
 }
 // checkpoints are serialized based on string.empty token stream name
 public CheckpointSuggestedWorkItem(
     CoreProjection projection, ProjectionSubscriptionMessage.CheckpointSuggested message,
     ICoreProjectionCheckpointManager checkpointManager)
     : base(projection, "")
 {
     _message = message;
     _checkpointManager = checkpointManager;
 }
 public CheckpointSuggestedWorkItem(
     CoreProjection projection, EventReaderSubscriptionMessage.CheckpointSuggested message,
     ICoreProjectionCheckpointManager checkpointManager)
     : base(projection) 
 {
     _projection = projection;
     _message = message;
     _checkpointManager = checkpointManager;
 }
 public CheckpointSuggestedWorkItem(
     IProjectionPhaseCheckpointManager projectionPhase, EventReaderSubscriptionMessage.CheckpointSuggested message,
     ICoreProjectionCheckpointManager checkpointManager)
     : base() 
 {
     _projectionPhase = projectionPhase;
     _message = message;
     _checkpointManager = checkpointManager;
 }
 public PartitionCompletedWorkItem(
     IEventProcessingProjectionPhase projection, ICoreProjectionCheckpointManager checkpointManager,
     string partition, CheckpointTag checkpointTag)
     : base()
 {
     _projection = projection;
     _checkpointManager = checkpointManager;
     _partition = partition;
     _checkpointTag = checkpointTag;
 }
 protected abstract IProjectionProcessingPhase CreateFirstProcessingPhase(
     IPublisher publisher,
     IPublisher inputQueue,
     Guid projectionCorrelationId,
     PartitionStateCache partitionStateCache,
     Action updateStatistics,
     CoreProjection coreProjection,
     ReaderSubscriptionDispatcher subscriptionDispatcher,
     CheckpointTag zeroCheckpointTag,
     ICoreProjectionCheckpointManager checkpointManager,
     IReaderStrategy readerStrategy,
     IResultWriter resultWriter);
        protected override IProjectionProcessingPhase CreateFirstProcessingPhase(
            IPublisher publisher,
            IPublisher inputQueue,
            Guid projectionCorrelationId,
            PartitionStateCache partitionStateCache,
            Action updateStatistics,
            CoreProjection coreProjection,
            ReaderSubscriptionDispatcher subscriptionDispatcher,
            CheckpointTag zeroCheckpointTag,
            ICoreProjectionCheckpointManager checkpointManager,
            IReaderStrategy readerStrategy,
            IResultWriter resultWriter)
        {
            var statePartitionSelector = CreateStatePartitionSelector();

            var orderedPartitionProcessing = _sourceDefinition.ByStreams && _sourceDefinition.IsBiState;

            return new EventProcessingProjectionProcessingPhase(
                coreProjection,
                projectionCorrelationId,
                publisher,
                inputQueue,
                _projectionConfig,
                updateStatistics,
                _stateHandler,
                partitionStateCache,
                _sourceDefinition.DefinesStateTransform,
                _name,
                _logger,
                zeroCheckpointTag,
                checkpointManager,
                statePartitionSelector,
                subscriptionDispatcher,
                readerStrategy,
                resultWriter,
                _projectionConfig.CheckpointsEnabled,
                this.GetStopOnEof(),
                _sourceDefinition.IsBiState,
                orderedPartitionProcessing: orderedPartitionProcessing);
        }
 protected override IProjectionProcessingPhase CreateFirstProcessingPhase(
     IPublisher publisher,
     IPublisher inputQueue,
     Guid projectionCorrelationId,
     PartitionStateCache partitionStateCache,
     Action updateStatistics,
     CoreProjection coreProjection,
     ReaderSubscriptionDispatcher subscriptionDispatcher,
     CheckpointTag zeroCheckpointTag,
     ICoreProjectionCheckpointManager checkpointManager,
     IReaderStrategy readerStrategy,
     IResultWriter resultWriter)
 {
     return new ParallelQueryMasterProjectionProcessingPhase(
         coreProjection,
         projectionCorrelationId,
         publisher,
         inputQueue,
         _projectionConfig,
         updateStatistics,
         _stateHandler,
         partitionStateCache,
         _name,
         _logger,
         zeroCheckpointTag,
         checkpointManager,
         subscriptionDispatcher,
         readerStrategy,
         resultWriter,
         _projectionConfig.CheckpointsEnabled,
         this.GetStopOnEof(),
         _spoolProcessingResponseDispatcher);
 }
 public FakeProjectionProcessingPhase(int phase, specification_with_multi_phase_core_projection specification,
     ICoreProjectionCheckpointManager checkpointManager, IReaderStrategy readerStrategy)
 {
     _phase = phase;
     _specification = specification;
     _checkpointManager = checkpointManager;
     _readerStrategy = readerStrategy;
 }