当前位置: 首页>>代码示例>>C#>>正文


C# CheckpointTag类代码示例

本文整理汇总了C#中CheckpointTag的典型用法代码示例。如果您正苦于以下问题:C# CheckpointTag类的具体用法?C# CheckpointTag怎么用?C# CheckpointTag使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


CheckpointTag类属于命名空间,在下文中一共展示了CheckpointTag类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: WriteEofResult

 public void WriteEofResult(
     Guid subscriptionId, string partition, string resultBody, CheckpointTag causedBy, Guid causedByGuid,
     string correlationId)
 {
     if (resultBody != null)
         WriteResult(partition, resultBody, causedBy, causedByGuid, correlationId);
 }
开发者ID:thinkbeforecoding,项目名称:EventStore,代码行数:7,代码来源:ResultWriter.cs

示例2: CoreProjectionCheckpointManager

        protected CoreProjectionCheckpointManager(
            IPublisher publisher, Guid projectionCorrelationId, ProjectionConfig projectionConfig, string name,
            PositionTagger positionTagger, ProjectionNamesBuilder namingBuilder, bool usePersistentCheckpoints,
            bool producesRunningResults)
        {
            if (publisher == null) throw new ArgumentNullException("publisher");
            if (projectionConfig == null) throw new ArgumentNullException("projectionConfig");
            if (name == null) throw new ArgumentNullException("name");
            if (positionTagger == null) throw new ArgumentNullException("positionTagger");
            if (namingBuilder == null) throw new ArgumentNullException("namingBuilder");
            if (name == "") throw new ArgumentException("name");

            _lastProcessedEventPosition = new PositionTracker(positionTagger);
            _zeroTag = positionTagger.MakeZeroCheckpointTag();

            _publisher = publisher;
            _projectionCorrelationId = projectionCorrelationId;
            _projectionConfig = projectionConfig;
            _logger = LogManager.GetLoggerFor<CoreProjectionCheckpointManager>();
            _namingBuilder = namingBuilder;
            _usePersistentCheckpoints = usePersistentCheckpoints;
            _producesRunningResults = producesRunningResults;
            _requestedCheckpointState = new PartitionState("", null, _zeroTag);
            _currentProjectionState = new PartitionState("", null, _zeroTag);
        }
开发者ID:thinkbeforecoding,项目名称:EventStore,代码行数:25,代码来源:CoreProjectionCheckpointManager.cs

示例3: DataReportBase

 protected DataReportBase(Guid correlationId, Guid projectionId, string partition, CheckpointTag position)
     : base(projectionId)
 {
     _correlationId = correlationId;
     _partition = partition;
     _position = position;
 }
开发者ID:danieldeb,项目名称:EventStore,代码行数:7,代码来源:CoreProjectionStatusMessage.cs

示例4: EmittedLinkTo

 public EmittedLinkTo(
     string streamId, Guid eventId,
     string targetStreamId, CheckpointTag causedByTag, CheckpointTag expectedTag, Action<int> onCommitted = null)
     : base(streamId, eventId, "$>", causedByTag, expectedTag, onCommitted)
 {
     _targetStreamId = targetStreamId;
 }
开发者ID:czcz1024,项目名称:EventStore,代码行数:7,代码来源:EmittedLinkTo.cs

示例5: ProcessEvent

        public bool ProcessEvent(
            string partition, CheckpointTag eventPosition, string category, ResolvedEvent data, out string newState,
            out string newSharedState, out EmittedEventEnvelope[] emittedEvents)
        {
            newSharedState = null;
            if (!data.EventStreamId.StartsWith(UserStreamPrefix))
                throw new InvalidOperationException(
                    string.Format(
                        "Invalid stream name: '{0}' The IndexUsersProjectionHandler cannot handle events from other streams than named after the '$user-' pattern",
                        data.EventStreamId));

            var loginName = data.EventStreamId.Substring(UserStreamPrefix.Length);

            var userData = data.Data.ParseJson<UserData>();
            if (userData.LoginName != loginName)
                throw new InvalidOperationException(
                    string.Format(
                        "Invalid $UserCreated event found.  '{0}' login name expected, but '{1}' found", loginName,
                        userData.LoginName));

            emittedEvents = new[]
            {
                new EmittedEventEnvelope(
                    new EmittedDataEvent(
                        UsersStream, Guid.NewGuid(), UserEventType, false, loginName, null, eventPosition, null))
            };
            newState = "";
            return true;
        }
开发者ID:jjoergensen,项目名称:EventStore,代码行数:29,代码来源:IndexUsersProjectionHandler.cs

示例6: ProcessEvent

        public bool ProcessEvent(
            string partition, CheckpointTag eventPosition, string category1, ResolvedEvent data,
            out string newState, out EmittedEventEnvelope[] emittedEvents)
        {
            emittedEvents = null;
            newState = null;
            if (data.PositionStreamId.StartsWith("$"))
                return false;
            var lastSlashPos = data.PositionStreamId.LastIndexOf(_separator);
            if (lastSlashPos < 0)
                return true; // handled but not interesting to us

            var category = data.PositionStreamId.Substring(0, lastSlashPos);

            string linkTarget;
            if (data.EventType == SystemEventTypes.LinkTo) 
                linkTarget = data.Data;
            else 
                linkTarget = data.EventSequenceNumber + "@" + data.EventStreamId;

            emittedEvents = new[]
            {
                new EmittedEventEnvelope(
                    new EmittedLinkToWithRecategorization(
                        _categoryStreamPrefix + category, Guid.NewGuid(), linkTarget, eventPosition, expectedTag: null,
                        originalStreamId: data.PositionStreamId))
            };

            return true;
        }
开发者ID:nchistyakov,项目名称:EventStore-1,代码行数:30,代码来源:CategorizeEventsByStreamPath.cs

示例7: Initialize

 public override void Initialize()
 {
     base.Initialize();
     _lastOrderCheckpointTag = null;
     if (_orderStream != null) _orderStream.Dispose();
     _orderStream = null;
 }
开发者ID:nchistyakov,项目名称:EventStore-1,代码行数:7,代码来源:MultiStreamMultiOutputCheckpointManager.cs

示例8: EnqueueTask

 public void EnqueueTask(StagedTask workItem, CheckpointTag workItemCheckpointTag)
 {
     if (_queueState == QueueState.Stopped)
         throw new InvalidOperationException("Queue is Stopped");
     ValidateQueueingOrder(workItemCheckpointTag);
     _queuePendingEvents.Enqueue(workItem);
 }
开发者ID:soto,项目名称:EventStore,代码行数:7,代码来源:CoreProjectionQueue.cs

示例9: ProjectionCheckpoint

 public ProjectionCheckpoint(
     RequestResponseDispatcher
         <ClientMessage.ReadStreamEventsBackward, ClientMessage.ReadStreamEventsBackwardCompleted> readDispatcher,
     RequestResponseDispatcher<ClientMessage.WriteEvents, ClientMessage.WriteEventsCompleted> writeDispatcher,
     ProjectionVersion projectionVersion, IPrincipal runAs, IProjectionCheckpointManager readyHandler,
     CheckpointTag from, PositionTagger positionTagger, CheckpointTag zero, int maxWriteBatchLength,
     ILogger logger = null)
 {
     if (readDispatcher == null) throw new ArgumentNullException("readDispatcher");
     if (writeDispatcher == null) throw new ArgumentNullException("writeDispatcher");
     if (readyHandler == null) throw new ArgumentNullException("readyHandler");
     if (positionTagger == null) throw new ArgumentNullException("positionTagger");
     if (zero == null) throw new ArgumentNullException("zero");
     if (from.CommitPosition <= from.PreparePosition) throw new ArgumentException("from");
     //NOTE: fromCommit can be equal fromPrepare on 0 position.  Is it possible anytime later? Ignoring for now.
     _readDispatcher = readDispatcher;
     _writeDispatcher = writeDispatcher;
     _projectionVersion = projectionVersion;
     _runAs = runAs;
     _readyHandler = readyHandler;
     _positionTagger = positionTagger;
     _zero = zero;
     _from = _last = from;
     _maxWriteBatchLength = maxWriteBatchLength;
     _logger = logger;
 }
开发者ID:jjvdangelo,项目名称:EventStore,代码行数:26,代码来源:ProjectionCheckpoint.cs

示例10: SubscriptionStarted

 public SubscriptionStarted(
     Guid subscriptionId, CheckpointTag checkpointTag, long startingLastCommitPosition,
     long subscriptionMessageSequenceNumber, object source = null)
     : base(subscriptionId, checkpointTag, 0f, subscriptionMessageSequenceNumber, source)
 {
     _startingLastCommitPosition = startingLastCommitPosition;
 }
开发者ID:czcz1024,项目名称:EventStore,代码行数:7,代码来源:EventReaderSubscriptionMessageBase.cs

示例11: CheckpointLoaded

 public CheckpointLoaded(Guid projectionId, CheckpointTag checkpointTag, string checkpointData)
     : base(projectionId)
 {
     if (checkpointTag == null) throw new ArgumentNullException("checkpointTag");
     _checkpointTag = checkpointTag;
     _checkpointData = checkpointData;
 }
开发者ID:jjvdangelo,项目名称:EventStore,代码行数:7,代码来源:CoreProjectionProcessingMessage.cs

示例12: UpdateToZero

 public void UpdateToZero()
 {
     var zero = new EventPosition(0, -1);
     if (_lastEventPosition != zero || _lastTag != null)
         throw new InvalidOperationException("Posistion tagger has be already updated");
     _lastTag = _positionTagger.MakeZeroCheckpointTag();
 }
开发者ID:vishal-h,项目名称:EventStore-1,代码行数:7,代码来源:PositionTracker.cs

示例13: UpdateByCheckpointTagForward

 public void UpdateByCheckpointTagForward(CheckpointTag newTag)
 {
     if (newTag <= _lastTag)
         throw new InvalidOperationException(
             string.Format("Event at checkpoint tag {0} has been already processed", newTag));
     _lastTag = newTag;
 }
开发者ID:vishal-h,项目名称:EventStore-1,代码行数:7,代码来源:PositionTracker.cs

示例14: WriteResult

 private void WriteResult(
     string partition, string resultBody, CheckpointTag causedBy, Guid causedByGuid, string correlationId)
 {
     var resultEvents = ResultUpdated(partition, resultBody, causedBy);
     if (resultEvents != null)
         _coreProjectionCheckpointManager.EventsEmitted(resultEvents, causedByGuid, correlationId);
 }
开发者ID:thinkbeforecoding,项目名称:EventStore,代码行数:7,代码来源:ResultWriter.cs

示例15: IsMessageAfterCheckpointTag

 public override bool IsMessageAfterCheckpointTag(
     CheckpointTag previous, ReaderSubscriptionMessage.CommittedEventDistributed committedEvent)
 {
     if (previous.Mode_ != CheckpointTag.Mode.Position)
         throw new ArgumentException("Mode.Position expected", "previous");
     return committedEvent.Data.Position > previous.Position;
 }
开发者ID:jjvdangelo,项目名称:EventStore,代码行数:7,代码来源:TransactionFilePositionTagger.cs


注:本文中的CheckpointTag类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。