Beispiel #1
0
 private void InitializeProjectionFromCheckpoint(string state, CheckpointTag checkpointTag)
 {
     EnsureState(State.Initial | State.LoadStateRequsted);
     //TODO: initialize projection state here (test it)
     //TODO: write test to ensure projection state is correctly loaded from a checkpoint and posted back when enough empty records processed
     _partitionStateCache.CacheAndLockPartitionState("", new PartitionStateCache.State(state, checkpointTag), null);
     _checkpointManager.Start(checkpointTag);
     try
     {
         SetHandlerState("");
         GoToState(State.StateLoadedSubscribed);
     }
     catch (Exception ex)
     {
         LoadProjectionStateFaulted(state, ex);
         return;
     }
     _processingQueue.InitializeQueue(_checkpointStrategy.PositionTagger.MakeZeroCheckpointTag());
     _expectedSubscriptionMessageSequenceNumber = 0;
     _subscribed = true;
     _publisher.Publish(
         new ProjectionSubscriptionManagement.Subscribe(
             _projectionCorrelationId, this, checkpointTag, _checkpointStrategy,
             _projectionConfig.CheckpointUnhandledBytesThreshold));
     _publisher.Publish(new CoreProjectionManagementMessage.Started(_projectionCorrelationId));
 }
Beispiel #2
0
        private void BeginPhase(IProjectionProcessingPhase processingPhase, CheckpointTag startFrom)
        {
            _projectionProcessingPhase = processingPhase;
            _checkpointManager         = processingPhase.CheckpointManager;

            _projectionProcessingPhase.InitializeFromCheckpoint(startFrom);
            _checkpointManager.Start(startFrom);
        }
Beispiel #3
0
        private void BeginPhase(IProjectionProcessingPhase processingPhase, CheckpointTag startFrom, PartitionState rootPartitionState)
        {
            _projectionProcessingPhase = processingPhase;
            _projectionProcessingPhase.SetProjectionState(PhaseState.Starting);
            _checkpointManager = processingPhase.CheckpointManager;

            _projectionProcessingPhase.InitializeFromCheckpoint(startFrom);
            _checkpointManager.Start(startFrom, rootPartitionState);
        }