本文整理汇总了C#中EventStore.Projections.Core.Services.Processing.ProjectionVersion类的典型用法代码示例。如果您正苦于以下问题:C# ProjectionVersion类的具体用法?C# ProjectionVersion怎么用?C# ProjectionVersion使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ProjectionVersion类属于EventStore.Projections.Core.Services.Processing命名空间,在下文中一共展示了ProjectionVersion类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: not_equal_version
public void not_equal_version()
{
var v1 = new ProjectionVersion(10, 5, 6);
var v2 = new ProjectionVersion(10, 5, 7);
Assert.AreNotEqual(v1, v2);
}
示例2: ParallelQueryProcessingStrategy
public ParallelQueryProcessingStrategy(
string name, ProjectionVersion projectionVersion, IProjectionStateHandler stateHandler,
Func<IProjectionStateHandler> handlerFactory, ProjectionConfig projectionConfig,
IQueryDefinition sourceDefinition, ProjectionNamesBuilder namesBuilder, ILogger logger,
SpooledStreamReadingDispatcher spoolProcessingResponseDispatcher,
ReaderSubscriptionDispatcher subscriptionDispatcher)
: base(name, projectionVersion, projectionConfig, sourceDefinition, logger, subscriptionDispatcher)
{
_stateHandler = stateHandler;
_projectionConfig = projectionConfig;
_sourceDefinition = sourceDefinition;
_namesBuilder = namesBuilder;
_spoolProcessingResponseDispatcher = spoolProcessingResponseDispatcher;
if (_sourceDefinition.CatalogStream == SystemStreams.AllStream)
{
_catalogStreamName = SystemStreams.AllStream;
}
else if (_sourceDefinition.HasCategories())
{
_catalogStreamName = _namesBuilder.GetCategoryCatalogStreamName(_sourceDefinition.Categories[0]);
}
else
{
_catalogStreamName = _sourceDefinition.CatalogStream;
}
}
示例3: ParseCheckpointTagVersionExtraJson
public static CheckpointTagVersion ParseCheckpointTagVersionExtraJson(this byte[] source, ProjectionVersion current)
{
if (source == null || source.Length == 0)
return new CheckpointTagVersion { Version = new ProjectionVersion(current.ProjectionId, 0, 0), Tag = null };
var reader = new JsonTextReader(new StreamReader(new MemoryStream(source)));
return CheckpointTag.FromJson(reader, current);
}
示例4: CreateProjectionProcessingStrategy
public ProjectionProcessingStrategy CreateProjectionProcessingStrategy(
string name, ProjectionVersion projectionVersion, ProjectionNamesBuilder namesBuilder,
IQueryDefinition sourceDefinition, ProjectionConfig projectionConfig,
Func<IProjectionStateHandler> handlerFactory, IProjectionStateHandler stateHandler)
{
if (!sourceDefinition.DisableParallelismOption && projectionConfig.StopOnEof && sourceDefinition.ByStreams
&& sourceDefinition.DefinesFold && !string.IsNullOrEmpty(sourceDefinition.CatalogStream))
{
return new ParallelQueryProcessingStrategy(
name, projectionVersion, stateHandler, handlerFactory, projectionConfig, sourceDefinition,
namesBuilder, _logger, _spoolProcessingResponseDispatcher, _subscriptionDispatcher);
}
if (!sourceDefinition.DisableParallelismOption && projectionConfig.StopOnEof && sourceDefinition.ByStreams
&& sourceDefinition.DefinesFold && sourceDefinition.HasCategories())
{
return new ParallelQueryProcessingStrategy(
name, projectionVersion, stateHandler, handlerFactory, projectionConfig, sourceDefinition,
namesBuilder, _logger, _spoolProcessingResponseDispatcher, _subscriptionDispatcher);
}
return projectionConfig.StopOnEof
? (ProjectionProcessingStrategy)
new QueryProcessingStrategy(
name, projectionVersion, stateHandler, projectionConfig, sourceDefinition, _logger,
_subscriptionDispatcher)
: new ContinuousProjectionProcessingStrategy(
name, projectionVersion, stateHandler, projectionConfig, sourceDefinition, _logger,
_subscriptionDispatcher);
}
示例5: 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;
}
示例6: equal
public void equal()
{
var v1 = new ProjectionVersion(10, 5, 6);
var v2 = new ProjectionVersion(10, 5, 6);
Assert.AreEqual(v1, v2);
}
示例7: AdjustBy
public CheckpointTag AdjustBy(PositionTagger tagger, ProjectionVersion version)
{
if (SystemVersion == Projections.VERSION && Version.Version == version.Version
&& Version.ProjectionId == version.ProjectionId)
return Tag;
return tagger.AdjustTag(Tag);
}
示例8: FakeProjectionProcessingStrategy
public FakeProjectionProcessingStrategy(
string name, ProjectionVersion projectionVersion, ILogger logger, FakeProjectionProcessingPhase phase1,
FakeProjectionProcessingPhase phase2)
: base(name, projectionVersion, logger)
{
_phase1 = phase1;
_phase2 = phase2;
}
示例9: EventReaderBasedProjectionProcessingStrategy
protected EventReaderBasedProjectionProcessingStrategy(
string name, ProjectionVersion projectionVersion, ProjectionConfig projectionConfig,
IQuerySources sourceDefinition, ILogger logger, ReaderSubscriptionDispatcher subscriptionDispatcher)
: base(name, projectionVersion, logger)
{
_projectionConfig = projectionConfig;
_sourceDefinition = sourceDefinition;
_subscriptionDispatcher = subscriptionDispatcher;
}
示例10: CreateSlaveProjectionProcessingStrategy
public ProjectionProcessingStrategy CreateSlaveProjectionProcessingStrategy(
string name, ProjectionVersion projectionVersion, ProjectionSourceDefinition sourceDefinition,
ProjectionConfig projectionConfig, IProjectionStateHandler stateHandler, IPublisher resultsEnvelope,
Guid masterCoreProjectionId, ProjectionCoreService projectionCoreService)
{
return new SlaveQueryProcessingStrategy(
name, projectionVersion, stateHandler, projectionConfig, sourceDefinition, projectionCoreService.Logger,
resultsEnvelope, masterCoreProjectionId, _subscriptionDispatcher);
}
示例11: QueryProcessingStrategy
public QueryProcessingStrategy(
string name, ProjectionVersion projectionVersion, IProjectionStateHandler stateHandler,
ProjectionConfig projectionConfig, IQuerySources sourceDefinition, ILogger logger,
ReaderSubscriptionDispatcher subscriptionDispatcher)
: base(
name, projectionVersion, stateHandler, projectionConfig, sourceDefinition, logger,
subscriptionDispatcher)
{
}
示例12: CoreProjectionCheckpointWriter
public CoreProjectionCheckpointWriter(
string projectionCheckpointStreamId, IODispatcher ioDispatcher, ProjectionVersion projectionVersion,
string name)
{
_projectionCheckpointStreamId = projectionCheckpointStreamId;
_logger = LogManager.GetLoggerFor<CoreProjectionCheckpointWriter>();
_ioDispatcher = ioDispatcher;
_projectionVersion = projectionVersion;
_name = name;
}
示例13: a_null_name_throws_argument_null_excveption
public void a_null_name_throws_argument_null_excveption()
{
IProjectionStateHandler projectionStateHandler = new FakeProjectionStateHandler();
var version = new ProjectionVersion(1, 0, 0);
new ContinuousProjectionProcessingStrategy(
null, version, projectionStateHandler, _defaultProjectionConfig,
projectionStateHandler.GetSourceDefinition(), null, _subscriptionDispatcher).Create(
Guid.NewGuid(), new FakePublisher(), SystemAccount.Principal, new FakePublisher(), _ioDispatcher,
_subscriptionDispatcher, new RealTimeProvider());
}
示例14: CoreProjectionCheckpointReader
public CoreProjectionCheckpointReader(
IPublisher publisher, Guid projectionCorrelationId, IODispatcher ioDispatcher, string projectionCheckpointStreamId, ProjectionVersion projectionVersion, bool useCheckpoints)
{
_publisher = publisher;
_projectionCorrelationId = projectionCorrelationId;
_ioDispatcher = ioDispatcher;
_projectionCheckpointStreamId = projectionCheckpointStreamId;
_projectionVersion = projectionVersion;
_useCheckpoints = useCheckpoints;
}
示例15: a_negative_checkpoint_handled_interval_throws_argument_out_of_range_exception
public void a_negative_checkpoint_handled_interval_throws_argument_out_of_range_exception()
{
IProjectionStateHandler projectionStateHandler = new FakeProjectionStateHandler();
var version = new ProjectionVersion(1, 0, 0);
var projectionConfig = new ProjectionConfig(null, -1, 10, 1000, 250, true, true, false, false, false);
new ContinuousProjectionProcessingStrategy(
"projection", version, projectionStateHandler, projectionConfig,
projectionStateHandler.GetSourceDefinition(), null, _subscriptionDispatcher).Create(
Guid.NewGuid(), new FakePublisher(), SystemAccount.Principal, new FakePublisher(), _ioDispatcher,
_subscriptionDispatcher, new RealTimeProvider());
}