本文整理汇总了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);
}
示例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);
}
示例3: DataReportBase
protected DataReportBase(Guid correlationId, Guid projectionId, string partition, CheckpointTag position)
: base(projectionId)
{
_correlationId = correlationId;
_partition = partition;
_position = position;
}
示例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;
}
示例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;
}
示例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;
}
示例7: Initialize
public override void Initialize()
{
base.Initialize();
_lastOrderCheckpointTag = null;
if (_orderStream != null) _orderStream.Dispose();
_orderStream = null;
}
示例8: EnqueueTask
public void EnqueueTask(StagedTask workItem, CheckpointTag workItemCheckpointTag)
{
if (_queueState == QueueState.Stopped)
throw new InvalidOperationException("Queue is Stopped");
ValidateQueueingOrder(workItemCheckpointTag);
_queuePendingEvents.Enqueue(workItem);
}
示例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;
}
示例10: SubscriptionStarted
public SubscriptionStarted(
Guid subscriptionId, CheckpointTag checkpointTag, long startingLastCommitPosition,
long subscriptionMessageSequenceNumber, object source = null)
: base(subscriptionId, checkpointTag, 0f, subscriptionMessageSequenceNumber, source)
{
_startingLastCommitPosition = startingLastCommitPosition;
}
示例11: CheckpointLoaded
public CheckpointLoaded(Guid projectionId, CheckpointTag checkpointTag, string checkpointData)
: base(projectionId)
{
if (checkpointTag == null) throw new ArgumentNullException("checkpointTag");
_checkpointTag = checkpointTag;
_checkpointData = checkpointData;
}
示例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();
}
示例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;
}
示例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);
}
示例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;
}