• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# CheckpointTag类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: Start

 public override void Start(CheckpointTag checkpointTag)
 {
     base.Start(checkpointTag);
     _lastOrderCheckpointTag = checkpointTag;
     _orderStream = CreateOrderStream();
     _orderStream.Start();
 }
开发者ID:base31,项目名称:geteventstore_EventStore,代码行数:7,代码来源:MultiStreamMultiOutputCheckpointManager.cs


示例17: CreatePausedEventDistributionPoint

 public EventDistributionPoint CreatePausedEventDistributionPoint(Guid distributionPointId, IPublisher publisher, CheckpointTag checkpointTag)
 {
     if (_allStreams)
     {
         var distributionPoint = new TransactionFileReaderEventDistributionPoint(
             publisher, distributionPointId,
             new EventPosition(checkpointTag.CommitPosition.Value, checkpointTag.PreparePosition.Value));
         return distributionPoint;
     }
     else if (_streams != null && _streams.Count == 1)
     {
         var streamName = checkpointTag.Streams.Keys.First();
         //TODO: handle if not the same
         return CreatePausedStreamReaderEventDistributionPoint(distributionPointId, publisher, checkpointTag, streamName,
             resolveLinkTos: true, category: null);
     }
     else if (_categories != null && _categories.Count == 1)
     {
         var streamName = checkpointTag.Streams.Keys.First();
         return CreatePausedStreamReaderEventDistributionPoint(distributionPointId, publisher, checkpointTag, streamName,
             resolveLinkTos: true, category: _categories.First());
     }
     else
         throw new NotSupportedException();
 }
开发者ID:jpierson,项目名称:EventStore,代码行数:25,代码来源:CheckpointStrategy.cs


示例18: ReaderSubscriptionBase

        protected ReaderSubscriptionBase(
            IPublisher publisher,
            Guid subscriptionId,
            CheckpointTag @from,
            IReaderStrategy readerStrategy,
            ITimeProvider timeProvider,
            long? checkpointUnhandledBytesThreshold,
            int? checkpointProcessedEventsThreshold,
            bool stopOnEof,
            int? stopAfterNEvents)
        {
            if (publisher == null) throw new ArgumentNullException("publisher");
            if (readerStrategy == null) throw new ArgumentNullException("readerStrategy");
            if (timeProvider == null) throw new ArgumentNullException("timeProvider");
            if (checkpointProcessedEventsThreshold > 0 && stopAfterNEvents > 0)
                throw new ArgumentException("checkpointProcessedEventsThreshold > 0 && stopAfterNEvents > 0");

            _publisher = publisher;
            _readerStrategy = readerStrategy;
            _timeProvider = timeProvider;
            _checkpointUnhandledBytesThreshold = checkpointUnhandledBytesThreshold;
            _checkpointProcessedEventsThreshold = checkpointProcessedEventsThreshold;
            _stopOnEof = stopOnEof;
            _stopAfterNEvents = stopAfterNEvents;
            _subscriptionId = subscriptionId;
            _lastPassedOrCheckpointedEventPosition = null;

            _eventFilter = readerStrategy.EventFilter;

            _positionTagger = readerStrategy.PositionTagger;
            _positionTracker = new PositionTracker(_positionTagger);
            _positionTracker.UpdateByCheckpointTagInitial(@from);
        }
开发者ID:danieldeb,项目名称:EventStore,代码行数:33,代码来源:ReaderSubscriptionBase.cs


示例19: when

 public void when()
 {
     _cache = new PartitionStateCache(CheckpointTag.FromPosition(0, -1));
     _cachedAtCheckpointTag = CheckpointTag.FromPosition(1000, 900);
     _cache.CachePartitionState(
         "partition", new PartitionState("data", null, _cachedAtCheckpointTag));
 }
开发者ID:jjvdangelo,项目名称:EventStore,代码行数:7,代码来源:when_caching_a_parition_state.cs


示例20: ProcessEvent

        public bool ProcessEvent(
            string partition, CheckpointTag eventPosition, string category1, ResolvedEvent data,
            out string newState, out string newSharedState, out EmittedEventEnvelope[] emittedEvents)
        {
            newSharedState = null;
            emittedEvents = null;
            newState = null;
            if (data.EventStreamId != data.PositionStreamId)
                return false;
            var indexedEventType = data.EventType;
            if (indexedEventType == "$>")
                return false;

            string positionStreamId;
            var isStreamDeletedEvent = StreamDeletedHelper.IsStreamDeletedEvent(
                data.PositionStreamId, data.EventType, data.Data, out positionStreamId);
            if (isStreamDeletedEvent)
                indexedEventType = "$deleted";

            emittedEvents = new[]
            {
                new EmittedEventEnvelope(
                    new EmittedDataEvent(
                        _indexStreamPrefix + indexedEventType, Guid.NewGuid(), "$>", false,
                        data.EventSequenceNumber + "@" + positionStreamId,
                        isStreamDeletedEvent
                            ? new ExtraMetaData(new Dictionary<string, JRaw> {{"$deleted", new JRaw(-1)}})
                            : null, eventPosition, expectedTag: null))
            };

            return true;
        }
开发者ID:EventStore,项目名称:EventStore,代码行数:32,代码来源:IndexEventsByEventType.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# ChemicalFormula类代码示例发布时间:2022-05-24
下一篇:
C# CheckoutAttributeModel类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap