Exemplo n.º 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));
 }
Exemplo n.º 2
0
        public void InitializeFromCheckpoint(CheckpointTag checkpointTag)
        {
            _wasReaderAssigned = false;
            // this can be old checkpoint
            var adjustedCheckpointTag = _readerStrategy.PositionTagger.AdjustTag(checkpointTag);

            _processingQueue.InitializeQueue(adjustedCheckpointTag);
            NewCheckpointStarted(adjustedCheckpointTag);
        }