public override bool IsMessageAfterCheckpointTag(CheckpointTag previous, ProjectionCoreServiceMessage.CommittedEventDistributed comittedEvent) { if (previous.GetMode() != CheckpointTag.Mode.Position) { throw new ArgumentException("Mode.Position expected", "previous"); } return(comittedEvent.Position > previous.Position); }
public override bool IsMessageAfterCheckpointTag(CheckpointTag previous, ProjectionCoreServiceMessage.CommittedEventDistributed comittedEvent) { if (previous.GetMode() != CheckpointTag.Mode.Stream) { throw new ArgumentException("Mode.Stream expected", "previous"); } return(comittedEvent.PositionStreamId == _stream && comittedEvent.PositionSequenceNumber > previous.Streams[_stream]); }
private void EnsureCheckpointTagModeIs(CheckpointTag checkpointTag, CheckpointTag.Mode mode) { var checkpointTagMode = checkpointTag.GetMode(); if (checkpointTagMode != mode) { throw new ArgumentException( String.Format( "Inavlid checkpoint tag mode: '{0}'. Expected mode is: '{1}'", checkpointTagMode, mode)); } }
public override bool IsCompatible(CheckpointTag checkpointTag) { return(checkpointTag.GetMode() == CheckpointTag.Mode.Stream && checkpointTag.Streams.Keys.First() == this._stream); }
public override bool IsCompatible(CheckpointTag checkpointTag) { return(checkpointTag.GetMode() == CheckpointTag.Mode.Position); }
public override bool IsCompatible(CheckpointTag checkpointTag) { //TODO: should Stream be supported here as well if in the set? return(checkpointTag.GetMode() == CheckpointTag.Mode.MultiStream && checkpointTag.Streams.All(v => _streams.Contains(v.Key))); }