Inheritance: EventStore.Projections.Core.Services.Processing.WriteQueryResultProjectionProcessingPhaseBase
        protected override IProjectionProcessingPhase[] CreateProjectionProcessingPhases(
            IPublisher publisher, Guid projectionCorrelationId, ProjectionNamesBuilder namingBuilder,
            PartitionStateCache partitionStateCache, CoreProjection coreProjection, IODispatcher ioDispatcher,
            IProjectionProcessingPhase firstPhase)
        {

            var coreProjectionCheckpointWriter =
                new CoreProjectionCheckpointWriter(
                    namingBuilder.MakeCheckpointStreamName(), ioDispatcher, _projectionVersion, _name);
            var checkpointManager2 = new DefaultCheckpointManager(
                publisher, projectionCorrelationId, _projectionVersion, _projectionConfig.RunAs, ioDispatcher,
                _projectionConfig, _name, new PhasePositionTagger(1), namingBuilder, GetUseCheckpoints(), false,
                _sourceDefinition.DefinesFold, coreProjectionCheckpointWriter);

            IProjectionProcessingPhase writeResultsPhase;
            if (GetProducesRunningResults()
                || !string.IsNullOrEmpty(_sourceDefinition.CatalogStream) && _sourceDefinition.ByStreams)
                writeResultsPhase = new WriteQueryEofProjectionProcessingPhase(
                    1, namingBuilder.GetResultStreamName(), coreProjection, partitionStateCache, checkpointManager2,
                    checkpointManager2);
            else
                writeResultsPhase = new WriteQueryResultProjectionProcessingPhase(
                    1, namingBuilder.GetResultStreamName(), coreProjection, partitionStateCache, checkpointManager2,
                    checkpointManager2);

            return new[] {firstPhase, writeResultsPhase};
        }
        protected override IProjectionProcessingPhase[] CreateProjectionProcessingPhases(
            IPublisher publisher, Guid projectionCorrelationId, ProjectionNamesBuilder namingBuilder,
            PartitionStateCache partitionStateCache, CoreProjection coreProjection, IODispatcher ioDispatcher,
            IProjectionProcessingPhase firstPhase)
        {
            var coreProjectionCheckpointWriter =
                new CoreProjectionCheckpointWriter(
                    namingBuilder.MakeCheckpointStreamName(), ioDispatcher, _projectionVersion, _name);
            var checkpointManager2 = new DefaultCheckpointManager(
                publisher, projectionCorrelationId, _projectionVersion, _projectionConfig.RunAs, ioDispatcher,
                _projectionConfig, _name, new PhasePositionTagger(1), namingBuilder, GetUseCheckpoints(), false,
                _sourceDefinition.DefinesFold, coreProjectionCheckpointWriter);

            IProjectionProcessingPhase writeResultsPhase;

            if (GetProducesRunningResults() ||
                !string.IsNullOrEmpty(_sourceDefinition.CatalogStream) && _sourceDefinition.ByStreams)
            {
                writeResultsPhase = new WriteQueryEofProjectionProcessingPhase(
                    1, namingBuilder.GetResultStreamName(), coreProjection, partitionStateCache, checkpointManager2,
                    checkpointManager2);
            }
            else
            {
                writeResultsPhase = new WriteQueryResultProjectionProcessingPhase(
                    1, namingBuilder.GetResultStreamName(), coreProjection, partitionStateCache, checkpointManager2,
                    checkpointManager2);
            }

            return(new[] { firstPhase, writeResultsPhase });
        }
Esempio n. 3
0
 public void it_can_be_created()
 {
     var coreProjection = new FakeCoreProjection();
     var stateCache = new PartitionStateCache();
     var bus = new InMemoryBus("test");
     var fakeCheckpointManager = new specification_with_multi_phase_core_projection.FakeCheckpointManager(bus, Guid.NewGuid());
     var it = new WriteQueryResultProjectionProcessingPhase(
         1, "result-stream", coreProjection, stateCache,
         fakeCheckpointManager, fakeCheckpointManager);
 }
Esempio n. 4
0
 public void SetUp()
 {
     _stateCache = GivenStateCache();
     _publisher = new InMemoryBus("test");
     _coreProjection = new FakeCoreProjection();
     _checkpointManager = new specification_with_multi_phase_core_projection.FakeCheckpointManager(
         _publisher, Guid.NewGuid());
     _resultStreamName = "result-stream";
     _phase = new WriteQueryResultProjectionProcessingPhase(
         1, _resultStreamName, _coreProjection, _stateCache, _checkpointManager, _checkpointManager);
     When();
 }
Esempio n. 5
0
        protected override IProjectionProcessingPhase[] CreateProjectionProcessingPhases(
            IPublisher publisher, IPublisher inputQueue, Guid projectionCorrelationId,
            ProjectionNamesBuilder namingBuilder,
            PartitionStateCache partitionStateCache, CoreProjection coreProjection, IODispatcher ioDispatcher,
            IProjectionProcessingPhase firstPhase)
        {
            var coreProjectionCheckpointWriter =
                new CoreProjectionCheckpointWriter(
                    namingBuilder.MakeCheckpointStreamName(), ioDispatcher, _projectionVersion, _name);
            var checkpointManager2 = new DefaultCheckpointManager(
                publisher, projectionCorrelationId, _projectionVersion, SystemAccount.Principal, ioDispatcher,
                _projectionConfig, _name, new PhasePositionTagger(1), namingBuilder, GetUseCheckpoints(), false,
                _sourceDefinition.DefinesFold, coreProjectionCheckpointWriter);

            IProjectionProcessingPhase writeResultsPhase;

            if (GetProducesRunningResults())
            {
                writeResultsPhase = new WriteQueryEofProjectionProcessingPhase(
                    publisher,
                    1,
                    namingBuilder.GetResultStreamName(),
                    coreProjection,
                    partitionStateCache,
                    checkpointManager2,
                    checkpointManager2,
                    firstPhase.EmittedStreamsTracker);
            }
            else
            {
                writeResultsPhase = new WriteQueryResultProjectionProcessingPhase(
                    publisher,
                    1,
                    namingBuilder.GetResultStreamName(),
                    coreProjection,
                    partitionStateCache,
                    checkpointManager2,
                    checkpointManager2,
                    firstPhase.EmittedStreamsTracker);
            }

            return(new[] { firstPhase, writeResultsPhase });
        }
Esempio n. 6
0
 public void TearDown()
 {
     _phase = null;
 }