Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Progress: cleanup in meaning or OriginalEventPosition in resolved events

  • Loading branch information...
commit 4d7d5b76cdfb37641bb6fa3de167949049e12c20 1 parent 1afe6a3
@ysw ysw authored
Showing with 212 additions and 263 deletions.
  1. +35 −0 src/EventStore/EventStore.Projections.Core.Tests/ClientAPI/specification_with_standard_projections_runnning.cs
  2. +1 −13 ...ClientAPI/when_handling_delete/with_from_category_foreach_projection/when_running_and_events_are_indexed.cs
  3. +16 −19 ...stream_and_tombstone.cs → when_running_and_events_are_indexed_but_a_stream_and_tombstone_postponed.cs}
  4. +1 −1  src/EventStore/EventStore.Projections.Core.Tests/EventStore.Projections.Core.Tests.csproj
  5. +4 −4 ...entStore.Projections.Core.Tests/Services/event_reader/stream_reader/when_handling_read_completed_and_eof.cs
  6. +4 −4 ...jections.Core.Tests/Services/event_reader/stream_reader/when_handling_read_completed_stream_event_reader.cs
  7. +4 −4 ...jections.Core.Tests/Services/event_reader/stream_reader/when_handling_read_completed_then_pause_then_eof.cs
  8. +0 −2  src/EventStore/EventStore.Projections.Core/EventStore.Projections.Core.csproj
  9. +14 −6 src/EventStore/EventStore.Projections.Core/Messages/ReaderSubscriptionMessage.cs
  10. +2 −2 src/EventStore/EventStore.Projections.Core/Services/Processing/ByStreamCatalogEventReader.cs
  11. +5 −0 src/EventStore/EventStore.Projections.Core/Services/Processing/BypassingEventFilter.cs
  12. +5 −0 src/EventStore/EventStore.Projections.Core/Services/Processing/CategoryEventFilter.cs
  13. +5 −0 src/EventStore/EventStore.Projections.Core/Services/Processing/EventByTypeIndexEventFilter.cs
  14. +8 −16 src/EventStore/EventStore.Projections.Core/Services/Processing/EventByTypeIndexEventReader.cs
  15. +10 −10 src/EventStore/EventStore.Projections.Core/Services/Processing/EventByTypeIndexPositionTagger.cs
  16. +1 −0  src/EventStore/EventStore.Projections.Core/Services/Processing/EventFilter.cs
  17. +3 −3 src/EventStore/EventStore.Projections.Core/Services/Processing/EventReader.cs
  18. +2 −2 src/EventStore/EventStore.Projections.Core/Services/Processing/ExternallyFedByStreamEventReader.cs
  19. +5 −5 src/EventStore/EventStore.Projections.Core/Services/Processing/HeadingEventReader.cs
  20. +0 −58 src/EventStore/EventStore.Projections.Core/Services/Processing/IndexedEventTypeEventFilter.cs
  21. +0 −65 src/EventStore/EventStore.Projections.Core/Services/Processing/IndexedEventTypesEventFilter.cs
  22. +5 −0 src/EventStore/EventStore.Projections.Core/Services/Processing/MultiStreamEventFilter.cs
  23. +2 −0  src/EventStore/EventStore.Projections.Core/Services/Processing/ReaderSubscription.cs
  24. +1 −1  src/EventStore/EventStore.Projections.Core/Services/Processing/ReaderSubscriptionBase.cs
  25. +22 −13 src/EventStore/EventStore.Projections.Core/Services/Processing/ResolvedEvent.cs
  26. +5 −0 src/EventStore/EventStore.Projections.Core/Services/Processing/StreamEventFilter.cs
  27. +7 −17 src/EventStore/EventStore.Projections.Core/Services/Processing/StreamEventReader.cs
  28. +5 −0 src/EventStore/EventStore.Projections.Core/Services/Processing/TransactionFileEventFilter.cs
  29. +12 −8 src/EventStore/EventStore.Projections.Core/Services/Processing/TransactionFileEventReader.cs
  30. +3 −3 src/EventStore/EventStore.Projections.Core/Services/Processing/TransactionFilePositionTagger.cs
  31. +25 −7 src/EventStore/EventStore.Projections.Core/Standard/StreamDeletedHelper.cs
View
35 ...tore.Projections.Core.Tests/ClientAPI/specification_with_standard_projections_runnning.cs
@@ -199,6 +199,26 @@ protected void AssertStreamTail(string streamId, params string[] events)
#endif
}
+ [Conditional("DEBUG")]
+ protected void DumpStream(string streamId)
+ {
+#if DEBUG
+ var result = _conn.ReadStreamEventsBackward(streamId, -1, 100, true, _admin);
+ switch (result.Status)
+ {
+ case SliceReadStatus.StreamDeleted:
+ Assert.Fail("Stream '{0}' is deleted", streamId);
+ break;
+ case SliceReadStatus.StreamNotFound:
+ Assert.Fail("Stream '{0}' does not exist", streamId);
+ break;
+ case SliceReadStatus.Success:
+ Dump("Dumping..", streamId, result.Events.Reverse().ToArray());
+ break;
+ }
+#endif
+ }
+
#if DEBUG
private void DumpFailed(string message, string streamId, string[] events, ResolvedEvent[] resultEvents)
{
@@ -213,6 +233,21 @@ private void DumpFailed(string message, string streamId, string[] events, Resolv
Assert.Fail(
"Stream: '{0}'\r\n{1}\r\n\r\nExisting events: \r\n{2}\r\n Expected events: \r\n{3}\r\n\r\nActual metas:{4}", streamId,
message, actual, expected, actualMeta);
+
+ }
+
+ private void Dump(string message, string streamId, ResolvedEvent[] resultEvents)
+ {
+ var actual = resultEvents.Aggregate(
+ "", (a, v) => a + ", " + v.OriginalEvent.EventType + ":" + v.OriginalEvent.DebugDataView);
+
+ var actualMeta = resultEvents.Aggregate(
+ "", (a, v) => a + "\r\n" + v.OriginalEvent.EventType + ":" + v.OriginalEvent.DebugMetadataView);
+
+
+ Debug.WriteLine(
+ "Stream: '{0}'\r\n{1}\r\n\r\nExisting events: \r\n{2}\r\n \r\nActual metas:{3}", streamId,
+ message, actual, actualMeta);
}
#endif
View
14 ...dling_delete/with_from_category_foreach_projection/when_running_and_events_are_indexed.cs
@@ -45,21 +45,9 @@ protected override void Given()
PostEvent("stream-1", "type2", "{}");
PostEvent("stream-2", "type1", "{}");
PostEvent("stream-2", "type2", "{}");
- WaitIdle();
- EnableStandardProjections();
- WaitIdle();
HardDeleteStream("stream-1");
WaitIdle();
- DisableStandardProjections();
- WaitIdle();
-
- // required to flush index checkpoint
- {
- EnableStandardProjections();
- WaitIdle();
- DisableStandardProjections();
- WaitIdle();
- }
+ EnableStandardProjections();
}
protected override void When()
View
35 ...are_indexed_but_a_stream_and_tombstone.cs → ...d_but_a_stream_and_tombstone_postponed.cs
@@ -31,7 +31,7 @@
namespace EventStore.Projections.Core.Tests.ClientAPI.when_handling_delete.with_from_category_foreach_projection
{
[TestFixture]
- public class when_running_and_events_are_indexed_but_a_stream_and_tombstone :
+ public class when_running_and_events_are_indexed_but_a_stream_and_tombstone_postponed :
specification_with_standard_projections_runnning
{
protected override bool GivenStandardProjectionsRunning()
@@ -49,24 +49,7 @@ protected override void Given()
WaitIdle();
DisableStandardProjections();
WaitIdle();
-
- // required to flush index checkpoint
- {
- EnableStandardProjections();
- WaitIdle();
- DisableStandardProjections();
- WaitIdle();
- }
-
- PostEvent("stream-1", "type1", "{}");
- PostEvent("stream-1", "type2", "{}");
- HardDeleteStream("stream-1");
- WaitIdle();
- }
-
- protected override void When()
- {
- base.When();
+
PostProjection(@"
fromCategory('stream').foreachStream().when({
$init: function(){return {a:0}},
@@ -76,11 +59,25 @@ protected override void When()
}).outputState();
");
WaitIdle();
+ // SUT projection must have been joined heading reader
+ EnableStandardProjections();
+ WaitIdle();
+ }
+
+ protected override void When()
+ {
+ base.When();
+ PostEvent("stream-1", "type1", "{}");
+ PostEvent("stream-1", "type2", "{}");
+ WaitIdle();
+ HardDeleteStream("stream-1");
+ WaitIdle();
}
[Test, Category("Network")]
public void receives_deleted_notification()
{
+ DumpStream("$ce-stream");
AssertStreamTail("$projections-test-projection-stream-1-result", "Result:{\"a\":2,\"deleted\":1}");
}
}
View
2  src/EventStore/EventStore.Projections.Core.Tests/EventStore.Projections.Core.Tests.csproj
@@ -112,7 +112,7 @@
<Compile Include="ClientAPI\when_handling_delete\with_from_category_foreach_projection\recovery\when_running_and_events_are_indexed.cs" />
<Compile Include="ClientAPI\when_handling_delete\with_from_category_foreach_projection\recovery\when_running_and_events_get_indexed_before_recovery.cs" />
<Compile Include="ClientAPI\when_handling_delete\with_from_category_foreach_projection\when_running_and_events_are_indexed.cs" />
- <Compile Include="ClientAPI\when_handling_delete\with_from_category_foreach_projection\when_running_and_events_are_indexed_but_a_stream_and_tombstone.cs" />
+ <Compile Include="ClientAPI\when_handling_delete\with_from_category_foreach_projection\when_running_and_events_are_indexed_but_a_stream_and_tombstone_postponed.cs" />
<Compile Include="ClientAPI\when_handling_delete\with_from_category_foreach_projection\when_running_and_events_are_indexed_but_more_events_and_tombstone.cs" />
<Compile Include="ClientAPI\when_handling_delete\with_from_category_foreach_projection\when_running_and_events_are_indexed_but_tombstone.cs" />
<Compile Include="ClientAPI\when_handling_delete\with_from_category_foreach_projection\when_running_and_no_indexing.cs" />
View
8 ...ns.Core.Tests/Services/event_reader/stream_reader/when_handling_read_completed_and_eof.cs
@@ -132,10 +132,10 @@ public void publishes_correct_committed_event_received_messages()
Assert.AreEqual(100, second.Data.Position.PreparePosition);
Assert.AreEqual(-1, first.Data.Position.CommitPosition);
Assert.AreEqual(-1, second.Data.Position.CommitPosition);
- Assert.AreEqual(50, first.Data.OriginalPosition.PreparePosition);
- Assert.AreEqual(100, second.Data.OriginalPosition.PreparePosition);
- Assert.AreEqual(-1, first.Data.OriginalPosition.CommitPosition);
- Assert.AreEqual(-1, second.Data.OriginalPosition.CommitPosition);
+ Assert.AreEqual(50, first.Data.EventOrLinkTargetPosition.PreparePosition);
+ Assert.AreEqual(100, second.Data.EventOrLinkTargetPosition.PreparePosition);
+ Assert.AreEqual(-1, first.Data.EventOrLinkTargetPosition.CommitPosition);
+ Assert.AreEqual(-1, second.Data.EventOrLinkTargetPosition.CommitPosition);
Assert.AreEqual(50, first.SafeTransactionFileReaderJoinPosition);
Assert.AreEqual(100, second.SafeTransactionFileReaderJoinPosition);
}
View
8 ...s/Services/event_reader/stream_reader/when_handling_read_completed_stream_event_reader.cs
@@ -122,10 +122,10 @@ public void publishes_correct_committed_event_received_messages()
Assert.AreEqual(100, second.Data.Position.PreparePosition);
Assert.AreEqual(-1, first.Data.Position.CommitPosition);
Assert.AreEqual(-1, second.Data.Position.CommitPosition);
- Assert.AreEqual(50, first.Data.OriginalPosition.PreparePosition);
- Assert.AreEqual(100, second.Data.OriginalPosition.PreparePosition);
- Assert.AreEqual(-1, first.Data.OriginalPosition.CommitPosition);
- Assert.AreEqual(-1, second.Data.OriginalPosition.CommitPosition);
+ Assert.AreEqual(50, first.Data.EventOrLinkTargetPosition.PreparePosition);
+ Assert.AreEqual(100, second.Data.EventOrLinkTargetPosition.PreparePosition);
+ Assert.AreEqual(-1, first.Data.EventOrLinkTargetPosition.CommitPosition);
+ Assert.AreEqual(-1, second.Data.EventOrLinkTargetPosition.CommitPosition);
Assert.AreEqual(50, first.SafeTransactionFileReaderJoinPosition);
Assert.AreEqual(100, second.SafeTransactionFileReaderJoinPosition);
Assert.IsFalse(first.Data.IsJson);
View
8 ...s/Services/event_reader/stream_reader/when_handling_read_completed_then_pause_then_eof.cs
@@ -133,10 +133,10 @@ public void publishes_correct_committed_event_received_messages()
Assert.AreEqual(100, second.Data.Position.PreparePosition);
Assert.AreEqual(-1, first.Data.Position.CommitPosition);
Assert.AreEqual(-1, second.Data.Position.CommitPosition);
- Assert.AreEqual(50, first.Data.OriginalPosition.PreparePosition);
- Assert.AreEqual(100, second.Data.OriginalPosition.PreparePosition);
- Assert.AreEqual(-1, first.Data.OriginalPosition.CommitPosition);
- Assert.AreEqual(-1, second.Data.OriginalPosition.CommitPosition);
+ Assert.AreEqual(50, first.Data.EventOrLinkTargetPosition.PreparePosition);
+ Assert.AreEqual(100, second.Data.EventOrLinkTargetPosition.PreparePosition);
+ Assert.AreEqual(-1, first.Data.EventOrLinkTargetPosition.CommitPosition);
+ Assert.AreEqual(-1, second.Data.EventOrLinkTargetPosition.CommitPosition);
Assert.AreEqual(50, first.SafeTransactionFileReaderJoinPosition);
Assert.AreEqual(100, second.SafeTransactionFileReaderJoinPosition);
}
View
2  src/EventStore/EventStore.Projections.Core/EventStore.Projections.Core.csproj
@@ -221,8 +221,6 @@
<Compile Include="Services\Processing\ICoreProjectionForProcessingPhase.cs" />
<Compile Include="Services\Processing\IEventReader.cs" />
<Compile Include="Services\Processing\IEventWriter.cs" />
- <Compile Include="Services\Processing\IndexedEventTypeEventFilter.cs" />
- <Compile Include="Services\Processing\IndexedEventTypesEventFilter.cs" />
<Compile Include="Services\Processing\IEventProcessingPhase.cs" />
<Compile Include="Services\Processing\IProjectionProcessingPhase.cs" />
<Compile Include="Services\Processing\IReaderStrategy.cs" />
View
20 src/EventStore/EventStore.Projections.Core/Messages/ReaderSubscriptionMessage.cs
@@ -159,18 +159,21 @@ public override int MsgTypeId
private readonly string _partition;
private readonly int? _lastEventNumber;
- private readonly TFPos? _deleteEventPosition;
+ private readonly TFPos? _deleteLinkOrEventPosition;
+ private readonly TFPos? _deleteEventOrLinkTargetPosition;
private readonly string _positionStreamId;
private readonly int? _positionEventNumber;
public EventReaderPartitionDeleted(
- Guid correlationId, string partition, int? lastEventNumber, TFPos? deleteEventPosition,
- string positionStreamId, int? positionEventNumber, CheckpointTag preTagged = null, object source = null)
+ Guid correlationId, string partition, int? lastEventNumber, TFPos? deleteLinkOrEventPosition,
+ TFPos? deleteEventOrLinkTargetPosition, string positionStreamId, int? positionEventNumber,
+ CheckpointTag preTagged = null, object source = null)
: base(correlationId, preTagged, source)
{
_partition = partition;
_lastEventNumber = lastEventNumber;
- _deleteEventPosition = deleteEventPosition;
+ _deleteLinkOrEventPosition = deleteLinkOrEventPosition;
+ _deleteEventOrLinkTargetPosition = deleteEventOrLinkTargetPosition;
_positionStreamId = positionStreamId;
_positionEventNumber = positionEventNumber;
}
@@ -185,9 +188,9 @@ public string Partition
get { return _lastEventNumber; }
}
- public TFPos? DeleteEventPosition
+ public TFPos? DeleteEventOrLinkTargetPosition
{
- get { return _deleteEventPosition; }
+ get { return _deleteEventOrLinkTargetPosition; }
}
public string PositionStreamId
@@ -199,6 +202,11 @@ public string PositionStreamId
{
get { return _positionEventNumber; }
}
+
+ public TFPos? DeleteLinkOrEventPosition
+ {
+ get { return _deleteLinkOrEventPosition; }
+ }
}
public class EventReaderPartitionMeasured : SubscriptionMessage
View
4 src/EventStore/EventStore.Projections.Core/Services/Processing/ByStreamCatalogEventReader.cs
@@ -163,12 +163,12 @@ private void ReadDataStreamCompleted(ClientMessage.ReadStreamEventsForwardComple
case ReadStreamResult.NoStream:
_dataNextSequenceNumber = int.MaxValue;
if (completed.LastEventNumber >= 0)
- SendPartitionDeleted(_dataStreamName, -1, null, null, null);
+ SendPartitionDeleted(_dataStreamName, -1, null, null, null, null);
PauseOrContinueProcessing();
break;
case ReadStreamResult.StreamDeleted:
_dataNextSequenceNumber = int.MaxValue;
- SendPartitionDeleted(_dataStreamName, -1, null, null, null);
+ SendPartitionDeleted(_dataStreamName, -1, null, null, null, null);
PauseOrContinueProcessing();
break;
case ReadStreamResult.Success:
View
5 src/EventStore/EventStore.Projections.Core/Services/Processing/BypassingEventFilter.cs
@@ -35,6 +35,11 @@ public BypassingEventFilter()
{
}
+ public override bool DeletedNotificationPasses(string positionStreamId)
+ {
+ return true;
+ }
+
public override bool PassesSource(bool resolvedFromLinkTo, string positionStreamId, string eventType)
{
return true;
View
5 src/EventStore/EventStore.Projections.Core/Services/Processing/CategoryEventFilter.cs
@@ -43,6 +43,11 @@ public CategoryEventFilter(string category, bool allEvents, HashSet<string> even
_categoryStream = "$ce-" + category;
}
+ public override bool DeletedNotificationPasses(string positionStreamId)
+ {
+ return _categoryStream == positionStreamId;
+ }
+
public override bool PassesSource(bool resolvedFromLinkTo, string positionStreamId, string eventType)
{
return resolvedFromLinkTo && _categoryStream == positionStreamId;
View
5 ...EventStore/EventStore.Projections.Core/Services/Processing/EventByTypeIndexEventFilter.cs
@@ -46,6 +46,11 @@ public EventByTypeIndexEventFilter(HashSet<string> events)
_streams = new HashSet<string>(from eventType in events select "$et-" + eventType);
}
+ public override bool DeletedNotificationPasses(string positionStreamId)
+ {
+ return true;
+ }
+
public override bool PassesSource(bool resolvedFromLinkTo, string positionStreamId, string eventType)
{
//TODO: add tests to assure that resolved by link events are not passed twice into the subscription?!!
View
24 ...EventStore/EventStore.Projections.Core/Services/Processing/EventByTypeIndexEventReader.cs
@@ -181,39 +181,31 @@ protected State(EventByTypeIndexEventReader reader, IPrincipal readAs)
protected void DeliverEvent(float progress, ResolvedEvent resolvedEvent, TFPos position)
{
- if (resolvedEvent.OriginalPosition <= _reader._lastEventPosition)
+ if (resolvedEvent.EventOrLinkTargetPosition <= _reader._lastEventPosition)
return;
- _reader._lastEventPosition = resolvedEvent.OriginalPosition;
+ _reader._lastEventPosition = resolvedEvent.EventOrLinkTargetPosition;
_reader._deliveredEvents ++;
//TODO: this is incomplete. where reading from TF we need to handle actual deletes
- string partitionStreamId;
+ string deletedPartitionStreamId;
- bool isDeletedStreamEvent;
if (resolvedEvent.IsLinkToDeletedStream && !resolvedEvent.IsLinkToDeletedStreamTombstone)
return;
- if (resolvedEvent.IsLinkToDeletedStreamTombstone)
- {
- isDeletedStreamEvent = true;
- partitionStreamId = resolvedEvent.EventStreamId;
- }
- else
- {
- isDeletedStreamEvent = StreamDeletedHelper.IsStreamDeletedEvent(
- resolvedEvent.EventStreamId, resolvedEvent.EventType, resolvedEvent.Data, out partitionStreamId);
- }
+ bool isDeletedStreamEvent = StreamDeletedHelper.IsStreamDeletedEvent(
+ resolvedEvent, out deletedPartitionStreamId);
if (isDeletedStreamEvent)
{
- var deletedPartition = partitionStreamId;
+ var deletedPartition = deletedPartitionStreamId;
if (_reader._includeDeletedStreamNotification)
_reader._publisher.Publish(
//TODO: publish both link and event data
new ReaderSubscriptionMessage.EventReaderPartitionDeleted(
_reader.EventReaderCorrelationId, deletedPartition, source: this.GetType(),
- lastEventNumber: -1, deleteEventPosition: position,
+ lastEventNumber: -1, deleteEventOrLinkTargetPosition: position,
+ deleteLinkOrEventPosition: resolvedEvent.EventOrLinkTargetPosition,
positionStreamId: resolvedEvent.PositionStreamId,
positionEventNumber: resolvedEvent.PositionSequenceNumber));
}
View
20 ...ntStore/EventStore.Projections.Core/Services/Processing/EventByTypeIndexPositionTagger.cs
@@ -60,10 +60,10 @@ public class EventByTypeIndexPositionTagger : PositionTagger
return true;
if (previous.Mode_ != CheckpointTag.Mode.EventTypeIndex)
throw new ArgumentException("Mode.EventTypeIndex expected", "previous");
- if (committedEvent.Data.OriginalPosition.CommitPosition <= 0)
+ if (committedEvent.Data.EventOrLinkTargetPosition.CommitPosition <= 0)
throw new ArgumentException("complete TF position required", "committedEvent");
- return committedEvent.Data.OriginalPosition > previous.Position;
+ return committedEvent.Data.EventOrLinkTargetPosition > previous.Position;
}
public override CheckpointTag MakeCheckpointTag(
@@ -73,18 +73,18 @@ public class EventByTypeIndexPositionTagger : PositionTagger
throw new ArgumentException(
string.Format("Invalid checkpoint tag phase. Expected: {0} Was: {1}", Phase, previous.Phase));
- if (committedEvent.Data.OriginalPosition < previous.Position)
+ if (committedEvent.Data.EventOrLinkTargetPosition < previous.Position)
throw new InvalidOperationException(
string.Format(
"Cannot make a checkpoint tag at earlier position. '{0}' < '{1}'",
- committedEvent.Data.OriginalPosition, previous.Position));
+ committedEvent.Data.EventOrLinkTargetPosition, previous.Position));
var byIndex = _streams.Contains(committedEvent.Data.PositionStreamId);
return byIndex
? previous.UpdateEventTypeIndexPosition(
- committedEvent.Data.OriginalPosition,
+ committedEvent.Data.EventOrLinkTargetPosition,
_streamToEventType[committedEvent.Data.PositionStreamId],
committedEvent.Data.PositionSequenceNumber)
- : previous.UpdateEventTypeIndexPosition(committedEvent.Data.OriginalPosition);
+ : previous.UpdateEventTypeIndexPosition(committedEvent.Data.EventOrLinkTargetPosition);
}
public override CheckpointTag MakeCheckpointTag(CheckpointTag previous, ReaderSubscriptionMessage.EventReaderPartitionEof partitionEof)
@@ -99,18 +99,18 @@ public override CheckpointTag MakeCheckpointTag(CheckpointTag previous, ReaderSu
throw new ArgumentException(
string.Format("Invalid checkpoint tag phase. Expected: {0} Was: {1}", Phase, previous.Phase));
- if (partitionDeleted.DeleteEventPosition < previous.Position)
+ if (partitionDeleted.DeleteEventOrLinkTargetPosition < previous.Position)
throw new InvalidOperationException(
string.Format(
"Cannot make a checkpoint tag at earlier position. '{0}' < '{1}'",
- partitionDeleted.DeleteEventPosition, previous.Position));
+ partitionDeleted.DeleteEventOrLinkTargetPosition, previous.Position));
var byIndex = _streams.Contains(partitionDeleted.PositionStreamId);
//TODO: handle invalid partition deleted messages without required values
return byIndex
? previous.UpdateEventTypeIndexPosition(
- partitionDeleted.DeleteEventPosition.Value, _streamToEventType[partitionDeleted.PositionStreamId],
+ partitionDeleted.DeleteEventOrLinkTargetPosition.Value, _streamToEventType[partitionDeleted.PositionStreamId],
partitionDeleted.PositionEventNumber.Value)
- : previous.UpdateEventTypeIndexPosition(partitionDeleted.DeleteEventPosition.Value);
+ : previous.UpdateEventTypeIndexPosition(partitionDeleted.DeleteEventOrLinkTargetPosition.Value);
}
public override CheckpointTag MakeZeroCheckpointTag()
View
1  src/EventStore/EventStore.Projections.Core/Services/Processing/EventFilter.cs
@@ -46,6 +46,7 @@ public bool Passes(bool resolvedFromLinkTo, string eventStreamId, string eventNa
&& (_allEvents || _events != null && _events.Contains(eventName));
}
+ public abstract bool DeletedNotificationPasses(string positionStreamId);
public abstract bool PassesSource(bool resolvedFromLinkTo, string positionStreamId, string eventType);
public abstract string GetCategory(string positionStreamId);
}
View
6 src/EventStore/EventStore.Projections.Core/Services/Processing/EventReader.cs
@@ -133,15 +133,15 @@ protected void SendPartitionEof(string partition, CheckpointTag preTagged)
}
protected void SendPartitionDeleted(
- string partition, int? lastEventNumber, TFPos? deletedEventPosition, string positionStreamId,
+ string partition, int? lastEventNumber, TFPos? deletedLinkOrEventPosition, TFPos? deletedEventPosition, string positionStreamId,
int? positionEventNumber, CheckpointTag preTagged = null)
{
if (_disposed)
return;
_publisher.Publish(
new ReaderSubscriptionMessage.EventReaderPartitionDeleted(
- EventReaderCorrelationId, partition, lastEventNumber, deletedEventPosition, positionStreamId,
- positionEventNumber, preTagged));
+ EventReaderCorrelationId, partition, lastEventNumber, deletedLinkOrEventPosition,
+ deletedEventPosition, positionStreamId, positionEventNumber, preTagged));
}
public void SendNotAuthorized()
View
4 ...Store/EventStore.Projections.Core/Services/Processing/ExternallyFedByStreamEventReader.cs
@@ -157,12 +157,12 @@ private void ReadDataStreamCompleted(ClientMessage.ReadStreamEventsForwardComple
case ReadStreamResult.NoStream:
_dataNextSequenceNumber = int.MaxValue;
if (completed.LastEventNumber >= 0)
- SendPartitionDeleted(_dataStreamName, -1, null, null, null);
+ SendPartitionDeleted(_dataStreamName, -1, null, null, null, null);
PauseOrContinueProcessing();
break;
case ReadStreamResult.StreamDeleted:
_dataNextSequenceNumber = int.MaxValue;
- SendPartitionDeleted(_dataStreamName, -1, null, null, null);
+ SendPartitionDeleted(_dataStreamName, -1, null, null, null, null);
PauseOrContinueProcessing();
break;
case ReadStreamResult.Success:
View
10 src/EventStore/EventStore.Projections.Core/Services/Processing/HeadingEventReader.cs
@@ -75,7 +75,7 @@ private class PartitionDeletedItem : Item
public readonly ReaderSubscriptionMessage.EventReaderPartitionDeleted Message;
public PartitionDeletedItem(ReaderSubscriptionMessage.EventReaderPartitionDeleted message)
- : base(message.DeleteEventPosition.Value)
+ : base(message.DeleteLinkOrEventPosition.Value)
{
Message = message;
}
@@ -166,13 +166,13 @@ private void ValidateEventOrder(ReaderSubscriptionMessage.CommittedEventDistribu
private void ValidateEventOrder(ReaderSubscriptionMessage.EventReaderPartitionDeleted message)
{
- if (_lastEventPosition > message.DeleteEventPosition.Value
- || _lastDeletePosition >= message.DeleteEventPosition.Value)
+ if (_lastEventPosition > message.DeleteLinkOrEventPosition.Value
+ || _lastDeletePosition >= message.DeleteLinkOrEventPosition.Value)
throw new InvalidOperationException(
string.Format(
"Invalid partition deleted event order. Last: '{0}' Received: '{1}' LastDelete: '{2}'",
- _lastEventPosition, message.DeleteEventPosition.Value, _lastEventPosition));
- _lastDeletePosition = message.DeleteEventPosition.Value;
+ _lastEventPosition, message.DeleteLinkOrEventPosition.Value, _lastEventPosition));
+ _lastDeletePosition = message.DeleteLinkOrEventPosition.Value;
}
public void Start(Guid eventReaderId, IEventReader eventReader)
View
58 ...EventStore/EventStore.Projections.Core/Services/Processing/IndexedEventTypeEventFilter.cs
@@ -1,58 +0,0 @@
-// Copyright (c) 2012, Event Store LLP
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// Redistributions of source code must retain the above copyright notice,
-// this list of conditions and the following disclaimer.
-// Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-// Neither the name of the Event Store LLP nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-using System;
-using System.Collections.Generic;
-
-namespace EventStore.Projections.Core.Services.Processing
-{
- public class IndexedEventTypeEventFilter : EventFilter
- {
- private readonly string _stream;
-
- public IndexedEventTypeEventFilter(string eventType)
- : base(false, new HashSet<string> { eventType})
- {
- _stream = "$et-" + eventType;
- }
-
- public override bool PassesSource(bool resolvedFromLinkTo, string positionStreamId, string eventType)
- {
- return resolvedFromLinkTo && _stream == positionStreamId;
- }
-
- public override string GetCategory(string positionStreamId)
- {
- return null;
- }
-
- public override string ToString()
- {
- return string.Format("Stream: {0}", _stream);
- }
- }
-}
View
65 ...ventStore/EventStore.Projections.Core/Services/Processing/IndexedEventTypesEventFilter.cs
@@ -1,65 +0,0 @@
-// Copyright (c) 2012, Event Store LLP
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// Redistributions of source code must retain the above copyright notice,
-// this list of conditions and the following disclaimer.
-// Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-// Neither the name of the Event Store LLP nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-
-namespace EventStore.Projections.Core.Services.Processing
-{
- public class IndexedEventTypesEventFilter : EventFilter
- {
- private readonly HashSet<string> _streams;
-
- public IndexedEventTypesEventFilter(string[] eventTypes)
- : base(false, new HashSet<string>(eventTypes))
- {
- _streams = new HashSet<string>(eventTypes.Select(v => "$et-" + v));
- }
-
- public override bool PassesSource(bool resolvedFromLinkTo, string positionStreamId, string eventType)
- {
- return resolvedFromLinkTo && _streams.Contains(positionStreamId);
- }
-
- public override string GetCategory(string positionStreamId)
- {
- return null;
- }
-
- public override string ToString()
- {
- var sb = new StringBuilder();
- foreach (var stream in _streams)
- {
- sb.Append(stream);
- sb.Append("; ");
- }
- return string.Format("Streams: {0}", sb);
- }
- }
-}
View
5 src/EventStore/EventStore.Projections.Core/Services/Processing/MultiStreamEventFilter.cs
@@ -40,6 +40,11 @@ public MultiStreamEventFilter(HashSet<string> streams, bool allEvents, HashSet<s
_streams = streams;
}
+ public override bool DeletedNotificationPasses(string positionStreamId)
+ {
+ return false;
+ }
+
public override bool PassesSource(bool resolvedFromLinkTo, string positionStreamId, string eventType)
{
return _streams.Contains(positionStreamId);
View
2  src/EventStore/EventStore.Projections.Core/Services/Processing/ReaderSubscription.cs
@@ -56,6 +56,8 @@ public void Handle(ReaderSubscriptionMessage.EventReaderIdle message)
public void Handle(ReaderSubscriptionMessage.EventReaderPartitionDeleted message)
{
+ if (!base._eventFilter.DeletedNotificationPasses(message.PositionStreamId))
+ return;
var deletePosition = _positionTagger.MakeCheckpointTag(_positionTracker.LastTag, message);
PublishPartitionDeleted(message.Partition, deletePosition);
}
View
2  src/EventStore/EventStore.Projections.Core/Services/Processing/ReaderSubscriptionBase.cs
@@ -43,7 +43,7 @@ public class ReaderSubscriptionBase
private readonly int? _checkpointProcessedEventsThreshold;
private readonly bool _stopOnEof;
private readonly int? _stopAfterNEvents;
- private readonly EventFilter _eventFilter;
+ protected readonly EventFilter _eventFilter;
protected readonly PositionTagger _positionTagger;
protected readonly PositionTracker _positionTracker;
private long? _lastPassedOrCheckpointedEventPosition;
View
35 src/EventStore/EventStore.Projections.Core/Services/Processing/ResolvedEvent.cs
@@ -46,7 +46,8 @@ public class ResolvedEvent
private readonly string _positionStreamId;
private readonly int _positionSequenceNumber;
private readonly TFPos _position;
- private readonly TFPos _originalPosition;
+ private readonly TFPos _eventOrLinkTargetPosition;
+ private readonly TFPos _linkOrEventPosition;
public readonly Guid EventId;
@@ -64,6 +65,7 @@ public class ResolvedEvent
public ResolvedEvent(EventStore.Core.Data.ResolvedEvent resolvedEvent, byte[] streamMetadata)
{
var positionEvent = resolvedEvent.Link ?? resolvedEvent.Event;
+ _linkOrEventPosition = resolvedEvent.OriginalPosition.GetValueOrDefault();
var @event = resolvedEvent.Event;
_positionStreamId = positionEvent.EventStreamId;
_positionSequenceNumber = positionEvent.EventNumber;
@@ -84,7 +86,7 @@ public ResolvedEvent(EventStore.Core.Data.ResolvedEvent resolvedEvent, byte[] st
: null;
StreamMetadata = streamMetadata != null ? Helper.UTF8NoBom.GetString(streamMetadata) : null;
- TFPos originalPosition;
+ TFPos eventOrLinkTargetPosition;
if (_resolvedLinkTo)
{
Dictionary<string, JToken> extraMetadata = null;
@@ -104,15 +106,16 @@ public ResolvedEvent(EventStore.Core.Data.ResolvedEvent resolvedEvent, byte[] st
tag = positionEvent.Metadata.ParseCheckpointTagJson();
}
var parsedPosition = tag.Position;
- originalPosition = parsedPosition != new TFPos(long.MinValue, long.MinValue)
- ? parsedPosition
- : new TFPos(-1, resolvedEvent.OriginalEvent.LogPosition);
+ eventOrLinkTargetPosition = parsedPosition != new TFPos(long.MinValue, long.MinValue)
+ ? parsedPosition
+ : new TFPos(-1, resolvedEvent.Event.LogPosition);
}
else
- originalPosition = new TFPos(-1, resolvedEvent.OriginalEvent.LogPosition);
+ eventOrLinkTargetPosition = new TFPos(-1, resolvedEvent.Event.LogPosition);
JToken deletedValue;
- IsLinkToDeletedStreamTombstone = extraMetadata != null && extraMetadata.TryGetValue("$deleted", out deletedValue);
+ IsLinkToDeletedStreamTombstone = extraMetadata != null
+ && extraMetadata.TryGetValue("$deleted", out deletedValue);
if (resolvedEvent.ResolveResult == ReadEventResult.NoStream
|| resolvedEvent.ResolveResult == ReadEventResult.StreamDeleted || IsLinkToDeletedStreamTombstone)
{
@@ -124,16 +127,17 @@ public ResolvedEvent(EventStore.Core.Data.ResolvedEvent resolvedEvent, byte[] st
}
else
{
- originalPosition = resolvedEvent.OriginalPosition ?? new TFPos(-1, positionEvent.LogPosition);
+ // not a link
+ eventOrLinkTargetPosition = resolvedEvent.OriginalPosition ?? new TFPos(-1, positionEvent.LogPosition);
}
- _originalPosition = originalPosition;
+ _eventOrLinkTargetPosition = eventOrLinkTargetPosition;
}
public ResolvedEvent(
string positionStreamId, int positionSequenceNumber, string eventStreamId, int eventSequenceNumber,
- bool resolvedLinkTo, TFPos position, TFPos originalPosition, Guid eventId, string eventType, bool isJson, byte[] data,
+ bool resolvedLinkTo, TFPos position, TFPos eventOrLinkTargetPosition, Guid eventId, string eventType, bool isJson, byte[] data,
byte[] metadata, byte[] positionMetadata, byte[] streamMetadata, DateTime timestamp)
{
@@ -143,7 +147,7 @@ public ResolvedEvent(EventStore.Core.Data.ResolvedEvent resolvedEvent, byte[] st
_eventSequenceNumber = eventSequenceNumber;
_resolvedLinkTo = resolvedLinkTo;
_position = position;
- _originalPosition = originalPosition;
+ _eventOrLinkTargetPosition = eventOrLinkTargetPosition;
EventId = eventId;
EventType = eventType;
IsJson = isJson;
@@ -215,9 +219,14 @@ public TFPos Position
get { return _position; }
}
- public TFPos OriginalPosition
+ public TFPos EventOrLinkTargetPosition
{
- get { return _originalPosition; }
+ get { return _eventOrLinkTargetPosition; }
+ }
+
+ public TFPos LinkOrEventPosition
+ {
+ get { return _linkOrEventPosition; }
}
}
}
View
5 src/EventStore/EventStore.Projections.Core/Services/Processing/StreamEventFilter.cs
@@ -40,6 +40,11 @@ public StreamEventFilter(string streamId, bool allEvents, HashSet<string> events
_streamId = streamId;
}
+ public override bool DeletedNotificationPasses(string positionStreamId)
+ {
+ return positionStreamId == _streamId;
+ }
+
public override bool PassesSource(bool resolvedFromLinkTo, string positionStreamId, string eventType)
{
return positionStreamId == _streamId;
View
24 src/EventStore/EventStore.Projections.Core/Services/Processing/StreamEventReader.cs
@@ -95,7 +95,7 @@ public void Handle(ClientMessage.ReadStreamEventsForwardCompleted message)
DeliverSafeJoinPosition(GetLastCommitPositionFrom(message)); // allow joining heading distribution
PauseOrContinueProcessing();
SendIdle();
- SendPartitionDeleted(_streamName, -1, null, null, null);
+ SendPartitionDeleted(_streamName, -1, null, null, null, null);
SendEof();
break;
case ReadStreamResult.NoStream:
@@ -104,7 +104,7 @@ public void Handle(ClientMessage.ReadStreamEventsForwardCompleted message)
PauseOrContinueProcessing();
SendIdle();
if (message.LastEventNumber >= 0)
- SendPartitionDeleted(_streamName, message.LastEventNumber, null, null, null);
+ SendPartitionDeleted(_streamName, message.LastEventNumber, null, null, null, null);
SendEof();
break;
case ReadStreamResult.Success:
@@ -214,33 +214,23 @@ private void DeliverEvent(EventStore.Core.Data.ResolvedEvent pair, float progres
sequenceNumber = positionEvent.EventNumber + 1;
var resolvedEvent = new ResolvedEvent(pair, null);
- string partitionStreamId;
+ string deletedPartitionStreamId;
- bool isDeletedStreamEvent;
if (resolvedEvent.IsLinkToDeletedStream && !resolvedEvent.IsLinkToDeletedStreamTombstone)
return;
- if (resolvedEvent.IsLinkToDeletedStreamTombstone)
- {
- isDeletedStreamEvent = true;
- partitionStreamId = resolvedEvent.EventStreamId;
- }
- else
- {
- isDeletedStreamEvent = StreamDeletedHelper.IsStreamDeletedEvent(
- resolvedEvent.EventStreamId, resolvedEvent.EventType, resolvedEvent.Data, out partitionStreamId);
- }
+ bool isDeletedStreamEvent = StreamDeletedHelper.IsStreamDeletedEvent(resolvedEvent, out deletedPartitionStreamId);
if (isDeletedStreamEvent)
{
- var deletedPartition = partitionStreamId;
+ var deletedPartition = deletedPartitionStreamId;
if (_produceStreamDeletes)
_publisher.Publish(
//TODO: publish both link and event data
new ReaderSubscriptionMessage.EventReaderPartitionDeleted(
- EventReaderCorrelationId, deletedPartition, source: this.GetType(),
- lastEventNumber: -1, deleteEventPosition: null,
+ EventReaderCorrelationId, deletedPartition, source: this.GetType(), lastEventNumber: -1,
+ deleteEventOrLinkTargetPosition: null, deleteLinkOrEventPosition: resolvedEvent.EventOrLinkTargetPosition,
positionStreamId: resolvedEvent.PositionStreamId,
positionEventNumber: resolvedEvent.PositionSequenceNumber));
}
View
5 src/EventStore/EventStore.Projections.Core/Services/Processing/TransactionFileEventFilter.cs
@@ -40,6 +40,11 @@ public TransactionFileEventFilter(bool allEvents, HashSet<string> events, bool i
_includeLinks = includeLinks;
}
+ public override bool DeletedNotificationPasses(string positionStreamId)
+ {
+ return true;
+ }
+
public override bool PassesSource(bool resolvedFromLinkTo, string positionStreamId, string eventType)
{
return _includeLinks || !resolvedFromLinkTo;
View
20 src/EventStore/EventStore.Projections.Core/Services/Processing/TransactionFileEventReader.cs
@@ -194,15 +194,19 @@ private void DeliverLastCommitPosition(TFPos lastPosition)
_stopOnEof ? (long?) null : receivedPosition.PreparePosition,
100.0f*positionEvent.LogPosition/lastCommitPosition, source: this.GetType()));
- string positionStreamId;
- var isStreamDeletedEvent = StreamDeletedHelper.IsStreamDeletedEvent(
- resolvedEvent.PositionStreamId, resolvedEvent.EventType, resolvedEvent.Data, out positionStreamId);
- if (isStreamDeletedEvent)
- _publisher.Publish(
+ string deletedPartitionStreamId;
+ if (resolvedEvent.IsLinkToDeletedStream && !resolvedEvent.IsLinkToDeletedStreamTombstone)
+ return;
+
+ bool isDeletedStreamEvent = StreamDeletedHelper.IsStreamDeletedEvent(
+ resolvedEvent, out deletedPartitionStreamId);
+ if (isDeletedStreamEvent)
+ _publisher.Publish(
new ReaderSubscriptionMessage.EventReaderPartitionDeleted(
- EventReaderCorrelationId, positionStreamId, source: this.GetType(), lastEventNumber: -1,
- deleteEventPosition: resolvedEvent.OriginalPosition, positionStreamId: null,
- positionEventNumber: null));
+ EventReaderCorrelationId, deletedPartitionStreamId, source: this.GetType(), lastEventNumber: -1,
+ deleteEventOrLinkTargetPosition: resolvedEvent.EventOrLinkTargetPosition,
+ deleteLinkOrEventPosition: resolvedEvent.LinkOrEventPosition,
+ positionStreamId: positionEvent.EventStreamId, positionEventNumber: positionEvent.EventNumber));
}
}
}
View
6 ...entStore/EventStore.Projections.Core/Services/Processing/TransactionFilePositionTagger.cs
@@ -103,10 +103,10 @@ public override CheckpointTag MakeCheckpointTag(CheckpointTag previous, ReaderSu
throw new ArgumentException(
string.Format("Invalid checkpoint tag phase. Expected: {0} Was: {1}", Phase, previous.Phase));
- if (partitionDeleted.DeleteEventPosition == null)
- throw new ArgumentException("Invalid partiton deleted message. DeleteEventPosition required");
+ if (partitionDeleted.DeleteLinkOrEventPosition == null)
+ throw new ArgumentException("Invalid partiton deleted message. deleteEventOrLinkTargetPosition required");
- return CheckpointTag.FromPosition(previous.Phase, partitionDeleted.DeleteEventPosition.Value);
+ return CheckpointTag.FromPosition(previous.Phase, partitionDeleted.DeleteLinkOrEventPosition.Value);
}
public override CheckpointTag MakeZeroCheckpointTag()
View
32 src/EventStore/EventStore.Projections.Core/Standard/StreamDeletedHelper.cs
@@ -1,29 +1,47 @@
using EventStore.Core.Data;
using EventStore.Core.Services;
using EventStore.Projections.Core.Utils;
+using ResolvedEvent = EventStore.Projections.Core.Services.Processing.ResolvedEvent;
namespace EventStore.Projections.Core.Standard
{
public static class StreamDeletedHelper
{
+ public static bool IsStreamDeletedEvent(ResolvedEvent resolvedEvent, out string deletedPartitionStreamId)
+ {
+ bool isDeletedStreamEvent;
+ if (resolvedEvent.IsLinkToDeletedStreamTombstone)
+ {
+ isDeletedStreamEvent = true;
+ deletedPartitionStreamId = resolvedEvent.EventStreamId;
+ }
+ else
+ {
+ isDeletedStreamEvent = StreamDeletedHelper.IsStreamDeletedEvent(
+ resolvedEvent.EventStreamId, resolvedEvent.EventType, resolvedEvent.Data,
+ out deletedPartitionStreamId);
+ }
+ return isDeletedStreamEvent;
+ }
+
public static bool IsStreamDeletedEvent(
- string streamOrMetaStreamId, string eventType, string eventData, out string streamId)
+ string streamOrMetaStreamId, string eventType, string eventData, out string deletedPartitionStreamId)
{
if (string.IsNullOrEmpty(streamOrMetaStreamId))
{
- streamId = null;
+ deletedPartitionStreamId = null;
return false;
}
bool isMetaStream;
if (SystemStreams.IsMetastream(streamOrMetaStreamId))
{
isMetaStream = true;
- streamId = streamOrMetaStreamId.Substring("$$".Length);
+ deletedPartitionStreamId = streamOrMetaStreamId.Substring("$$".Length);
}
else
{
isMetaStream = false;
- streamId = streamOrMetaStreamId;
+ deletedPartitionStreamId = streamOrMetaStreamId;
}
var isStreamDeletedEvent = false;
if (isMetaStream)
@@ -46,18 +64,18 @@ public static class StreamDeletedHelper
}
public static bool IsStreamDeletedEvent(
- string streamOrMetaStreamId, string eventType, byte[] eventData, out string streamId)
+ string streamOrMetaStreamId, string eventType, byte[] eventData, out string deletedPartitionStreamId)
{
bool isMetaStream;
if (SystemStreams.IsMetastream(streamOrMetaStreamId))
{
isMetaStream = true;
- streamId = streamOrMetaStreamId.Substring("$$".Length);
+ deletedPartitionStreamId = streamOrMetaStreamId.Substring("$$".Length);
}
else
{
isMetaStream = false;
- streamId = streamOrMetaStreamId;
+ deletedPartitionStreamId = streamOrMetaStreamId;
}
var isStreamDeletedEvent = false;
if (isMetaStream)
Please sign in to comment.
Something went wrong with that request. Please try again.