diff --git a/.gitignore b/.gitignore index 809f06a76..ed8c08844 100644 --- a/.gitignore +++ b/.gitignore @@ -58,3 +58,5 @@ $tf/pendingchanges.tfb $tf/properties.tf1 project.lock.json **/.vs/ + +.claude/ \ No newline at end of file diff --git a/Sources/.editorconfig b/Sources/.editorconfig index 1bae2e959..d1110ea7e 100644 --- a/Sources/.editorconfig +++ b/Sources/.editorconfig @@ -50,4 +50,4 @@ csharp_new_line_before_catch = true csharp_new_line_before_finally = true csharp_indent_case_contents = true csharp_indent_switch_labels = true -csharp_preserve_single_line_statements = false \ No newline at end of file +csharp_preserve_single_line_statements = false diff --git a/Sources/Core/Directory.Build.props b/Sources/Core/Directory.Build.props index 15f391280..fa8e33c0e 100644 --- a/Sources/Core/Directory.Build.props +++ b/Sources/Core/Directory.Build.props @@ -3,15 +3,5 @@ - - - all - runtime; build; native; contentfiles; analyzers - - - - - $(EnlistmentRoot)\Sources\Microsoft.StreamProcessing.ruleset - diff --git a/Sources/Core/Microsoft.StreamProcessing.Provider/Microsoft.StreamProcessing.Provider.csproj b/Sources/Core/Microsoft.StreamProcessing.Provider/Microsoft.StreamProcessing.Provider.csproj index 1d9de4e69..00948d43b 100644 --- a/Sources/Core/Microsoft.StreamProcessing.Provider/Microsoft.StreamProcessing.Provider.csproj +++ b/Sources/Core/Microsoft.StreamProcessing.Provider/Microsoft.StreamProcessing.Provider.csproj @@ -1,7 +1,7 @@  - netstandard2.0 + net10.0 x64;AnyCPU @@ -11,19 +11,7 @@ - - - - - - - - - - - - - + diff --git a/Sources/Core/Microsoft.StreamProcessing/Aggregates/CountAggregate.cs b/Sources/Core/Microsoft.StreamProcessing/Aggregates/CountAggregate.cs index db3e0ab86..d4ab16d42 100644 --- a/Sources/Core/Microsoft.StreamProcessing/Aggregates/CountAggregate.cs +++ b/Sources/Core/Microsoft.StreamProcessing/Aggregates/CountAggregate.cs @@ -21,7 +21,7 @@ internal sealed class CountAggregate : ISummableAggregate> diff = (leftCount, rightCount) => leftCount - rightCount; public Expression> Difference() => diff; - private static readonly Expression> sum = (leftCount, rightCount) => leftCount - rightCount; + private static readonly Expression> sum = (leftCount, rightCount) => leftCount + rightCount; public Expression> Sum() => sum; private static readonly Expression> res = count => count; diff --git a/Sources/Core/Microsoft.StreamProcessing/Collections/MultiSet.cs b/Sources/Core/Microsoft.StreamProcessing/Collections/MultiSet.cs index 150de6cdb..78bcd584f 100644 --- a/Sources/Core/Microsoft.StreamProcessing/Collections/MultiSet.cs +++ b/Sources/Core/Microsoft.StreamProcessing/Collections/MultiSet.cs @@ -20,7 +20,7 @@ public sealed class MultiSet { [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "Used to avoid creating redundant readonly property.")] [DataMember] - private Dictionary Elements = new Dictionary(); + private Dictionary Elements = []; [DataMember] private long count; diff --git a/Sources/Core/Microsoft.StreamProcessing/Collections/PriorityQueue.cs b/Sources/Core/Microsoft.StreamProcessing/Collections/PriorityQueue.cs index e1473d70c..26249d19d 100644 --- a/Sources/Core/Microsoft.StreamProcessing/Collections/PriorityQueue.cs +++ b/Sources/Core/Microsoft.StreamProcessing/Collections/PriorityQueue.cs @@ -18,7 +18,7 @@ namespace Microsoft.StreamProcessing public class PriorityQueue : IEnumerable { [DataMember] - private List data = new List(); + private List data = []; private readonly IComparer comp; diff --git a/Sources/Core/Microsoft.StreamProcessing/Collections/SafeConcurrentDictionary.cs b/Sources/Core/Microsoft.StreamProcessing/Collections/SafeConcurrentDictionary.cs index 9b04f7206..153890de3 100644 --- a/Sources/Core/Microsoft.StreamProcessing/Collections/SafeConcurrentDictionary.cs +++ b/Sources/Core/Microsoft.StreamProcessing/Collections/SafeConcurrentDictionary.cs @@ -44,6 +44,18 @@ public TValue GetOrAdd(CacheKey key, Func valueFactory) [MethodImpl(MethodImplOptions.AggressiveInlining)] public IEnumerator> GetEnumerator() => this.dictionary.GetEnumerator(); + /// + /// Clears all entries from the dictionary and the per-key lock table. + /// Marked internal (not private) so that test code can clear the codegen cache + /// (e.g. EquiJoinStreamable.cachedPipes) to ensure deterministic test behavior + /// without relying on reflection. + /// + internal void Clear() + { + this.dictionary.Clear(); + this.keyLocks.Clear(); + } + IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); /// diff --git a/Sources/Core/Microsoft.StreamProcessing/Collections/SortedMultiSet.cs b/Sources/Core/Microsoft.StreamProcessing/Collections/SortedMultiSet.cs index 84ff1aeaf..f187d7fd2 100644 --- a/Sources/Core/Microsoft.StreamProcessing/Collections/SortedMultiSet.cs +++ b/Sources/Core/Microsoft.StreamProcessing/Collections/SortedMultiSet.cs @@ -47,7 +47,7 @@ private static Func, IEnumerable /// Creates a new instance of a Sorted Multiset. /// [EditorBrowsable(EditorBrowsableState.Never)] - public SortedMultiSet() : this(() => new SortedDictionary()) { } + public SortedMultiSet() : this(() => []) { } /// /// Creates a new instance of a Sorted Multiset where the underlying dictionary is generated. diff --git a/Sources/Core/Microsoft.StreamProcessing/Egress/Atemporal/AtemporalEgressPipe.cs b/Sources/Core/Microsoft.StreamProcessing/Egress/Atemporal/AtemporalEgressPipe.cs index 4540cae25..1f1254e9e 100644 --- a/Sources/Core/Microsoft.StreamProcessing/Egress/Atemporal/AtemporalEgressPipe.cs +++ b/Sources/Core/Microsoft.StreamProcessing/Egress/Atemporal/AtemporalEgressPipe.cs @@ -14,7 +14,7 @@ namespace Microsoft.StreamProcessing internal sealed class MonotonicEgressPipe : EgressBoundary { [DataMember] - private SortedDictionary> toDelete = new SortedDictionary>(); + private SortedDictionary> toDelete = []; [Obsolete("Used only by serialization. Do not call directly.")] public MonotonicEgressPipe() { } @@ -76,7 +76,7 @@ private void EnqueueDelete(long currentTime, TPayload payload) { if (!this.toDelete.TryGetValue(currentTime, out List queue)) { - queue = new List(); + queue = []; this.toDelete.Add(currentTime, queue); } queue.Add(payload); diff --git a/Sources/Core/Microsoft.StreamProcessing/Egress/AtemporalArray/AtemporalArrayEgressPipe.cs b/Sources/Core/Microsoft.StreamProcessing/Egress/AtemporalArray/AtemporalArrayEgressPipe.cs index 76c7c3a96..540881456 100644 --- a/Sources/Core/Microsoft.StreamProcessing/Egress/AtemporalArray/AtemporalArrayEgressPipe.cs +++ b/Sources/Core/Microsoft.StreamProcessing/Egress/AtemporalArray/AtemporalArrayEgressPipe.cs @@ -14,7 +14,7 @@ namespace Microsoft.StreamProcessing internal sealed class MonotonicArrayEgressPipe : EgressBoundary> { [DataMember] - private SortedDictionary> toDelete = new SortedDictionary>(); + private SortedDictionary> toDelete = []; private readonly Func generator; [DataMember] @@ -105,7 +105,7 @@ private void EnqueueDelete(long currentTime, TPayload payload) { if (!this.toDelete.TryGetValue(currentTime, out List queue)) { - queue = new List(); + queue = []; this.toDelete.Add(currentTime, queue); } queue.Add(payload); diff --git a/Sources/Core/Microsoft.StreamProcessing/Egress/AtemporalEnumerable/AtemporalEnumerableEgressPipe.cs b/Sources/Core/Microsoft.StreamProcessing/Egress/AtemporalEnumerable/AtemporalEnumerableEgressPipe.cs index be9cb4878..0c6aa082f 100644 --- a/Sources/Core/Microsoft.StreamProcessing/Egress/AtemporalEnumerable/AtemporalEnumerableEgressPipe.cs +++ b/Sources/Core/Microsoft.StreamProcessing/Egress/AtemporalEnumerable/AtemporalEnumerableEgressPipe.cs @@ -16,9 +16,9 @@ internal sealed class AtemporalEnumerableEgressPipe : EgressBoundary> toDelete = new SortedDictionary>(); + private SortedDictionary> toDelete = []; [DataMember] - private List> currentVersion = new List>(); + private List> currentVersion = []; [Obsolete("Used only by serialization. Do not call directly.")] public AtemporalEnumerableEgressPipe() { } @@ -86,7 +86,7 @@ private void Process(long timestamp) if (this.currentVersion.Count > 0) { this.observer.OnNext(this.currentVersion); - this.currentVersion = new List>(); + this.currentVersion = []; } } } @@ -95,7 +95,7 @@ private void EnqueueDelete(long currentTime, TPayload payload) { if (!this.toDelete.TryGetValue(currentTime, out List queue)) { - queue = new List(); + queue = []; this.toDelete.Add(currentTime, queue); } queue.Add(payload); diff --git a/Sources/Core/Microsoft.StreamProcessing/Fusible/FuseModule.cs b/Sources/Core/Microsoft.StreamProcessing/Fusible/FuseModule.cs index 34b45a8a4..f17785374 100644 --- a/Sources/Core/Microsoft.StreamProcessing/Fusible/FuseModule.cs +++ b/Sources/Core/Microsoft.StreamProcessing/Fusible/FuseModule.cs @@ -19,7 +19,7 @@ internal static class PlaceholderMethod internal sealed class FuseModule { - private readonly List expressions = new List(); + private readonly List expressions = []; private Expression durationAdjustment = null; public FuseModule() { } diff --git a/Sources/Core/Microsoft.StreamProcessing/Ingress/Binary/StreamableSerializer.cs b/Sources/Core/Microsoft.StreamProcessing/Ingress/Binary/StreamableSerializer.cs index 1a272a0a6..cf0e22a3f 100644 --- a/Sources/Core/Microsoft.StreamProcessing/Ingress/Binary/StreamableSerializer.cs +++ b/Sources/Core/Microsoft.StreamProcessing/Ingress/Binary/StreamableSerializer.cs @@ -32,8 +32,8 @@ public StreamProperties ToStreamProperties() EqualityComparerExpression.Default, EqualityComparerExpression.Default, null, null, - new Dictionary(), - new Dictionary(), + [], + [], null); public bool IsColumnar; diff --git a/Sources/Core/Microsoft.StreamProcessing/Ingress/DiagnosticObservable.cs b/Sources/Core/Microsoft.StreamProcessing/Ingress/DiagnosticObservable.cs index c5fb8f4c3..8a76755e1 100644 --- a/Sources/Core/Microsoft.StreamProcessing/Ingress/DiagnosticObservable.cs +++ b/Sources/Core/Microsoft.StreamProcessing/Ingress/DiagnosticObservable.cs @@ -10,7 +10,7 @@ namespace Microsoft.StreamProcessing { internal sealed class DiagnosticObservable : IObservable>, IObserver>, IDisposable { - private List>> observers = new List>>(); + private List>> observers = []; public IDisposable Subscribe(IObserver> observer) { @@ -83,7 +83,7 @@ public static OutOfOrderStreamEvent Create(StreamEvent : IObservable>, IObserver>, IDisposable { - private List>> observers = new List>>(); + private List>> observers = []; public IDisposable Subscribe(IObserver> observer) { diff --git a/Sources/Core/Microsoft.StreamProcessing/Ingress/ImpatienceSorter.cs b/Sources/Core/Microsoft.StreamProcessing/Ingress/ImpatienceSorter.cs index d260f3fe8..df7fab8d9 100644 --- a/Sources/Core/Microsoft.StreamProcessing/Ingress/ImpatienceSorter.cs +++ b/Sources/Core/Microsoft.StreamProcessing/Ingress/ImpatienceSorter.cs @@ -35,7 +35,7 @@ public sealed class ImpatienceSorter : IDisposable private DataStructurePool>> ecbPool; private List>> toReturn = - new List>>(); + []; /// /// Currently for internal use only - do not use directly. @@ -44,7 +44,7 @@ public sealed class ImpatienceSorter : IDisposable public ImpatienceSorter() { this.Tails = new long[this.MaxFibers]; - this.Fibers = new List>>(); + this.Fibers = []; this.MergeSource = new PooledElasticCircularBuffer>[this.MaxFibers]; this.NextAffectingSyncTime = StreamEvent.InfinitySyncTime; this.ecbPool = new DataStructurePool>>(); @@ -442,7 +442,7 @@ private sealed class ImpatienceSorter : IDisposable private DataStructurePool>> ecbPool; private List>> toReturn = - new List>>(); + []; /// /// Currently for internal use only - do not use directly. @@ -451,7 +451,7 @@ private sealed class ImpatienceSorter : IDisposable public ImpatienceSorter() { this.Tails = new long[this.MaxFibers]; - this.Fibers = new List>>(); + this.Fibers = []; this.MergeSource = new PooledElasticCircularBuffer>[this.MaxFibers]; this.NextAffectingSyncTime = StreamEvent.InfinitySyncTime; this.ecbPool = new DataStructurePool>>(); diff --git a/Sources/Core/Microsoft.StreamProcessing/Ingress/SubscriptionBase.cs b/Sources/Core/Microsoft.StreamProcessing/Ingress/SubscriptionBase.cs index bb48d50f5..946aa8b66 100644 --- a/Sources/Core/Microsoft.StreamProcessing/Ingress/SubscriptionBase.cs +++ b/Sources/Core/Microsoft.StreamProcessing/Ingress/SubscriptionBase.cs @@ -1130,8 +1130,6 @@ protected DisorderedPartitionedObserverSubscriptionBase( /// /// [EditorBrowsable(EditorBrowsableState.Never)] - [System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.SpacingRules", "SA1008:OpeningParenthesisMustBeSpacedCorrectly", Justification = "ValueTuples")] - [System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.SpacingRules", "SA1009:ClosingParenthesisMustBeSpacedCorrectly", Justification = "ValueTuples")] public abstract class DisorderedPartitionedSubscriptionBase : Pipe, TResult>, IIngressStreamObserver { private readonly string errorMessages; @@ -1212,7 +1210,7 @@ public abstract class DisorderedPartitionedSubscriptionBase [EditorBrowsable(EditorBrowsableState.Never)] [DataMember] - protected Dictionary currentTime = new Dictionary(); + protected Dictionary currentTime = []; #if DEBUG /// @@ -1221,7 +1219,7 @@ public abstract class DisorderedPartitionedSubscriptionBase [EditorBrowsable(EditorBrowsableState.Never)] [DataMember] - protected Dictionary lastEventTime = new Dictionary(); + protected Dictionary lastEventTime = []; #endif /// @@ -1235,7 +1233,7 @@ public abstract class DisorderedPartitionedSubscriptionBase [DataMember] - protected Dictionary lastPunctuationTime = new Dictionary(); + protected Dictionary lastPunctuationTime = []; /// /// Currently for internal use only - do not use directly. @@ -1251,7 +1249,7 @@ public abstract class DisorderedPartitionedSubscriptionBase [EditorBrowsable(EditorBrowsableState.Never)] [DataMember] - protected Dictionary partitionHighWatermarks = new Dictionary(); + protected Dictionary partitionHighWatermarks = []; /// /// Currently for internal use only - do not use directly. @@ -1260,7 +1258,7 @@ public abstract class DisorderedPartitionedSubscriptionBase [EditorBrowsable(EditorBrowsableState.Never)] - protected SortedDictionary> highWatermarkToPartitionsMap = new SortedDictionary>(); + protected SortedDictionary> highWatermarkToPartitionsMap = []; /// /// Currently for internal use only - do not use directly. @@ -1751,8 +1749,6 @@ protected PartitionedObserverSubscriptionBase( /// /// [EditorBrowsable(EditorBrowsableState.Never)] - [System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.SpacingRules", "SA1008:OpeningParenthesisMustBeSpacedCorrectly", Justification = "ValueTuples")] - [System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.SpacingRules", "SA1009:ClosingParenthesisMustBeSpacedCorrectly", Justification = "ValueTuples")] public abstract class PartitionedSubscriptionBase : Pipe, TResult>, IIngressStreamObserver { private readonly string errorMessages; @@ -1833,7 +1829,7 @@ public abstract class PartitionedSubscriptionBase [EditorBrowsable(EditorBrowsableState.Never)] [DataMember] - protected Dictionary currentTime = new Dictionary(); + protected Dictionary currentTime = []; #if DEBUG /// @@ -1842,7 +1838,7 @@ public abstract class PartitionedSubscriptionBase [EditorBrowsable(EditorBrowsableState.Never)] [DataMember] - protected Dictionary lastEventTime = new Dictionary(); + protected Dictionary lastEventTime = []; #endif /// @@ -1856,7 +1852,7 @@ public abstract class PartitionedSubscriptionBase [DataMember] - protected Dictionary lastPunctuationTime = new Dictionary(); + protected Dictionary lastPunctuationTime = []; /// /// Currently for internal use only - do not use directly. @@ -1872,7 +1868,7 @@ public abstract class PartitionedSubscriptionBase [EditorBrowsable(EditorBrowsableState.Never)] [DataMember] - protected Dictionary partitionHighWatermarks = new Dictionary(); + protected Dictionary partitionHighWatermarks = []; /// /// Currently for internal use only - do not use directly. @@ -1881,7 +1877,7 @@ public abstract class PartitionedSubscriptionBase [EditorBrowsable(EditorBrowsableState.Never)] - protected SortedDictionary> highWatermarkToPartitionsMap = new SortedDictionary>(); + protected SortedDictionary> highWatermarkToPartitionsMap = []; /// /// Currently for internal use only - do not use directly. diff --git a/Sources/Core/Microsoft.StreamProcessing/Ingress/SubscriptionBase.tt b/Sources/Core/Microsoft.StreamProcessing/Ingress/SubscriptionBase.tt index 24a48ff78..9093db423 100644 --- a/Sources/Core/Microsoft.StreamProcessing/Ingress/SubscriptionBase.tt +++ b/Sources/Core/Microsoft.StreamProcessing/Ingress/SubscriptionBase.tt @@ -135,10 +135,6 @@ foreach (bool disordered in new[] { true, false }) /// /// [EditorBrowsable(EditorBrowsableState.Never)] -<# if (partitioned) { #> - [System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.SpacingRules", "SA1008:OpeningParenthesisMustBeSpacedCorrectly", Justification = "ValueTuples")] - [System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.SpacingRules", "SA1009:ClosingParenthesisMustBeSpacedCorrectly", Justification = "ValueTuples")] -<# } #> public abstract class <#= disordered ? "Disordered" : string.Empty #><#= partitionString #>SubscriptionBase<<#= genericArgument #>TIngressStructure, TPayload, TResult> : Pipe<<#= baseType #>, TResult>, IIngressStreamObserver { private readonly string errorMessages; diff --git a/Sources/Core/Microsoft.StreamProcessing/Ingress/Temporal/TemporalIngressSubscription.cs b/Sources/Core/Microsoft.StreamProcessing/Ingress/Temporal/TemporalIngressSubscription.cs index 3673529e5..a36e05838 100644 --- a/Sources/Core/Microsoft.StreamProcessing/Ingress/Temporal/TemporalIngressSubscription.cs +++ b/Sources/Core/Microsoft.StreamProcessing/Ingress/Temporal/TemporalIngressSubscription.cs @@ -380,7 +380,7 @@ private void Process(ref StreamEvent value) key = Tuple.Create(value.SyncTime, value.Payload); if (!this.startEventInformation.TryGetValue(key, out q)) { - q = new ElasticCircularBuffer(); + q = []; this.startEventInformation.Add(key, q); var x = new AdjustInfo(current); q.Enqueue(ref x); @@ -763,7 +763,7 @@ private void Process(ref StreamEvent value) key = Tuple.Create(value.SyncTime, value.Payload); if (!this.startEventInformation.TryGetValue(key, out q)) { - q = new ElasticCircularBuffer(); + q = []; this.startEventInformation.Add(key, q); var x = new AdjustInfo(current); q.Enqueue(ref x); @@ -1144,7 +1144,7 @@ private void Process(ref StreamEvent value) key = Tuple.Create(value.SyncTime, value.Payload); if (!this.startEventInformation.TryGetValue(key, out q)) { - q = new ElasticCircularBuffer(); + q = []; this.startEventInformation.Add(key, q); var x = new AdjustInfo(current); q.Enqueue(ref x); @@ -1435,7 +1435,7 @@ public override void OnNext(StreamEvent value) key = Tuple.Create(value.SyncTime, value.Payload); if (!this.startEventInformation.TryGetValue(key, out q)) { - q = new ElasticCircularBuffer(); + q = []; this.startEventInformation.Add(key, q); var x = new AdjustInfo(current); q.Enqueue(ref x); @@ -1715,7 +1715,7 @@ public override void OnNext(StreamEvent value) key = Tuple.Create(value.SyncTime, value.Payload); if (!this.startEventInformation.TryGetValue(key, out q)) { - q = new ElasticCircularBuffer(); + q = []; this.startEventInformation.Add(key, q); var x = new AdjustInfo(current); q.Enqueue(ref x); @@ -1993,7 +1993,7 @@ private void Action(long start, long end, TResult payload, Empty actionKey) key = Tuple.Create(value.SyncTime, value.Payload); if (!this.startEventInformation.TryGetValue(key, out q)) { - q = new ElasticCircularBuffer(); + q = []; this.startEventInformation.Add(key, q); var x = new AdjustInfo(current); q.Enqueue(ref x); @@ -3722,7 +3722,7 @@ public override void OnNext(PartitionedStreamEvent value) this.partitionHighWatermarks.Add(value.PartitionKey, this.lowWatermark.rawValue); if (this.highWatermarkToPartitionsMap.TryGetValue(this.lowWatermark.rawValue, out HashSet keySet)) keySet.Add(value.PartitionKey); - else this.highWatermarkToPartitionsMap.Add(this.lowWatermark.rawValue, new HashSet { value.PartitionKey }); + else this.highWatermarkToPartitionsMap.Add(this.lowWatermark.rawValue, [value.PartitionKey]); } long moveTo = moveFrom; @@ -3743,7 +3743,7 @@ public override void OnNext(PartitionedStreamEvent value) else oldSet.Remove(value.PartitionKey); if (this.highWatermarkToPartitionsMap.TryGetValue(value.SyncTime, out HashSet set)) set.Add(value.PartitionKey); - else this.highWatermarkToPartitionsMap.Add(value.SyncTime, new HashSet { value.PartitionKey }); + else this.highWatermarkToPartitionsMap.Add(value.SyncTime, [value.PartitionKey]); if (value.IsData) { @@ -3864,7 +3864,7 @@ private void Process(ref PartitionedStreamEvent value) key = Tuple.Create(value.SyncTime, value.Payload); if (!this.startEventInformation.TryGetValue(key, out q)) { - q = new ElasticCircularBuffer(); + q = []; this.startEventInformation.Add(key, q); var x = new AdjustInfo(current); q.Enqueue(ref x); @@ -4114,7 +4114,7 @@ protected override void UpdatePointers() if (this.highWatermarkToPartitionsMap.TryGetValue(kvp.Value, out HashSet set)) set.Add(kvp.Key); else - this.highWatermarkToPartitionsMap.Add(kvp.Value, new HashSet { kvp.Key }); + this.highWatermarkToPartitionsMap.Add(kvp.Value, [kvp.Key]); } } @@ -4216,7 +4216,7 @@ public override void OnNext(PartitionedStreamEvent value) this.partitionHighWatermarks.Add(value.PartitionKey, this.lowWatermark.rawValue); if (this.highWatermarkToPartitionsMap.TryGetValue(this.lowWatermark.rawValue, out HashSet keySet)) keySet.Add(value.PartitionKey); - else this.highWatermarkToPartitionsMap.Add(this.lowWatermark.rawValue, new HashSet { value.PartitionKey }); + else this.highWatermarkToPartitionsMap.Add(this.lowWatermark.rawValue, [value.PartitionKey]); } long moveTo = moveFrom; @@ -4237,7 +4237,7 @@ public override void OnNext(PartitionedStreamEvent value) else oldSet.Remove(value.PartitionKey); if (this.highWatermarkToPartitionsMap.TryGetValue(value.SyncTime, out HashSet set)) set.Add(value.PartitionKey); - else this.highWatermarkToPartitionsMap.Add(value.SyncTime, new HashSet { value.PartitionKey }); + else this.highWatermarkToPartitionsMap.Add(value.SyncTime, [value.PartitionKey]); if (value.IsData) { @@ -4358,7 +4358,7 @@ private void Process(ref PartitionedStreamEvent value) key = Tuple.Create(value.SyncTime, value.Payload); if (!this.startEventInformation.TryGetValue(key, out q)) { - q = new ElasticCircularBuffer(); + q = []; this.startEventInformation.Add(key, q); var x = new AdjustInfo(current); q.Enqueue(ref x); @@ -4603,7 +4603,7 @@ protected override void UpdatePointers() if (this.highWatermarkToPartitionsMap.TryGetValue(kvp.Value, out HashSet set)) set.Add(kvp.Key); else - this.highWatermarkToPartitionsMap.Add(kvp.Value, new HashSet { kvp.Key }); + this.highWatermarkToPartitionsMap.Add(kvp.Value, [kvp.Key]); } } @@ -4708,7 +4708,7 @@ private void Action(long start, long end, TResult payload, PartitionKey ac this.partitionHighWatermarks.Add(value.PartitionKey, this.lowWatermark.rawValue); if (this.highWatermarkToPartitionsMap.TryGetValue(this.lowWatermark.rawValue, out HashSet keySet)) keySet.Add(value.PartitionKey); - else this.highWatermarkToPartitionsMap.Add(this.lowWatermark.rawValue, new HashSet { value.PartitionKey }); + else this.highWatermarkToPartitionsMap.Add(this.lowWatermark.rawValue, [value.PartitionKey]); } long moveTo = moveFrom; @@ -4729,7 +4729,7 @@ private void Action(long start, long end, TResult payload, PartitionKey ac else oldSet.Remove(value.PartitionKey); if (this.highWatermarkToPartitionsMap.TryGetValue(value.SyncTime, out HashSet set)) set.Add(value.PartitionKey); - else this.highWatermarkToPartitionsMap.Add(value.SyncTime, new HashSet { value.PartitionKey }); + else this.highWatermarkToPartitionsMap.Add(value.SyncTime, [value.PartitionKey]); if (value.IsData) { @@ -4850,7 +4850,7 @@ private void Process(ref PartitionedStreamEvent value) key = Tuple.Create(value.SyncTime, value.Payload); if (!this.startEventInformation.TryGetValue(key, out q)) { - q = new ElasticCircularBuffer(); + q = []; this.startEventInformation.Add(key, q); var x = new AdjustInfo(current); q.Enqueue(ref x); @@ -5100,7 +5100,7 @@ protected override void UpdatePointers() if (this.highWatermarkToPartitionsMap.TryGetValue(kvp.Value, out HashSet set)) set.Add(kvp.Key); else - this.highWatermarkToPartitionsMap.Add(kvp.Value, new HashSet { kvp.Key }); + this.highWatermarkToPartitionsMap.Add(kvp.Value, [kvp.Key]); } } @@ -5225,7 +5225,7 @@ public override void OnNext(PartitionedStreamEvent value) key = Tuple.Create(value.SyncTime, value.Payload); if (!this.startEventInformation.TryGetValue(key, out q)) { - q = new ElasticCircularBuffer(); + q = []; this.startEventInformation.Add(key, q); var x = new AdjustInfo(current); q.Enqueue(ref x); @@ -5542,7 +5542,7 @@ public override void OnNext(PartitionedStreamEvent value) key = Tuple.Create(value.SyncTime, value.Payload); if (!this.startEventInformation.TryGetValue(key, out q)) { - q = new ElasticCircularBuffer(); + q = []; this.startEventInformation.Add(key, q); var x = new AdjustInfo(current); q.Enqueue(ref x); @@ -5857,7 +5857,7 @@ private void Action(long start, long end, TResult payload, PartitionKey ac key = Tuple.Create(value.SyncTime, value.Payload); if (!this.startEventInformation.TryGetValue(key, out q)) { - q = new ElasticCircularBuffer(); + q = []; this.startEventInformation.Add(key, q); var x = new AdjustInfo(current); q.Enqueue(ref x); @@ -6140,7 +6140,7 @@ public override void OnNext(TPayload inputValue) this.partitionHighWatermarks.Add(value.PartitionKey, this.lowWatermark.rawValue); if (this.highWatermarkToPartitionsMap.TryGetValue(this.lowWatermark.rawValue, out HashSet keySet)) keySet.Add(value.PartitionKey); - else this.highWatermarkToPartitionsMap.Add(this.lowWatermark.rawValue, new HashSet { value.PartitionKey }); + else this.highWatermarkToPartitionsMap.Add(this.lowWatermark.rawValue, [value.PartitionKey]); } long moveTo = moveFrom; @@ -6161,7 +6161,7 @@ public override void OnNext(TPayload inputValue) else oldSet.Remove(value.PartitionKey); if (this.highWatermarkToPartitionsMap.TryGetValue(value.SyncTime, out HashSet set)) set.Add(value.PartitionKey); - else this.highWatermarkToPartitionsMap.Add(value.SyncTime, new HashSet { value.PartitionKey }); + else this.highWatermarkToPartitionsMap.Add(value.SyncTime, [value.PartitionKey]); moveTo = value.SyncTime - this.reorderLatency; if (moveTo < StreamEvent.MinSyncTime) moveTo = StreamEvent.MinSyncTime; @@ -6419,7 +6419,7 @@ protected override void UpdatePointers() if (this.highWatermarkToPartitionsMap.TryGetValue(kvp.Value, out HashSet set)) set.Add(kvp.Key); else - this.highWatermarkToPartitionsMap.Add(kvp.Value, new HashSet { kvp.Key }); + this.highWatermarkToPartitionsMap.Add(kvp.Value, [kvp.Key]); } } @@ -6540,7 +6540,7 @@ public override void OnNext(TPayload inputValue) this.partitionHighWatermarks.Add(value.PartitionKey, this.lowWatermark.rawValue); if (this.highWatermarkToPartitionsMap.TryGetValue(this.lowWatermark.rawValue, out HashSet keySet)) keySet.Add(value.PartitionKey); - else this.highWatermarkToPartitionsMap.Add(this.lowWatermark.rawValue, new HashSet { value.PartitionKey }); + else this.highWatermarkToPartitionsMap.Add(this.lowWatermark.rawValue, [value.PartitionKey]); } long moveTo = moveFrom; @@ -6561,7 +6561,7 @@ public override void OnNext(TPayload inputValue) else oldSet.Remove(value.PartitionKey); if (this.highWatermarkToPartitionsMap.TryGetValue(value.SyncTime, out HashSet set)) set.Add(value.PartitionKey); - else this.highWatermarkToPartitionsMap.Add(value.SyncTime, new HashSet { value.PartitionKey }); + else this.highWatermarkToPartitionsMap.Add(value.SyncTime, [value.PartitionKey]); moveTo = value.SyncTime - this.reorderLatency; if (moveTo < StreamEvent.MinSyncTime) moveTo = StreamEvent.MinSyncTime; @@ -6814,7 +6814,7 @@ protected override void UpdatePointers() if (this.highWatermarkToPartitionsMap.TryGetValue(kvp.Value, out HashSet set)) set.Add(kvp.Key); else - this.highWatermarkToPartitionsMap.Add(kvp.Value, new HashSet { kvp.Key }); + this.highWatermarkToPartitionsMap.Add(kvp.Value, [kvp.Key]); } } @@ -6937,7 +6937,7 @@ private void Action(long start, long end, TResult payload, PartitionKey ac this.partitionHighWatermarks.Add(value.PartitionKey, this.lowWatermark.rawValue); if (this.highWatermarkToPartitionsMap.TryGetValue(this.lowWatermark.rawValue, out HashSet keySet)) keySet.Add(value.PartitionKey); - else this.highWatermarkToPartitionsMap.Add(this.lowWatermark.rawValue, new HashSet { value.PartitionKey }); + else this.highWatermarkToPartitionsMap.Add(this.lowWatermark.rawValue, [value.PartitionKey]); } long moveTo = moveFrom; @@ -6958,7 +6958,7 @@ private void Action(long start, long end, TResult payload, PartitionKey ac else oldSet.Remove(value.PartitionKey); if (this.highWatermarkToPartitionsMap.TryGetValue(value.SyncTime, out HashSet set)) set.Add(value.PartitionKey); - else this.highWatermarkToPartitionsMap.Add(value.SyncTime, new HashSet { value.PartitionKey }); + else this.highWatermarkToPartitionsMap.Add(value.SyncTime, [value.PartitionKey]); moveTo = value.SyncTime - this.reorderLatency; if (moveTo < StreamEvent.MinSyncTime) moveTo = StreamEvent.MinSyncTime; @@ -7216,7 +7216,7 @@ protected override void UpdatePointers() if (this.highWatermarkToPartitionsMap.TryGetValue(kvp.Value, out HashSet set)) set.Add(kvp.Key); else - this.highWatermarkToPartitionsMap.Add(kvp.Value, new HashSet { kvp.Key }); + this.highWatermarkToPartitionsMap.Add(kvp.Value, [kvp.Key]); } } diff --git a/Sources/Core/Microsoft.StreamProcessing/Microsoft.StreamProcessing.csproj b/Sources/Core/Microsoft.StreamProcessing/Microsoft.StreamProcessing.csproj index b96b07891..bdcd96f83 100644 --- a/Sources/Core/Microsoft.StreamProcessing/Microsoft.StreamProcessing.csproj +++ b/Sources/Core/Microsoft.StreamProcessing/Microsoft.StreamProcessing.csproj @@ -1,7 +1,7 @@  - netstandard2.0 + net10.0 x64;AnyCPU @@ -10,15 +10,28 @@ Microsoft.StreamProcessing + + True + 1701;1702;0009 + + + + True + 1701;1702;0009 + + + + True + 1701;1702;0009 + + + + True + 1701;1702;0009 + + - - - - - - - - + diff --git a/Sources/Core/Microsoft.StreamProcessing/Operators/Afa/AfaDescriptor.cs b/Sources/Core/Microsoft.StreamProcessing/Operators/Afa/AfaDescriptor.cs index b701e11b1..ed815cf22 100644 --- a/Sources/Core/Microsoft.StreamProcessing/Operators/Afa/AfaDescriptor.cs +++ b/Sources/Core/Microsoft.StreamProcessing/Operators/Afa/AfaDescriptor.cs @@ -71,12 +71,12 @@ public Afa(TRegister defaultRegister = default, TAccumulator defaultAccumulator /// /// The set of final states in the AFA. /// - internal List finalStates = new List(); + internal List finalStates = []; /// /// The arcs present in the AFA. /// - internal Dictionary>> transitionInfo = new Dictionary>>(); + internal Dictionary>> transitionInfo = []; /// /// Start state of the AFA. @@ -180,7 +180,7 @@ internal void AddArc(int fromState, int toState, Arc arc) if (!this.transitionInfo.ContainsKey(fromState)) { - this.transitionInfo.Add(fromState, new Dictionary>()); + this.transitionInfo.Add(fromState, []); } if (!this.transitionInfo[fromState].ContainsKey(toState)) diff --git a/Sources/Core/Microsoft.StreamProcessing/Operators/Afa/AfaMultiEventListTransformer.cs b/Sources/Core/Microsoft.StreamProcessing/Operators/Afa/AfaMultiEventListTransformer.cs index 1d2030c91..4da11f940 100644 --- a/Sources/Core/Microsoft.StreamProcessing/Operators/Afa/AfaMultiEventListTransformer.cs +++ b/Sources/Core/Microsoft.StreamProcessing/Operators/Afa/AfaMultiEventListTransformer.cs @@ -13,8 +13,8 @@ namespace Microsoft.StreamProcessing internal partial class AfaMultiEventListTemplate : AfaTemplate { private Func keyEqualityComparer; - protected readonly List>> edgeInfos = new List>>(); - protected readonly List>> startEdgeInfos = new List>>(); + protected readonly List>> edgeInfos = []; + protected readonly List>> startEdgeInfos = []; private bool payloadIsAnon; private bool payloadHasNoFields; diff --git a/Sources/Core/Microsoft.StreamProcessing/Operators/Afa/AfaTransformer.cs b/Sources/Core/Microsoft.StreamProcessing/Operators/Afa/AfaTransformer.cs index 36acd5d6a..b446e8efa 100644 --- a/Sources/Core/Microsoft.StreamProcessing/Operators/Afa/AfaTransformer.cs +++ b/Sources/Core/Microsoft.StreamProcessing/Operators/Afa/AfaTransformer.cs @@ -17,8 +17,8 @@ internal partial class AfaTemplate protected Type accumulatorType; protected bool hasRegister; protected bool isSyncTimeSimultaneityFree; - protected readonly List>> currentlyActiveInfo = new List>>(); - protected readonly List>> newActivationInfo = new List>>(); + protected readonly List>> currentlyActiveInfo = []; + protected readonly List>> newActivationInfo = []; protected string TKey; protected string TPayload; protected string TRegister; diff --git a/Sources/Core/Microsoft.StreamProcessing/Operators/Afa/CompiledUngroupedAfaPipe_EventList.cs b/Sources/Core/Microsoft.StreamProcessing/Operators/Afa/CompiledUngroupedAfaPipe_EventList.cs index 27c6af00c..8266ff761 100644 --- a/Sources/Core/Microsoft.StreamProcessing/Operators/Afa/CompiledUngroupedAfaPipe_EventList.cs +++ b/Sources/Core/Microsoft.StreamProcessing/Operators/Afa/CompiledUngroupedAfaPipe_EventList.cs @@ -36,7 +36,7 @@ public CompiledUngroupedAfaPipe_EventList(Streamable stream, I this.activeStates = new FastLinkedList>(); this.activeStatesTraverser = new FastLinkedList>.ListTraverser(this.activeStates); - this.currentList = new List(); + this.currentList = []; this.lastSyncTime = -1; } @@ -320,7 +320,7 @@ public override unsafe void OnNext(StreamMessage batch) { ProcessCurrentTimestamp(); this.lastSyncTime = synctime; - this.currentList = new List(); + this.currentList = []; } this.currentList.Add(batch.payload.col[i]); diff --git a/Sources/Core/Microsoft.StreamProcessing/Operators/Afa/CompiledUngroupedAfaPipe_MultiEventList.cs b/Sources/Core/Microsoft.StreamProcessing/Operators/Afa/CompiledUngroupedAfaPipe_MultiEventList.cs index 1cff60c47..3fe0cafc6 100644 --- a/Sources/Core/Microsoft.StreamProcessing/Operators/Afa/CompiledUngroupedAfaPipe_MultiEventList.cs +++ b/Sources/Core/Microsoft.StreamProcessing/Operators/Afa/CompiledUngroupedAfaPipe_MultiEventList.cs @@ -17,7 +17,7 @@ internal sealed class CompiledUngroupedAfaPipe_MultiEventList> activeStates; [DataMember] - private List currentTimestampEventList = new List(); + private List currentTimestampEventList = []; [DataMember] private long lastSyncTime; diff --git a/Sources/Core/Microsoft.StreamProcessing/Operators/Afa/GroupedAfaMultiEventTransformer.cs b/Sources/Core/Microsoft.StreamProcessing/Operators/Afa/GroupedAfaMultiEventTransformer.cs index d7c440689..cdd17bc54 100644 --- a/Sources/Core/Microsoft.StreamProcessing/Operators/Afa/GroupedAfaMultiEventTransformer.cs +++ b/Sources/Core/Microsoft.StreamProcessing/Operators/Afa/GroupedAfaMultiEventTransformer.cs @@ -13,8 +13,8 @@ namespace Microsoft.StreamProcessing internal partial class GroupedAfaMultiEventTemplate : AfaTemplate { private Func keyEqualityComparer; - protected readonly List>> edgeInfos = new List>>(); - protected readonly List>> startEdgeInfos = new List>>(); + protected readonly List>> edgeInfos = []; + protected readonly List>> startEdgeInfos = []; private GroupedAfaMultiEventTemplate(string className, Type keyType, Type payloadType, Type registerType, Type accumulatorType) : base(className, keyType, payloadType, registerType, accumulatorType) diff --git a/Sources/Core/Microsoft.StreamProcessing/Operators/Clip/PartitionedClipJoinPipe.cs b/Sources/Core/Microsoft.StreamProcessing/Operators/Clip/PartitionedClipJoinPipe.cs index 8a551008a..fa32a8623 100644 --- a/Sources/Core/Microsoft.StreamProcessing/Operators/Clip/PartitionedClipJoinPipe.cs +++ b/Sources/Core/Microsoft.StreamProcessing/Operators/Clip/PartitionedClipJoinPipe.cs @@ -30,11 +30,11 @@ internal sealed class PartitionedClipJoinPipe> rightQueue = new FastDictionary2>(); [DataMember] - private HashSet processQueue = new HashSet(); + private HashSet processQueue = []; [DataMember] - private HashSet seenKeys = new HashSet(); + private HashSet seenKeys = []; [DataMember] - private HashSet cleanKeys = new HashSet(); + private HashSet cleanKeys = []; [DataMember] private StreamMessage output; diff --git a/Sources/Core/Microsoft.StreamProcessing/Operators/ClipByConstant/ClipByConstantPipe.cs b/Sources/Core/Microsoft.StreamProcessing/Operators/ClipByConstant/ClipByConstantPipe.cs index b602be6de..348921590 100644 --- a/Sources/Core/Microsoft.StreamProcessing/Operators/ClipByConstant/ClipByConstantPipe.cs +++ b/Sources/Core/Microsoft.StreamProcessing/Operators/ClipByConstant/ClipByConstantPipe.cs @@ -24,7 +24,7 @@ internal sealed class ClipByConstantPipe : UnaryPipe output; [DataMember] - private SortedDictionary> syncTimeMap = new SortedDictionary>(); + private SortedDictionary> syncTimeMap = []; [Obsolete("Used only by serialization. Do not call directly.")] public ClipByConstantPipe() { } diff --git a/Sources/Core/Microsoft.StreamProcessing/Operators/ClipByConstant/PartitionedClipByConstantPipe.cs b/Sources/Core/Microsoft.StreamProcessing/Operators/ClipByConstant/PartitionedClipByConstantPipe.cs index f7e4dce49..f42bdb0d4 100644 --- a/Sources/Core/Microsoft.StreamProcessing/Operators/ClipByConstant/PartitionedClipByConstantPipe.cs +++ b/Sources/Core/Microsoft.StreamProcessing/Operators/ClipByConstant/PartitionedClipByConstantPipe.cs @@ -88,7 +88,7 @@ private void ReachTime(TPartitionKey pKey, long timestamp) private void AllocatePartition(TPartitionKey pKey, long timestamp) { this.syncTimeMapDictionary.Lookup(pKey, out int mapIndex); - this.syncTimeMapDictionary.Insert(ref mapIndex, pKey, new SortedDictionary>()); + this.syncTimeMapDictionary.Insert(ref mapIndex, pKey, []); this.lastSyncTimeDictionary.Lookup(pKey, out int timeIndex); this.lastSyncTimeDictionary.Insert(ref timeIndex, pKey, timestamp); } diff --git a/Sources/Core/Microsoft.StreamProcessing/Operators/EndEdgeFreeOutput/EndEdgeFreeOutputPipe.cs b/Sources/Core/Microsoft.StreamProcessing/Operators/EndEdgeFreeOutput/EndEdgeFreeOutputPipe.cs index d68c406b3..59d251ec8 100644 --- a/Sources/Core/Microsoft.StreamProcessing/Operators/EndEdgeFreeOutput/EndEdgeFreeOutputPipe.cs +++ b/Sources/Core/Microsoft.StreamProcessing/Operators/EndEdgeFreeOutput/EndEdgeFreeOutputPipe.cs @@ -48,7 +48,7 @@ public EndEdgeFreeOutputPipe(EndEdgeFreeOutputStreamable stream, this.pool.Get(out this.output); this.output.Allocate(); - this.eventMap = new SortedDictionary>(); + this.eventMap = []; this.lastSyncTime = StreamEvent.MinSyncTime; this.lastCti = StreamEvent.MinSyncTime; } diff --git a/Sources/Core/Microsoft.StreamProcessing/Operators/EndEdgeFreeOutput/PartitionedEndEdgeFreeOutputPipe.cs b/Sources/Core/Microsoft.StreamProcessing/Operators/EndEdgeFreeOutput/PartitionedEndEdgeFreeOutputPipe.cs index 345f2bd5a..c985d9012 100644 --- a/Sources/Core/Microsoft.StreamProcessing/Operators/EndEdgeFreeOutput/PartitionedEndEdgeFreeOutputPipe.cs +++ b/Sources/Core/Microsoft.StreamProcessing/Operators/EndEdgeFreeOutput/PartitionedEndEdgeFreeOutputPipe.cs @@ -291,7 +291,7 @@ public override string ToString() private sealed class PartitionEntry { [DataMember] - public SortedDictionary> eventMap = new SortedDictionary>(); + public SortedDictionary> eventMap = []; [DataMember] public long lastSyncTime = StreamEvent.MinSyncTime; [DataMember] diff --git a/Sources/Core/Microsoft.StreamProcessing/Operators/EquiJoin/Basic/PartitionedEquiJoinPipe.cs b/Sources/Core/Microsoft.StreamProcessing/Operators/EquiJoin/Basic/PartitionedEquiJoinPipe.cs index 901caebe8..9d40105b2 100644 --- a/Sources/Core/Microsoft.StreamProcessing/Operators/EquiJoin/Basic/PartitionedEquiJoinPipe.cs +++ b/Sources/Core/Microsoft.StreamProcessing/Operators/EquiJoin/Basic/PartitionedEquiJoinPipe.cs @@ -37,11 +37,11 @@ internal sealed class PartitionedEquiJoinPipe> rightQueue = new FastDictionary2>(); [DataMember] - private HashSet processQueue = new HashSet(); + private HashSet processQueue = []; [DataMember] - private HashSet seenKeys = new HashSet(); + private HashSet seenKeys = []; [DataMember] - private HashSet cleanKeys = new HashSet(); + private HashSet cleanKeys = []; [DataMember] private StreamMessage output; diff --git a/Sources/Core/Microsoft.StreamProcessing/Operators/EquiJoin/Basic/PartitionedEquiJoinPipeCompound.cs b/Sources/Core/Microsoft.StreamProcessing/Operators/EquiJoin/Basic/PartitionedEquiJoinPipeCompound.cs index 29f18f0cb..e95ce8d97 100644 --- a/Sources/Core/Microsoft.StreamProcessing/Operators/EquiJoin/Basic/PartitionedEquiJoinPipeCompound.cs +++ b/Sources/Core/Microsoft.StreamProcessing/Operators/EquiJoin/Basic/PartitionedEquiJoinPipeCompound.cs @@ -36,11 +36,11 @@ internal sealed class PartitionedEquiJoinPipeCompound> rightQueue = new FastDictionary2>(); [DataMember] - private HashSet processQueue = new HashSet(); + private HashSet processQueue = []; [DataMember] - private HashSet seenKeys = new HashSet(); + private HashSet seenKeys = []; [DataMember] - private HashSet cleanKeys = new HashSet(); + private HashSet cleanKeys = []; [DataMember] private StreamMessage, TGroupKey>, TResult> output; diff --git a/Sources/Core/Microsoft.StreamProcessing/Operators/EquiJoin/Basic/PartitionedEquiJoinPipeSimple.cs b/Sources/Core/Microsoft.StreamProcessing/Operators/EquiJoin/Basic/PartitionedEquiJoinPipeSimple.cs index 7d3237d9e..4fd79b8ec 100644 --- a/Sources/Core/Microsoft.StreamProcessing/Operators/EquiJoin/Basic/PartitionedEquiJoinPipeSimple.cs +++ b/Sources/Core/Microsoft.StreamProcessing/Operators/EquiJoin/Basic/PartitionedEquiJoinPipeSimple.cs @@ -35,11 +35,11 @@ internal sealed class PartitionedEquiJoinPipeSimple> rightQueue = new FastDictionary2>(); [DataMember] - private HashSet processQueue = new HashSet(); + private HashSet processQueue = []; [DataMember] - private HashSet seenKeys = new HashSet(); + private HashSet seenKeys = []; [DataMember] - private HashSet cleanKeys = new HashSet(); + private HashSet cleanKeys = []; [DataMember] private StreamMessage, TResult> output; diff --git a/Sources/Core/Microsoft.StreamProcessing/Operators/EquiJoin/EquiJoinStreamable.cs b/Sources/Core/Microsoft.StreamProcessing/Operators/EquiJoin/EquiJoinStreamable.cs index 4624db258..9c049504f 100644 --- a/Sources/Core/Microsoft.StreamProcessing/Operators/EquiJoin/EquiJoinStreamable.cs +++ b/Sources/Core/Microsoft.StreamProcessing/Operators/EquiJoin/EquiJoinStreamable.cs @@ -11,8 +11,10 @@ namespace Microsoft.StreamProcessing { internal sealed class EquiJoinStreamable : BinaryStreamable { - private static readonly SafeConcurrentDictionary> cachedPipes - = new SafeConcurrentDictionary>(); + // Internal (not private) so test code can call cachedPipes.Clear() to ensure + // deterministic behavior in tests that depend on a fresh codegen compile. + internal static readonly SafeConcurrentDictionary> cachedPipes + = new SafeConcurrentDictionary>(); private readonly JoinKind joinKind; private readonly Func> columnarGenerator; diff --git a/Sources/Core/Microsoft.StreamProcessing/Operators/EquiJoin/FixedInterval/PartitionedFixedIntervalEquiJoinPipe.cs b/Sources/Core/Microsoft.StreamProcessing/Operators/EquiJoin/FixedInterval/PartitionedFixedIntervalEquiJoinPipe.cs index 640b4a1cb..4780892e4 100644 --- a/Sources/Core/Microsoft.StreamProcessing/Operators/EquiJoin/FixedInterval/PartitionedFixedIntervalEquiJoinPipe.cs +++ b/Sources/Core/Microsoft.StreamProcessing/Operators/EquiJoin/FixedInterval/PartitionedFixedIntervalEquiJoinPipe.cs @@ -35,11 +35,11 @@ internal sealed class PartitionedFixedIntervalEquiJoinPipe> rightQueue = new FastDictionary2>(); [DataMember] - private HashSet processQueue = new HashSet(); + private HashSet processQueue = []; [DataMember] - private HashSet seenKeys = new HashSet(); + private HashSet seenKeys = []; [DataMember] - private HashSet cleanKeys = new HashSet(); + private HashSet cleanKeys = []; [DataMember] private StreamMessage output; diff --git a/Sources/Core/Microsoft.StreamProcessing/Operators/EquiJoin/FixedInterval/PartitionedFixedIntervalEquiJoinPipeCompound.cs b/Sources/Core/Microsoft.StreamProcessing/Operators/EquiJoin/FixedInterval/PartitionedFixedIntervalEquiJoinPipeCompound.cs index 814ef34ce..aea84b0e1 100644 --- a/Sources/Core/Microsoft.StreamProcessing/Operators/EquiJoin/FixedInterval/PartitionedFixedIntervalEquiJoinPipeCompound.cs +++ b/Sources/Core/Microsoft.StreamProcessing/Operators/EquiJoin/FixedInterval/PartitionedFixedIntervalEquiJoinPipeCompound.cs @@ -34,11 +34,11 @@ internal sealed class PartitionedFixedIntervalEquiJoinPipeCompound> rightQueue = new FastDictionary2>(); [DataMember] - private HashSet processQueue = new HashSet(); + private HashSet processQueue = []; [DataMember] - private HashSet seenKeys = new HashSet(); + private HashSet seenKeys = []; [DataMember] - private HashSet cleanKeys = new HashSet(); + private HashSet cleanKeys = []; [DataMember] private StreamMessage, TGroupKey>, TResult> output; diff --git a/Sources/Core/Microsoft.StreamProcessing/Operators/EquiJoin/FixedInterval/PartitionedFixedIntervalEquiJoinPipeSimple.cs b/Sources/Core/Microsoft.StreamProcessing/Operators/EquiJoin/FixedInterval/PartitionedFixedIntervalEquiJoinPipeSimple.cs index 0cfe92511..51ce422bc 100644 --- a/Sources/Core/Microsoft.StreamProcessing/Operators/EquiJoin/FixedInterval/PartitionedFixedIntervalEquiJoinPipeSimple.cs +++ b/Sources/Core/Microsoft.StreamProcessing/Operators/EquiJoin/FixedInterval/PartitionedFixedIntervalEquiJoinPipeSimple.cs @@ -33,11 +33,11 @@ internal sealed class PartitionedFixedIntervalEquiJoinPipeSimple> rightQueue = new FastDictionary2>(); [DataMember] - private HashSet processQueue = new HashSet(); + private HashSet processQueue = []; [DataMember] - private HashSet seenKeys = new HashSet(); + private HashSet seenKeys = []; [DataMember] - private HashSet cleanKeys = new HashSet(); + private HashSet cleanKeys = []; [DataMember] private StreamMessage, TResult> output; diff --git a/Sources/Core/Microsoft.StreamProcessing/Operators/EquiJoin/IncreasingOrder/IncreasingOrderEquiJoinPipe.cs b/Sources/Core/Microsoft.StreamProcessing/Operators/EquiJoin/IncreasingOrder/IncreasingOrderEquiJoinPipe.cs index 026eccaa6..891fd0377 100644 --- a/Sources/Core/Microsoft.StreamProcessing/Operators/EquiJoin/IncreasingOrder/IncreasingOrderEquiJoinPipe.cs +++ b/Sources/Core/Microsoft.StreamProcessing/Operators/EquiJoin/IncreasingOrder/IncreasingOrderEquiJoinPipe.cs @@ -62,8 +62,8 @@ public IncreasingOrderEquiJoinPipe( this.joinKeyOrderComparerExpression = stream.Left.Properties.KeyComparer.GetCompareExpr(); this.joinKeyOrderComparer = this.joinKeyOrderComparerExpression.Compile(); - this.currentLeftList = new List>(); - this.currentRightList = new List>(); + this.currentLeftList = []; + this.currentRightList = []; this.errorMessages = stream.ErrorMessages; this.pool = MemoryManager.GetMemoryPool(stream.Properties.IsColumnar); diff --git a/Sources/Core/Microsoft.StreamProcessing/Operators/EquiJoin/StartEdge/PartitionedStartEdgeEquiJoinPipe.cs b/Sources/Core/Microsoft.StreamProcessing/Operators/EquiJoin/StartEdge/PartitionedStartEdgeEquiJoinPipe.cs index f9371bb6d..7acba599f 100644 --- a/Sources/Core/Microsoft.StreamProcessing/Operators/EquiJoin/StartEdge/PartitionedStartEdgeEquiJoinPipe.cs +++ b/Sources/Core/Microsoft.StreamProcessing/Operators/EquiJoin/StartEdge/PartitionedStartEdgeEquiJoinPipe.cs @@ -32,11 +32,11 @@ internal sealed class PartitionedStartEdgeEquiJoinPipe> rightQueue = new FastDictionary2>(); [DataMember] - private HashSet processQueue = new HashSet(); + private HashSet processQueue = []; [DataMember] - private HashSet seenKeys = new HashSet(); + private HashSet seenKeys = []; [DataMember] - private HashSet cleanKeys = new HashSet(); + private HashSet cleanKeys = []; [DataMember] private StreamMessage output; @@ -99,8 +99,8 @@ protected override void ProduceBinaryQueryPlan(PlanNode left, PlanNode right) private void NewPartition(TPartitionKey pKey) { - this.leftQueue.Insert(pKey, new PooledElasticCircularBuffer()); - this.rightQueue.Insert(pKey, new PooledElasticCircularBuffer()); + this.leftQueue.Insert(pKey, []); + this.rightQueue.Insert(pKey, []); if (!this.partitionData.Lookup(pKey, out int index)) this.partitionData.Insert(ref index, pKey, new PartitionEntry { key = pKey }); } diff --git a/Sources/Core/Microsoft.StreamProcessing/Operators/ExtendLifetime/ExtendLifetimeNegativePipe.cs b/Sources/Core/Microsoft.StreamProcessing/Operators/ExtendLifetime/ExtendLifetimeNegativePipe.cs index b03a53aeb..2ed7c29a0 100644 --- a/Sources/Core/Microsoft.StreamProcessing/Operators/ExtendLifetime/ExtendLifetimeNegativePipe.cs +++ b/Sources/Core/Microsoft.StreamProcessing/Operators/ExtendLifetime/ExtendLifetimeNegativePipe.cs @@ -29,7 +29,7 @@ internal sealed class ExtendLifetimeNegativePipe : UnaryPipe> contractedToZero = new Dictionary>(); + private Dictionary> contractedToZero = []; [SchemaSerialization] private readonly Expression> keyComparerExpr; diff --git a/Sources/Core/Microsoft.StreamProcessing/Operators/ExtendLifetime/PartitionedExtendLifetimeNegativePipe.cs b/Sources/Core/Microsoft.StreamProcessing/Operators/ExtendLifetime/PartitionedExtendLifetimeNegativePipe.cs index 1eb007e64..2af657d69 100644 --- a/Sources/Core/Microsoft.StreamProcessing/Operators/ExtendLifetime/PartitionedExtendLifetimeNegativePipe.cs +++ b/Sources/Core/Microsoft.StreamProcessing/Operators/ExtendLifetime/PartitionedExtendLifetimeNegativePipe.cs @@ -118,7 +118,7 @@ private void AllocatePartition(TPartitionKey pKey, long timestamp) this.lastSyncTimeDictionary.Lookup(pKey, out int timeIndex); this.lastSyncTimeDictionary.Insert(ref timeIndex, pKey, timestamp); this.contractedToZeroDictionary.Lookup(pKey, out int collapseIndex); - this.contractedToZeroDictionary.Insert(ref collapseIndex, pKey, new Dictionary>()); + this.contractedToZeroDictionary.Insert(ref collapseIndex, pKey, []); } public override unsafe void OnNext(StreamMessage batch) diff --git a/Sources/Core/Microsoft.StreamProcessing/Operators/LeftAntiSemiJoin/PartitionedLeftAntiSemiJoinPipe.cs b/Sources/Core/Microsoft.StreamProcessing/Operators/LeftAntiSemiJoin/PartitionedLeftAntiSemiJoinPipe.cs index ee6025c5d..31749d3ea 100644 --- a/Sources/Core/Microsoft.StreamProcessing/Operators/LeftAntiSemiJoin/PartitionedLeftAntiSemiJoinPipe.cs +++ b/Sources/Core/Microsoft.StreamProcessing/Operators/LeftAntiSemiJoin/PartitionedLeftAntiSemiJoinPipe.cs @@ -35,11 +35,11 @@ internal sealed class PartitionedLeftAntiSemiJoinPipe> rightQueue = new FastDictionary2>(); [DataMember] - private HashSet processQueue = new HashSet(); + private HashSet processQueue = []; [DataMember] - private HashSet seenKeys = new HashSet(); + private HashSet seenKeys = []; [DataMember] - private HashSet cleanKeys = new HashSet(); + private HashSet cleanKeys = []; [DataMember] private StreamMessage output; @@ -92,8 +92,8 @@ protected override void ProduceBinaryQueryPlan(PlanNode left, PlanNode right) private void NewPartition(TPartitionKey pKey) { - this.leftQueue.Insert(pKey, new PooledElasticCircularBuffer()); - this.rightQueue.Insert(pKey, new PooledElasticCircularBuffer()); + this.leftQueue.Insert(pKey, []); + this.rightQueue.Insert(pKey, []); if (!this.partitionData.Lookup(pKey, out int index)) this.partitionData.Insert(ref index, pKey, new PartitionEntry(this)); } diff --git a/Sources/Core/Microsoft.StreamProcessing/Operators/Multicast/DependentStreamable.cs b/Sources/Core/Microsoft.StreamProcessing/Operators/Multicast/DependentStreamable.cs index 5af88e3f5..e51095d8a 100644 --- a/Sources/Core/Microsoft.StreamProcessing/Operators/Multicast/DependentStreamable.cs +++ b/Sources/Core/Microsoft.StreamProcessing/Operators/Multicast/DependentStreamable.cs @@ -39,7 +39,7 @@ private IStreamable[] GenerateStreamableArray() throw new InvalidOperationException("Cannot generate a streamable array more than once."); } - this.toSubscribe = new HashSet(); + this.toSubscribe = []; var output = new IStreamable[this.outputCount]; for (int i = 0; i < this.outputCount; i++) @@ -105,7 +105,7 @@ private sealed class DisposableManager public DisposableManager(int count) { - this.toDispose = new HashSet(); + this.toDispose = []; for (int i = 0; i < count; i++) { this.toDispose.Add(i); diff --git a/Sources/Core/Microsoft.StreamProcessing/Operators/SessionWindow/PartitionedSessionWindowPipe.cs b/Sources/Core/Microsoft.StreamProcessing/Operators/SessionWindow/PartitionedSessionWindowPipe.cs index 1fdf85f03..24b5542a1 100644 --- a/Sources/Core/Microsoft.StreamProcessing/Operators/SessionWindow/PartitionedSessionWindowPipe.cs +++ b/Sources/Core/Microsoft.StreamProcessing/Operators/SessionWindow/PartitionedSessionWindowPipe.cs @@ -26,7 +26,7 @@ internal sealed class PartitionedSessionWindowPipe output; - private Dictionary> orderedKeysDictionary = new Dictionary>(); + private Dictionary> orderedKeysDictionary = []; [DataMember] private FastDictionary2 windowEndTimeDictionary = new FastDictionary2(); [DataMember] diff --git a/Sources/Core/Microsoft.StreamProcessing/Operators/Shuffle/ShufflePipe.cs b/Sources/Core/Microsoft.StreamProcessing/Operators/Shuffle/ShufflePipe.cs index f96d0328c..f94fe13aa 100644 --- a/Sources/Core/Microsoft.StreamProcessing/Operators/Shuffle/ShufflePipe.cs +++ b/Sources/Core/Microsoft.StreamProcessing/Operators/Shuffle/ShufflePipe.cs @@ -56,7 +56,7 @@ public PartitionedShuffleNestedPipe( this.errorMessages = stream.ErrorMessages; this.l1Pool = MemoryManager.GetMemoryPool, TSource>(stream.Properties.IsColumnar); - this.Observers = new List, TSource>>(); + this.Observers = []; this.batches = new StreamMessage, TSource>[totalBranchesL2]; for (int i = 0; i < totalBranchesL2; i++) @@ -363,7 +363,7 @@ public ShuffleNestedPipe( this.errorMessages = stream.ErrorMessages; this.l1Pool = MemoryManager.GetMemoryPool, TSource>(stream.Properties.IsColumnar); - this.Observers = new List, TSource>>(); + this.Observers = []; this.batches = new StreamMessage, TSource>[totalBranchesL2]; for (int i = 0; i < totalBranchesL2; i++) @@ -652,7 +652,7 @@ public ShufflePipe( this.errorMessages = stream.ErrorMessages; this.l1Pool = MemoryManager.GetMemoryPool(stream.Properties.IsColumnar); - this.Observers = new List>(); + this.Observers = []; this.batches = new StreamMessage[totalBranchesL2]; for (int i = 0; i < totalBranchesL2; i++) @@ -926,7 +926,7 @@ public ShuffleSameKeyPipe( this.errorMessages = stream.ErrorMessages; this.l1Pool = MemoryManager.GetMemoryPool(stream.Properties.IsColumnar); - this.Observers = new List>(); + this.Observers = []; this.batches = new StreamMessage[totalBranchesL2]; for (int i = 0; i < totalBranchesL2; i++) diff --git a/Sources/Core/Microsoft.StreamProcessing/Operators/Shufflecast/ShufflecastPipe.cs b/Sources/Core/Microsoft.StreamProcessing/Operators/Shufflecast/ShufflecastPipe.cs index 5ed3ef894..8c345448e 100644 --- a/Sources/Core/Microsoft.StreamProcessing/Operators/Shufflecast/ShufflecastPipe.cs +++ b/Sources/Core/Microsoft.StreamProcessing/Operators/Shufflecast/ShufflecastPipe.cs @@ -47,7 +47,7 @@ public ShufflecastPipe( this.l1Pool = MemoryManager.GetMemoryPool(stream.Properties.IsColumnar); this.l1Pool.GetBV(out this.resetBV); for (int i = 0; i < this.resetBV.col.Length; i++) this.resetBV.col[i] = ~0; - this.Observers = new List>(); + this.Observers = []; } public void AddObserver(IStreamObserver observer) => this.Observers.Add(observer); diff --git a/Sources/Core/Microsoft.StreamProcessing/Operators/SnapshotWindow/AggregateTempateClasses.cs b/Sources/Core/Microsoft.StreamProcessing/Operators/SnapshotWindow/AggregateTempateClasses.cs index 1bbf7a97a..a81cb1dd0 100644 --- a/Sources/Core/Microsoft.StreamProcessing/Operators/SnapshotWindow/AggregateTempateClasses.cs +++ b/Sources/Core/Microsoft.StreamProcessing/Operators/SnapshotWindow/AggregateTempateClasses.cs @@ -88,7 +88,7 @@ public static Tuple Generate(Snapsh template.outputFields = new ColumnarRepresentation(outputType).AllFields; - assemblyReferences = new List(); + assemblyReferences = []; #region Key Comparer IEqualityComparerExpression keyComparer; diff --git a/Sources/Core/Microsoft.StreamProcessing/Operators/SnapshotWindow/Hopping/PartitionedSnapshotWindowHoppingPipe.cs b/Sources/Core/Microsoft.StreamProcessing/Operators/SnapshotWindow/Hopping/PartitionedSnapshotWindowHoppingPipe.cs index 7f8bd7ab9..f5b7b3d24 100644 --- a/Sources/Core/Microsoft.StreamProcessing/Operators/SnapshotWindow/Hopping/PartitionedSnapshotWindowHoppingPipe.cs +++ b/Sources/Core/Microsoft.StreamProcessing/Operators/SnapshotWindow/Hopping/PartitionedSnapshotWindowHoppingPipe.cs @@ -466,7 +466,7 @@ private sealed class PartitionEntry [DataMember] public CircularBuffer ecq; [DataMember] - public HashSet heldAggregates = new HashSet(); + public HashSet heldAggregates = []; [DataMember] public long lastSyncTime = long.MinValue; } diff --git a/Sources/Core/Microsoft.StreamProcessing/Operators/SnapshotWindow/Hopping/SnapshotWindowHoppingPipe.cs b/Sources/Core/Microsoft.StreamProcessing/Operators/SnapshotWindow/Hopping/SnapshotWindowHoppingPipe.cs index 057c502ce..831a07490 100644 --- a/Sources/Core/Microsoft.StreamProcessing/Operators/SnapshotWindow/Hopping/SnapshotWindowHoppingPipe.cs +++ b/Sources/Core/Microsoft.StreamProcessing/Operators/SnapshotWindow/Hopping/SnapshotWindowHoppingPipe.cs @@ -54,7 +54,7 @@ internal sealed class SnapshotWindowHoppingPipe : [DataMember] private FastDictionary2> aggregateByKey; [DataMember] - private HashSet heldAggregates = new HashSet(); + private HashSet heldAggregates = []; [DataMember] private CircularBuffer ecq; [DataMember] diff --git a/Sources/Core/Microsoft.StreamProcessing/Operators/SnapshotWindow/PriorityQueue/PartitionedSnapshotWindowPriorityQueuePipe.cs b/Sources/Core/Microsoft.StreamProcessing/Operators/SnapshotWindow/PriorityQueue/PartitionedSnapshotWindowPriorityQueuePipe.cs index cca149633..d81d75a74 100644 --- a/Sources/Core/Microsoft.StreamProcessing/Operators/SnapshotWindow/PriorityQueue/PartitionedSnapshotWindowPriorityQueuePipe.cs +++ b/Sources/Core/Microsoft.StreamProcessing/Operators/SnapshotWindow/PriorityQueue/PartitionedSnapshotWindowPriorityQueuePipe.cs @@ -434,9 +434,9 @@ protected override void DisposeState() private sealed class PartitionEntry { [DataMember] - public HashSet heldAggregates = new HashSet(); + public HashSet heldAggregates = []; [DataMember] - public SortedDictionary>> ecq = new SortedDictionary>>(); + public SortedDictionary>> ecq = []; [DataMember] public long lastSyncTime = long.MinValue; } diff --git a/Sources/Core/Microsoft.StreamProcessing/Operators/SnapshotWindow/PriorityQueue/PartitionedSnapshotWindowPriorityQueuePipeSimple.cs b/Sources/Core/Microsoft.StreamProcessing/Operators/SnapshotWindow/PriorityQueue/PartitionedSnapshotWindowPriorityQueuePipeSimple.cs index bd51b2b16..45e2cc3d4 100644 --- a/Sources/Core/Microsoft.StreamProcessing/Operators/SnapshotWindow/PriorityQueue/PartitionedSnapshotWindowPriorityQueuePipeSimple.cs +++ b/Sources/Core/Microsoft.StreamProcessing/Operators/SnapshotWindow/PriorityQueue/PartitionedSnapshotWindowPriorityQueuePipeSimple.cs @@ -360,7 +360,7 @@ protected override void DisposeState() private sealed class PartitionEntry { [DataMember] - public SortedDictionary> ecq = new SortedDictionary>(); + public SortedDictionary> ecq = []; [DataMember] public long lastSyncTime = long.MinValue; diff --git a/Sources/Core/Microsoft.StreamProcessing/Operators/SnapshotWindow/PriorityQueue/SnapshotWindowPriorityQueuePipe.cs b/Sources/Core/Microsoft.StreamProcessing/Operators/SnapshotWindow/PriorityQueue/SnapshotWindowPriorityQueuePipe.cs index 31de19c5c..718340c07 100644 --- a/Sources/Core/Microsoft.StreamProcessing/Operators/SnapshotWindow/PriorityQueue/SnapshotWindowPriorityQueuePipe.cs +++ b/Sources/Core/Microsoft.StreamProcessing/Operators/SnapshotWindow/PriorityQueue/SnapshotWindowPriorityQueuePipe.cs @@ -54,9 +54,9 @@ internal sealed class SnapshotWindowPriorityQueuePipe> aggregateByKey; [DataMember] - private HashSet heldAggregates = new HashSet(); + private HashSet heldAggregates = []; [DataMember] - private SortedDictionary>> ecq = new SortedDictionary>>(); + private SortedDictionary>> ecq = []; [DataMember] private long lastSyncTime = long.MinValue; diff --git a/Sources/Core/Microsoft.StreamProcessing/Operators/SnapshotWindow/PriorityQueue/SnapshotWindowPriorityQueuePipeSimple.cs b/Sources/Core/Microsoft.StreamProcessing/Operators/SnapshotWindow/PriorityQueue/SnapshotWindowPriorityQueuePipeSimple.cs index cf82f67aa..9d8d7d82e 100644 --- a/Sources/Core/Microsoft.StreamProcessing/Operators/SnapshotWindow/PriorityQueue/SnapshotWindowPriorityQueuePipeSimple.cs +++ b/Sources/Core/Microsoft.StreamProcessing/Operators/SnapshotWindow/PriorityQueue/SnapshotWindowPriorityQueuePipeSimple.cs @@ -44,7 +44,7 @@ internal sealed class SnapshotWindowPriorityQueuePipeSimple batch; [DataMember] - private SortedDictionary> ecq = new SortedDictionary>(); + private SortedDictionary> ecq = []; [DataMember] private long lastSyncTime = long.MinValue; [DataMember] diff --git a/Sources/Core/Microsoft.StreamProcessing/Operators/SnapshotWindow/Sliding/PartitionedSnapshotWindowSlidingPipe.cs b/Sources/Core/Microsoft.StreamProcessing/Operators/SnapshotWindow/Sliding/PartitionedSnapshotWindowSlidingPipe.cs index 145da4400..4d090665a 100644 --- a/Sources/Core/Microsoft.StreamProcessing/Operators/SnapshotWindow/Sliding/PartitionedSnapshotWindowSlidingPipe.cs +++ b/Sources/Core/Microsoft.StreamProcessing/Operators/SnapshotWindow/Sliding/PartitionedSnapshotWindowSlidingPipe.cs @@ -462,9 +462,9 @@ private sealed class EcqState private sealed class PartitionEntry { [DataMember] - public ElasticCircularBuffer ecq = new ElasticCircularBuffer(); + public ElasticCircularBuffer ecq = []; [DataMember] - public HashSet heldAggregates = new HashSet(); + public HashSet heldAggregates = []; [DataMember] public long lastSyncTime = long.MinValue; } diff --git a/Sources/Core/Microsoft.StreamProcessing/Operators/SnapshotWindow/Sliding/PartitionedSnapshotWindowSlidingPipeSimple.cs b/Sources/Core/Microsoft.StreamProcessing/Operators/SnapshotWindow/Sliding/PartitionedSnapshotWindowSlidingPipeSimple.cs index 2af3ccb17..466f21932 100644 --- a/Sources/Core/Microsoft.StreamProcessing/Operators/SnapshotWindow/Sliding/PartitionedSnapshotWindowSlidingPipeSimple.cs +++ b/Sources/Core/Microsoft.StreamProcessing/Operators/SnapshotWindow/Sliding/PartitionedSnapshotWindowSlidingPipeSimple.cs @@ -361,7 +361,7 @@ protected override void DisposeState() private sealed class PartitionEntry { [DataMember] - public ElasticCircularBuffer> ecq = new ElasticCircularBuffer>(); + public ElasticCircularBuffer> ecq = []; [DataMember] public long lastSyncTime = long.MinValue; diff --git a/Sources/Core/Microsoft.StreamProcessing/Operators/SnapshotWindow/Sliding/SnapshotWindowSlidingPipe.cs b/Sources/Core/Microsoft.StreamProcessing/Operators/SnapshotWindow/Sliding/SnapshotWindowSlidingPipe.cs index 39b912ca1..ba7d465de 100644 --- a/Sources/Core/Microsoft.StreamProcessing/Operators/SnapshotWindow/Sliding/SnapshotWindowSlidingPipe.cs +++ b/Sources/Core/Microsoft.StreamProcessing/Operators/SnapshotWindow/Sliding/SnapshotWindowSlidingPipe.cs @@ -54,7 +54,7 @@ internal sealed class SnapshotWindowSlidingPipe : [DataMember] private FastDictionary2> aggregateByKey; [DataMember] - private HashSet heldAggregates = new HashSet(); + private HashSet heldAggregates = []; [DataMember] private ElasticCircularBuffer ecq; [DataMember] @@ -92,7 +92,7 @@ public SnapshotWindowSlidingPipe( this.batch.Allocate(); this.aggregateByKey = comparer.CreateFastDictionary2Generator>(1, this.keyComparerEquals, this.keyComparerGetHashCode, stream.Properties.QueryContainer).Invoke(); - this.ecq = new ElasticCircularBuffer(); + this.ecq = []; var stateDictGenerator = comparer.CreateFastDictionaryGenerator>(1, this.keyComparerEquals, this.keyComparerGetHashCode, stream.Properties.QueryContainer); this.ecqEntryPool = new DataStructurePool>>(() => stateDictGenerator.Invoke()); } diff --git a/Sources/Core/Microsoft.StreamProcessing/Operators/SnapshotWindow/Sliding/SnapshotWindowSlidingPipeSimple.cs b/Sources/Core/Microsoft.StreamProcessing/Operators/SnapshotWindow/Sliding/SnapshotWindowSlidingPipeSimple.cs index 36fd57556..51fd825bb 100644 --- a/Sources/Core/Microsoft.StreamProcessing/Operators/SnapshotWindow/Sliding/SnapshotWindowSlidingPipeSimple.cs +++ b/Sources/Core/Microsoft.StreamProcessing/Operators/SnapshotWindow/Sliding/SnapshotWindowSlidingPipeSimple.cs @@ -78,7 +78,7 @@ public SnapshotWindowSlidingPipeSimple( this.pool.Get(out this.batch); this.batch.Allocate(); - this.ecq = new ElasticCircularBuffer>(); + this.ecq = []; } public override void ProduceQueryPlan(PlanNode previous) diff --git a/Sources/Core/Microsoft.StreamProcessing/Operators/SnapshotWindow/StartEdge/PartitionedSnapshotWindowStartEdgePipe.cs b/Sources/Core/Microsoft.StreamProcessing/Operators/SnapshotWindow/StartEdge/PartitionedSnapshotWindowStartEdgePipe.cs index 1f4923159..1ed314e9d 100644 --- a/Sources/Core/Microsoft.StreamProcessing/Operators/SnapshotWindow/StartEdge/PartitionedSnapshotWindowStartEdgePipe.cs +++ b/Sources/Core/Microsoft.StreamProcessing/Operators/SnapshotWindow/StartEdge/PartitionedSnapshotWindowStartEdgePipe.cs @@ -294,7 +294,7 @@ protected override void DisposeState() private sealed class PartitionEntry { [DataMember] - public HashSet heldAggregates = new HashSet(); + public HashSet heldAggregates = []; [DataMember] public long lastSyncTime = long.MinValue; } diff --git a/Sources/Core/Microsoft.StreamProcessing/Operators/SnapshotWindow/StartEdge/SnapshotWindowStartEdgePipe.cs b/Sources/Core/Microsoft.StreamProcessing/Operators/SnapshotWindow/StartEdge/SnapshotWindowStartEdgePipe.cs index 3da156a68..82d952425 100644 --- a/Sources/Core/Microsoft.StreamProcessing/Operators/SnapshotWindow/StartEdge/SnapshotWindowStartEdgePipe.cs +++ b/Sources/Core/Microsoft.StreamProcessing/Operators/SnapshotWindow/StartEdge/SnapshotWindowStartEdgePipe.cs @@ -46,7 +46,7 @@ internal sealed class SnapshotWindowStartEdgePipe [DataMember] private FastDictionary2> aggregateByKey; [DataMember] - private HashSet heldAggregates = new HashSet(); + private HashSet heldAggregates = []; [DataMember] private long lastSyncTime = long.MinValue; diff --git a/Sources/Core/Microsoft.StreamProcessing/Operators/SprayGroupImport/SprayGroupImportPipe.cs b/Sources/Core/Microsoft.StreamProcessing/Operators/SprayGroupImport/SprayGroupImportPipe.cs index 174dbb335..8fc2baff0 100644 --- a/Sources/Core/Microsoft.StreamProcessing/Operators/SprayGroupImport/SprayGroupImportPipe.cs +++ b/Sources/Core/Microsoft.StreamProcessing/Operators/SprayGroupImport/SprayGroupImportPipe.cs @@ -47,7 +47,7 @@ public SynchronousGAPipe( this.l1_spray = 0; - this.Observers = new List>(); + this.Observers = []; this.pool = MemoryManager.GetMemoryPool(stream.Properties.IsColumnar); } diff --git a/Sources/Core/Microsoft.StreamProcessing/Operators/Stitch/PartitionedStitchPipe.cs b/Sources/Core/Microsoft.StreamProcessing/Operators/Stitch/PartitionedStitchPipe.cs index ad7b83ae9..9b0f87d5c 100644 --- a/Sources/Core/Microsoft.StreamProcessing/Operators/Stitch/PartitionedStitchPipe.cs +++ b/Sources/Core/Microsoft.StreamProcessing/Operators/Stitch/PartitionedStitchPipe.cs @@ -105,7 +105,7 @@ private static void InsertOrAppend(FastDictionary2> events, K k } else { - lst = new List(); + lst = []; events.Insert(key, lst); lst.Add(value); } @@ -225,7 +225,7 @@ public override unsafe void OnNext(StreamMessage input) if ((src_bv[i >> 6] & (1L << (i & 0x3f))) == 0 || *vother < 0) { var partitionKey = this.getPartitionKey(input.key.col[i]); - if (!this.ClosedEvents.Lookup(partitionKey, out this.ClosedEventsIndex)) this.ClosedEvents.Insert(ref this.ClosedEventsIndex, partitionKey, new SortedDictionary>>()); + if (!this.ClosedEvents.Lookup(partitionKey, out this.ClosedEventsIndex)) this.ClosedEvents.Insert(ref this.ClosedEventsIndex, partitionKey, []); if (!this.OpenEvents.Lookup(partitionKey, out this.OpenEventsIndex)) this.OpenEvents.Insert(ref this.OpenEventsIndex, partitionKey, this.OpenEventsGenerator()); if (!this.now.Lookup(partitionKey, out this.nowIndex)) this.now.Insert(ref this.nowIndex, partitionKey, StreamEvent.MinSyncTime); if (!this.CurrentTimeOpenEventBufferTime.Lookup(partitionKey, out this.CurrentTimeOpenEventBufferTimeIndex)) this.CurrentTimeOpenEventBufferTime.Insert(ref this.CurrentTimeOpenEventBufferTimeIndex, partitionKey, StreamEvent.MinSyncTime); diff --git a/Sources/Core/Microsoft.StreamProcessing/Operators/Stitch/StitchPipe.cs b/Sources/Core/Microsoft.StreamProcessing/Operators/Stitch/StitchPipe.cs index c2c867553..ddcc81adf 100644 --- a/Sources/Core/Microsoft.StreamProcessing/Operators/Stitch/StitchPipe.cs +++ b/Sources/Core/Microsoft.StreamProcessing/Operators/Stitch/StitchPipe.cs @@ -45,7 +45,7 @@ internal sealed class StitchPipe : UnaryPipe>> ClosedEvents = - new SortedDictionary>>(); + []; [Obsolete("Used only by serialization. Do not call directly.")] public StitchPipe() { } @@ -81,7 +81,7 @@ private static void InsertOrAppend(FastDictionary2> events, K k } else { - lst = new List(); + lst = []; events.Insert(key, lst); lst.Add(value); } diff --git a/Sources/Core/Microsoft.StreamProcessing/Operators/Union/PartitionedUnionPipe.cs b/Sources/Core/Microsoft.StreamProcessing/Operators/Union/PartitionedUnionPipe.cs index d6e6e6ac5..6e4df5c5b 100644 --- a/Sources/Core/Microsoft.StreamProcessing/Operators/Union/PartitionedUnionPipe.cs +++ b/Sources/Core/Microsoft.StreamProcessing/Operators/Union/PartitionedUnionPipe.cs @@ -22,11 +22,11 @@ internal sealed class PartitionedUnionPipe : Bina [DataMember] private FastDictionary2> rightQueue = new FastDictionary2>(); [DataMember] - private HashSet processQueue = new HashSet(); + private HashSet processQueue = []; [DataMember] - private HashSet seenKeys = new HashSet(); + private HashSet seenKeys = []; [DataMember] - private HashSet cleanKeys = new HashSet(); + private HashSet cleanKeys = []; [DataMember] private StreamMessage output; @@ -56,8 +56,8 @@ public PartitionedUnionPipe(IStreamable stream, IStreamObserver< private void NewPartition(TPartitionKey pKey) { - this.leftQueue.Insert(pKey, new PooledElasticCircularBuffer()); - this.rightQueue.Insert(pKey, new PooledElasticCircularBuffer()); + this.leftQueue.Insert(pKey, []); + this.rightQueue.Insert(pKey, []); if (!this.nextLeftTime.Lookup(pKey, out int left)) this.nextLeftTime.Insert(ref left, pKey, StreamEvent.MinSyncTime); if (!this.nextRightTime.Lookup(pKey, out int right)) this.nextRightTime.Insert(ref right, pKey, StreamEvent.MinSyncTime); diff --git a/Sources/Core/Microsoft.StreamProcessing/Operators/Where/MultiStringTransforms.cs b/Sources/Core/Microsoft.StreamProcessing/Operators/Where/MultiStringTransforms.cs index 671081067..17f33e899 100644 --- a/Sources/Core/Microsoft.StreamProcessing/Operators/Where/MultiStringTransforms.cs +++ b/Sources/Core/Microsoft.StreamProcessing/Operators/Where/MultiStringTransforms.cs @@ -33,7 +33,7 @@ public static MultiStringTransformationResult Transform(Type t, Expression e) return new MultiStringTransformationResult { vectorOperation = string.Join("\n", vectorStatements), - wrapperTable = new Dictionary(), + wrapperTable = [], }; } var wrapperVisitor = new WrapperTransformer(t); @@ -149,7 +149,7 @@ public static bool IsStaticRegexMatch(MethodCallExpression methodCall, Type batc private sealed class Vectorize : ExpressionVisitor { private static int counter = 0; - public List vectorStatements = new List(); + public List vectorStatements = []; private string incomingBV = "batch.bitvector"; private bool inPlace = false; private string resultBV; @@ -346,7 +346,7 @@ private static bool MultiStringHasVectorImplementation(string methodName) private class WrapperTransformer : ExpressionVisitor { private readonly Type batchType; - public Dictionary multiStringTable = new Dictionary(); + public Dictionary multiStringTable = []; public WrapperTransformer(Type t) => this.batchType = t; diff --git a/Sources/Core/Microsoft.StreamProcessing/Pipes/BinaryPipe.cs b/Sources/Core/Microsoft.StreamProcessing/Pipes/BinaryPipe.cs index 2c5ef1f0e..3b14ca8a8 100644 --- a/Sources/Core/Microsoft.StreamProcessing/Pipes/BinaryPipe.cs +++ b/Sources/Core/Microsoft.StreamProcessing/Pipes/BinaryPipe.cs @@ -183,6 +183,9 @@ public override void OnCompleted() Monitor.Enter(this.sync); try { + // Process any batches that were enqueued while another thread held the lock above. + // Monitor is reentrant, so ProcessPendingBatches()'s TryEnter will succeed here. + ProcessPendingBatches(); base.OnCompleted(); while (this.leftQueue.TryDequeue(out var leftBatch)) diff --git a/Sources/Core/Microsoft.StreamProcessing/Pipes/BinaryPlanNode.cs b/Sources/Core/Microsoft.StreamProcessing/Pipes/BinaryPlanNode.cs index 8b3683a8b..a778332ef 100644 --- a/Sources/Core/Microsoft.StreamProcessing/Pipes/BinaryPlanNode.cs +++ b/Sources/Core/Microsoft.StreamProcessing/Pipes/BinaryPlanNode.cs @@ -140,7 +140,7 @@ internal JoinPlanNode( /// /// Returns the set of expressions employed by the current node to compute the join. /// - public Dictionary JoinExpressions { get; } = new Dictionary(); + public Dictionary JoinExpressions { get; } = []; } /// diff --git a/Sources/Core/Microsoft.StreamProcessing/QueryContainer.cs b/Sources/Core/Microsoft.StreamProcessing/QueryContainer.cs index 4eb1d6c72..bdd3436d0 100644 --- a/Sources/Core/Microsoft.StreamProcessing/QueryContainer.cs +++ b/Sources/Core/Microsoft.StreamProcessing/QueryContainer.cs @@ -9,6 +9,7 @@ using System.IO; using System.Linq; using System.Reflection; +using System.Threading; using Microsoft.StreamProcessing.Serializer; namespace Microsoft.StreamProcessing @@ -18,7 +19,7 @@ namespace Microsoft.StreamProcessing /// public sealed class QueryContainer { - private readonly object sentinel = new object(); + private readonly Lock sentinel = new(); /// /// ISurrogate to be used in serialization in checkpoints and serialized StreamMessage @@ -26,11 +27,11 @@ public sealed class QueryContainer /// public ISurrogate Surrogate { get; } - private readonly HashSet ingressSites = new HashSet(); - private readonly HashSet egressSites = new HashSet(); + private readonly HashSet ingressSites = []; + private readonly HashSet egressSites = []; - private readonly Dictionary ingressPipes = new Dictionary(); - private readonly Dictionary egressPipes = new Dictionary(); + private readonly Dictionary ingressPipes = []; + private readonly Dictionary egressPipes = []; private readonly ConcurrentDictionary, Type> sortedDictionaryTypes = new ConcurrentDictionary, Type>(); private readonly ConcurrentDictionary, Type> fastDictionaryTypes = new ConcurrentDictionary, Type>(); @@ -102,7 +103,7 @@ internal object GetOrCreateSerializer(Type type) { if (this.serializers.TryGetValue(type, out object serializer)) return serializer; var serializerStatic = typeof(StreamSerializer); - var method = serializerStatic.GetTypeInfo().GetMethod("Create", new Type[] { typeof(SerializerSettings) }).MakeGenericMethod(type); + var method = serializerStatic.GetTypeInfo().GetMethod("Create", [typeof(SerializerSettings)]).MakeGenericMethod(type); var settings = new SerializerSettings() { KnownTypes = this.CollectedGeneratedTypes, @@ -124,21 +125,19 @@ internal IEnumerable CollectedGeneratedTypes /// A Process object that represents an active, running query that can be checkpointed. public Process Restore(Stream inputStream = null) { - lock (this.sentinel) - { - // Restoration should not happen until after all streams have been both registered and subscribed - if (this.ingressSites.Count != this.ingressPipes.Count) throw new StreamProcessingException("Not all input data sources have been subscribed to."); - if (this.egressSites.Count != this.egressPipes.Count) throw new StreamProcessingException("Not all output data sources have been subscribed to."); + using var _ = sentinel.EnterScope(); + // Restoration should not happen until after all streams have been both registered and subscribed + if (this.ingressSites.Count != this.ingressPipes.Count) throw new StreamProcessingException("Not all input data sources have been subscribed to."); + if (this.egressSites.Count != this.egressPipes.Count) throw new StreamProcessingException("Not all output data sources have been subscribed to."); - var process = new Process(this.ingressPipes.Clone(), this.egressPipes.Clone()); + var process = new Process(this.ingressPipes.Clone(), this.egressPipes.Clone()); - process.Restore(inputStream); + process.Restore(inputStream); - this.ingressPipes.Clear(); - this.egressPipes.Clear(); + this.ingressPipes.Clear(); + this.egressPipes.Clear(); - return process; - } + return process; } } @@ -151,7 +150,7 @@ public sealed class Process private const int CheckpointVersionMinor = 0; private const int CheckpointVersionRevision = 0; - private readonly object sentinel = new object(); + private readonly Lock sentinel = new(); private readonly Dictionary IngressPipes; private Dictionary queryPlans; @@ -171,75 +170,79 @@ internal Process(Dictionary ingress, Dictionary< public void Checkpoint(Stream outputStream) { Invariant.IsNotNull(outputStream, nameof(outputStream)); - lock (this.sentinel) + using var _ = this.sentinel.EnterScope(); + Span buffer = stackalloc byte[sizeof(int) * 3]; + BitConverter.TryWriteBytes(buffer, CheckpointVersionMajor); + BitConverter.TryWriteBytes(buffer[sizeof(int)..], CheckpointVersionMinor); + BitConverter.TryWriteBytes(buffer[(2 * sizeof(int))..], CheckpointVersionRevision); + outputStream.Write(buffer); + + try { - outputStream.Write(BitConverter.GetBytes(CheckpointVersionMajor), 0, sizeof(int)); - outputStream.Write(BitConverter.GetBytes(CheckpointVersionMinor), 0, sizeof(int)); - outputStream.Write(BitConverter.GetBytes(CheckpointVersionRevision), 0, sizeof(int)); - - try + foreach (var pipe in this.IngressPipes.Values) { - foreach (var pipe in this.IngressPipes.Values) - { - pipe.Checkpoint(outputStream); - } + pipe.Checkpoint(outputStream); } - catch (Exception) + } + catch (Exception) + { + foreach (var pipe in this.IngressPipes.Values) { - foreach (var pipe in this.IngressPipes.Values) - { - pipe.Reset(); - } - throw; + pipe.Reset(); } + throw; } } internal void Restore(Stream inputStream) { - lock (this.sentinel) + using var _ = this.sentinel.EnterScope(); + if (inputStream != null) { - if (inputStream != null) + Span buffer = stackalloc byte[sizeof(int) * 3]; + try { - byte[] buffer = new byte[sizeof(int)]; - inputStream.Read(buffer, 0, sizeof(int)); - int major = BitConverter.ToInt32(buffer, 0); - inputStream.Read(buffer, 0, sizeof(int)); - int minor = BitConverter.ToInt32(buffer, 0); - inputStream.Read(buffer, 0, sizeof(int)); - int revision = BitConverter.ToInt32(buffer, 0); - - if (major != CheckpointVersionMajor || minor != CheckpointVersionMinor || revision != CheckpointVersionRevision) - { - throw new StreamProcessingException( - string.Format( - CultureInfo.InvariantCulture, - "Version mismatch between the stream state and the engine. Expected: {0}.{1}.{2}, Found: {3}.{4}.{5}", - CheckpointVersionMajor, - CheckpointVersionMinor, - CheckpointVersionRevision, - major, - minor, - revision)); - } + inputStream.ReadExactly(buffer); + } + catch (EndOfStreamException e) + { + throw new StreamProcessingException("Failed to read checkpoint version information from the stream.", e); } - try + int major = BitConverter.ToInt32(buffer); + int minor = BitConverter.ToInt32(buffer[sizeof(int)..]); + int revision = BitConverter.ToInt32(buffer[(2 * sizeof(int))..]); + + if (major != CheckpointVersionMajor || minor != CheckpointVersionMinor || revision != CheckpointVersionRevision) { - foreach (var pipe in this.IngressPipes.Values) - { - pipe.Restore(inputStream); - } + throw new StreamProcessingException( + string.Format( + CultureInfo.InvariantCulture, + "Version mismatch between the stream state and the engine. Expected: {0}.{1}.{2}, Found: {3}.{4}.{5}", + CheckpointVersionMajor, + CheckpointVersionMinor, + CheckpointVersionRevision, + major, + minor, + revision)); } - catch (Exception) + } + + try + { + foreach (var pipe in this.IngressPipes.Values) { - foreach (var pipe in this.IngressPipes.Values) - { - pipe.Reset(); - } - throw; + pipe.Restore(inputStream); } } + catch (Exception) + { + foreach (var pipe in this.IngressPipes.Values) + { + pipe.Reset(); + } + throw; + } } /// @@ -247,23 +250,21 @@ internal void Restore(Stream inputStream) /// public void Flush() { - lock (this.sentinel) + using var _ = this.sentinel.EnterScope(); + try { - try + foreach (var pipe in this.IngressPipes.Values) { - foreach (var pipe in this.IngressPipes.Values) - { - pipe.OnFlush(); - } + pipe.OnFlush(); } - catch (Exception) + } + catch (Exception) + { + foreach (var pipe in this.IngressPipes.Values) { - foreach (var pipe in this.IngressPipes.Values) - { - pipe.Reset(); - } - throw; + pipe.Reset(); } + throw; } } @@ -298,7 +299,7 @@ public Dictionary QueryPlan { if (this.queryPlans == null) { - this.queryPlans = new Dictionary(); + this.queryPlans = []; foreach (var i in this.IngressPipes) { i.Value.ProduceQueryPlan(null); diff --git a/Sources/Core/Microsoft.StreamProcessing/Serializer/Encoders/BinaryDecoder.cs b/Sources/Core/Microsoft.StreamProcessing/Serializer/Encoders/BinaryDecoder.cs index 8392f8475..35880a25c 100644 --- a/Sources/Core/Microsoft.StreamProcessing/Serializer/Encoders/BinaryDecoder.cs +++ b/Sources/Core/Microsoft.StreamProcessing/Serializer/Encoders/BinaryDecoder.cs @@ -3,6 +3,7 @@ // Licensed under the MIT License // ********************************************************************* using System; +using System.Buffers; using System.IO; using System.Runtime.Serialization; using System.Text; @@ -110,18 +111,15 @@ public ulong DecodeULong() public float DecodeFloat() { - var value = new byte[4]; + Span value = stackalloc byte[4]; ReadAllRequiredBytes(value); - if (!BitConverter.IsLittleEndian) - { - Array.Reverse(value); - } - return BitConverter.ToSingle(value, 0); + if (!BitConverter.IsLittleEndian) value.Reverse(); + return BitConverter.ToSingle(value); } public double DecodeDouble() { - var value = new byte[8]; + Span value = stackalloc byte[8]; ReadAllRequiredBytes(value); long longValue = value[0] | (long)value[1] << 0x8 @@ -142,7 +140,21 @@ public byte[] DecodeByteArray() return array; } - public string DecodeString() => Encoding.UTF8.GetString(DecodeByteArray()); + public string DecodeString() + { + int byteCount = DecodeInt(); + if (byteCount == 0) return string.Empty; + var rented = ArrayPool.Shared.Rent(byteCount); + try + { + ReadAllRequiredBytes(rented.AsSpan(0, byteCount)); + return Encoding.UTF8.GetString(rented, 0, byteCount); + } + finally + { + ArrayPool.Shared.Return(rented); + } + } public int DecodeArrayChunk() { @@ -157,9 +169,9 @@ public int DecodeArrayChunk() public Guid DecodeGuid() { - var array = new byte[16]; - ReadAllRequiredBytes(array); - return new Guid(array); + Span value = stackalloc byte[16]; + ReadAllRequiredBytes(value); + return new Guid(value); } private void ReadAllRequiredBytes(byte[] array) @@ -172,15 +184,26 @@ private void ReadAllRequiredBytes(byte[] array) } } + private void ReadAllRequiredBytes(Span span) + { + int totalRead = 0; + while (totalRead < span.Length) + { + int read = this.stream.Read(span.Slice(totalRead)); + if (read == 0) + throw new SerializationException($"Unexpected end of stream: '{span.Length - totalRead}' bytes missing."); + totalRead += read; + } + } + private int ReadIntFixed() { - var value = new byte[4]; - this.stream.ReadAllRequiredBytes(value, 0, value.Length); - int intValue = value[0] + Span value = stackalloc byte[4]; + ReadAllRequiredBytes(value); + return value[0] | value[1] << 0x8 | value[2] << 0x10 | value[3] << 0x18; - return intValue; } public unsafe T[] DecodeArray() where T : struct diff --git a/Sources/Core/Microsoft.StreamProcessing/Serializer/Encoders/BinaryEncoder.cs b/Sources/Core/Microsoft.StreamProcessing/Serializer/Encoders/BinaryEncoder.cs index dd944275e..902c15699 100644 --- a/Sources/Core/Microsoft.StreamProcessing/Serializer/Encoders/BinaryEncoder.cs +++ b/Sources/Core/Microsoft.StreamProcessing/Serializer/Encoders/BinaryEncoder.cs @@ -3,6 +3,7 @@ // Licensed under the MIT License // ********************************************************************* using System; +using System.Buffers; using System.IO; using System.Text; using Microsoft.StreamProcessing.Internal; @@ -83,13 +84,10 @@ public void Encode(ulong value) public void Encode(float value) { - byte[] bytes = BitConverter.GetBytes(value); - if (!BitConverter.IsLittleEndian) - { - Array.Reverse(bytes); - } - - this.stream.Write(bytes, 0, bytes.Length); + Span bytes = stackalloc byte[4]; + BitConverter.TryWriteBytes(bytes, value); + if (!BitConverter.IsLittleEndian) bytes.Reverse(); + this.stream.Write(bytes); } public void Encode(double value) @@ -113,12 +111,40 @@ public void Encode(byte[] value) if (value.Length > 0) this.stream.Write(value, 0, value.Length); } + public void Encode(ReadOnlySpan span) + { + int count = span.Length; + Encode(count); + if (count > 0) + { + this.stream.Write(span); + } + } + public void Encode(string value) - => Encode(Encoding.UTF8.GetBytes(value ?? throw new ArgumentNullException(nameof(value)))); + { + if (value == null) throw new ArgumentNullException(nameof(value)); + int byteCount = Encoding.UTF8.GetByteCount(value); + var rented = ArrayPool.Shared.Rent(byteCount); + try + { + int written = Encoding.UTF8.GetBytes(value, rented); + Encode(rented.AsSpan(0, written)); + } + finally + { + ArrayPool.Shared.Return(rented); + } + } public void EncodeArrayChunk(int size) => Encode(size); - public void Encode(Guid value) => this.stream.Write(value.ToByteArray(), 0, 16); + public void Encode(Guid value) + { + Span bytes = stackalloc byte[16]; + value.TryWriteBytes(bytes); + this.stream.Write(bytes); + } private void WriteIntFixed(int encodedValue) { diff --git a/Sources/Core/Microsoft.StreamProcessing/Serializer/GeneratedSubtypes/FastDictionaryGenerator.cs b/Sources/Core/Microsoft.StreamProcessing/Serializer/GeneratedSubtypes/FastDictionaryGenerator.cs index 4393bacc6..615acd948 100644 --- a/Sources/Core/Microsoft.StreamProcessing/Serializer/GeneratedSubtypes/FastDictionaryGenerator.cs +++ b/Sources/Core/Microsoft.StreamProcessing/Serializer/GeneratedSubtypes/FastDictionaryGenerator.cs @@ -15,7 +15,7 @@ internal static class FastDictionaryGenerator private const string Prefix = "GeneratedFastDictionary_"; private static readonly object sentinel = new object(); private static int classCounter = 0; - private static readonly Dictionary, Type> generatorCache = new Dictionary, Type>(); + private static readonly Dictionary, Type> generatorCache = []; public static Func> CreateFastDictionaryGenerator( this IEqualityComparerExpression comparerExp, int capacity, Func equalsFunc, Func getHashCodeFunc, QueryContainer container) @@ -61,7 +61,7 @@ internal static class FastDictionaryGenerator2 private const string Prefix = "GeneratedFastDictionary2_"; private static readonly object sentinel = new object(); private static int classCounter = 0; - private static readonly Dictionary, Type> generatorCache = new Dictionary, Type>(); + private static readonly Dictionary, Type> generatorCache = []; public static Func> CreateFastDictionary2Generator( this IEqualityComparerExpression comparerExp, int capacity, Func equalsFunc, Func getHashCodeFunc, QueryContainer container) @@ -107,7 +107,7 @@ internal static class FastDictionaryGenerator3 private const string Prefix = "GeneratedFastDictionary3_"; private static readonly object sentinel = new object(); private static int classCounter = 0; - private static readonly Dictionary, Type> generatorCache = new Dictionary, Type>(); + private static readonly Dictionary, Type> generatorCache = []; public static Func> CreateFastDictionary3Generator( this IEqualityComparerExpression comparerExp, int capacity, Func equalsFunc, Func getHashCodeFunc, QueryContainer container) diff --git a/Sources/Core/Microsoft.StreamProcessing/Serializer/GeneratedSubtypes/SortedDictionaryGenerator.cs b/Sources/Core/Microsoft.StreamProcessing/Serializer/GeneratedSubtypes/SortedDictionaryGenerator.cs index 4ff794c7b..7dce2367b 100644 --- a/Sources/Core/Microsoft.StreamProcessing/Serializer/GeneratedSubtypes/SortedDictionaryGenerator.cs +++ b/Sources/Core/Microsoft.StreamProcessing/Serializer/GeneratedSubtypes/SortedDictionaryGenerator.cs @@ -15,7 +15,7 @@ internal static class SortedDictionaryGenerator { private const string Prefix = "GeneratedSortedDictionary"; private static readonly object sentinel = new object(); - private static readonly Dictionary, Type> DictionaryTypes = new Dictionary, Type>(); + private static readonly Dictionary, Type> DictionaryTypes = []; public static Expression>> CreateSortedDictionaryGenerator(this IComparerExpression comparerExp, QueryContainer container) { diff --git a/Sources/Core/Microsoft.StreamProcessing/Serializer/Serializers/ClassSerializer.cs b/Sources/Core/Microsoft.StreamProcessing/Serializer/Serializers/ClassSerializer.cs index 57f253942..ef923bcad 100644 --- a/Sources/Core/Microsoft.StreamProcessing/Serializer/Serializers/ClassSerializer.cs +++ b/Sources/Core/Microsoft.StreamProcessing/Serializer/Serializers/ClassSerializer.cs @@ -14,7 +14,7 @@ namespace Microsoft.StreamProcessing.Serializer.Serializers { internal abstract class ClassSerializer : ObjectSerializerBase { - protected readonly List fields = new List(); + protected readonly List fields = []; protected ClassSerializer(Type runtimeType) : base(runtimeType) { } diff --git a/Sources/Core/Microsoft.StreamProcessing/Serializer/Serializers/MultidimensionalArraySerializer.cs b/Sources/Core/Microsoft.StreamProcessing/Serializer/Serializers/MultidimensionalArraySerializer.cs index 636b69382..642baf38e 100644 --- a/Sources/Core/Microsoft.StreamProcessing/Serializer/Serializers/MultidimensionalArraySerializer.cs +++ b/Sources/Core/Microsoft.StreamProcessing/Serializer/Serializers/MultidimensionalArraySerializer.cs @@ -19,7 +19,7 @@ internal sealed class MultidimensionalArraySerializer : ObjectSerializerBase protected override Expression BuildSerializerSafe(Expression encoder, Expression value) { int rank = this.RuntimeType.GetArrayRank(); - return BuildSerializerImpl(new List(), encoder, value, 0, rank); + return BuildSerializerImpl([], encoder, value, 0, rank); } private Expression BuildSerializerImpl( @@ -78,7 +78,7 @@ protected override Expression BuildDeserializerSafe(Expression decoder) var result = Expression.Variable(type, "result"); body.Add(Expression.Assign(result, Expression.NewArrayBounds(type.GetElementType(), lengths))); - body.Add(GenerateCopy(new List(), result, deserialized, 0, type.GetArrayRank())); + body.Add(GenerateCopy([], result, deserialized, 0, type.GetArrayRank())); body.Add(result); return Expression.Block(new[] { deserialized, result }, body); } diff --git a/Sources/Core/Microsoft.StreamProcessing/Serializer/Serializers/ReflectionSchemaBuilder.cs b/Sources/Core/Microsoft.StreamProcessing/Serializer/Serializers/ReflectionSchemaBuilder.cs index 5802f698f..f8c339139 100644 --- a/Sources/Core/Microsoft.StreamProcessing/Serializer/Serializers/ReflectionSchemaBuilder.cs +++ b/Sources/Core/Microsoft.StreamProcessing/Serializer/Serializers/ReflectionSchemaBuilder.cs @@ -19,7 +19,7 @@ internal sealed class ReflectionSchemaBuilder private readonly SerializerSettings settings; private readonly HashSet knownTypes; - private readonly Dictionary seenTypes = new Dictionary(); + private readonly Dictionary seenTypes = []; static ReflectionSchemaBuilder() { diff --git a/Sources/Core/Microsoft.StreamProcessing/Sharding/ShardedStreamCache.cs b/Sources/Core/Microsoft.StreamProcessing/Sharding/ShardedStreamCache.cs index 585cd9b91..02022aead 100644 --- a/Sources/Core/Microsoft.StreamProcessing/Sharding/ShardedStreamCache.cs +++ b/Sources/Core/Microsoft.StreamProcessing/Sharding/ShardedStreamCache.cs @@ -76,7 +76,7 @@ public ShardedCacheObserver(StreamCache cache, StreamProperties< this.cache = cache; this.sourceProps = sourceProps; - this.elements = new List>>(); + this.elements = []; } public void Dispose() diff --git a/Sources/Core/Microsoft.StreamProcessing/StreamProperties/StreamProperties.cs b/Sources/Core/Microsoft.StreamProcessing/StreamProperties/StreamProperties.cs index 2d077f0fa..0b2e8c7c1 100644 --- a/Sources/Core/Microsoft.StreamProcessing/StreamProperties/StreamProperties.cs +++ b/Sources/Core/Microsoft.StreamProcessing/StreamProperties/StreamProperties.cs @@ -49,8 +49,8 @@ internal static StreamProperties Default EqualityComparerExpression.Default, null, null, - new Dictionary(), - new Dictionary(), + [], + [], null); internal static StreamProperties DefaultIngress(LambdaExpression startEdgeSelector, LambdaExpression endEdgeSelector) @@ -79,8 +79,8 @@ internal static StreamProperties DefaultIngress(LambdaExpression EqualityComparerExpression.Default, null, null, - new Dictionary(), - new Dictionary(), + [], + [], null); } @@ -605,8 +605,8 @@ internal StreamProperties SelectMany(LambdaExpression se this.IsIntervalFree, false, this.IsSnapshotSorted, false, this.KeyEqualityComparer, EqualityComparerExpression.Default, this.KeyComparer, newPayloadComparer, - new Dictionary(), - new Dictionary(), + [], + [], this.QueryContainer); } @@ -718,7 +718,7 @@ internal StreamProperties Union(StreamProperties result.IsSnapshotSorted = false; result.KeyComparer = null; result.PayloadComparer = null; - result.SortSelectorMap = new Dictionary(); + result.SortSelectorMap = []; // Union can be columnar only if both are result.IsColumnar = this.IsColumnar && right.IsColumnar; @@ -774,8 +774,8 @@ internal StreamProperties Join EqualityComparerExpression.Default, newKeyComparer, null, - new Dictionary(), - new Dictionary(), this.QueryContainer); + [], + [], this.QueryContainer); } /// @@ -907,11 +907,11 @@ internal sealed class VerifyPropertiesPipe : UnaryPipe lastSyncTimeForSimultaneous = new Dictionary(); + private readonly Dictionary lastSyncTimeForSimultaneous = []; [DataMember] private long lastSeenTimestamp = StreamEvent.MinSyncTime; [DataMember] - private readonly Dictionary lastSeenTimestampPartitioned = new Dictionary(); + private readonly Dictionary lastSeenTimestampPartitioned = []; [Obsolete("Used only by serialization. Do not call directly.")] public VerifyPropertiesPipe() { } diff --git a/Sources/Core/Microsoft.StreamProcessing/StreamProperties/StreamPropertiesExtensions.cs b/Sources/Core/Microsoft.StreamProcessing/StreamProperties/StreamPropertiesExtensions.cs index 1ce4616b4..6e4f6f26c 100644 --- a/Sources/Core/Microsoft.StreamProcessing/StreamProperties/StreamPropertiesExtensions.cs +++ b/Sources/Core/Microsoft.StreamProcessing/StreamProperties/StreamPropertiesExtensions.cs @@ -38,8 +38,8 @@ internal static StreamProperties Ungroup.Default, newKeyComparer, null, - new Dictionary(), - new Dictionary(), + [], + [], source.QueryContainer); } @@ -59,8 +59,8 @@ internal static StreamProperties Ungroup.Default, null, null, - new Dictionary(), - new Dictionary(), + [], + [], source.QueryContainer); } diff --git a/Sources/Core/Microsoft.StreamProcessing/StreamableAPI/PivotExtensions.cs b/Sources/Core/Microsoft.StreamProcessing/StreamableAPI/PivotExtensions.cs index a1f4cc306..19200a0e0 100644 --- a/Sources/Core/Microsoft.StreamProcessing/StreamableAPI/PivotExtensions.cs +++ b/Sources/Core/Microsoft.StreamProcessing/StreamableAPI/PivotExtensions.cs @@ -204,8 +204,8 @@ public static IStreamable Unpivot { - private readonly Dictionary> fields = new Dictionary>(); - private readonly Dictionary> isNull = new Dictionary>(); + private readonly Dictionary> fields = []; + private readonly Dictionary> isNull = []; public UnpivotEnumerable(Expression> keySelector, NewExpression newExpression, MemberExpression attributeField, MemberExpression valueField) { diff --git a/Sources/Core/Microsoft.StreamProcessing/Transformer/CommonBaseTemplate.cs b/Sources/Core/Microsoft.StreamProcessing/Transformer/CommonBaseTemplate.cs index 69f83649e..0f97475d3 100644 --- a/Sources/Core/Microsoft.StreamProcessing/Transformer/CommonBaseTemplate.cs +++ b/Sources/Core/Microsoft.StreamProcessing/Transformer/CommonBaseTemplate.cs @@ -26,7 +26,7 @@ internal abstract class CommonBaseTemplate /// /// A list of the lengths of each indent that was added with PushIndent /// - private List IndentLengths { get; } = new List(); + private List IndentLengths { get; } = []; /// /// Gets the current indent we use when adding lines to the output diff --git a/Sources/Core/Microsoft.StreamProcessing/Transformer/SelectTransformation.cs b/Sources/Core/Microsoft.StreamProcessing/Transformer/SelectTransformation.cs index 61d68635f..b2df55552 100644 --- a/Sources/Core/Microsoft.StreamProcessing/Transformer/SelectTransformation.cs +++ b/Sources/Core/Microsoft.StreamProcessing/Transformer/SelectTransformation.cs @@ -96,7 +96,7 @@ private SelectTransformer( bool doMultiStringTransform, bool hasStartEdge) { - this.parameterInformation = new Dictionary(); + this.parameterInformation = []; foreach (var tup in substitutionInformation) { this.parameterInformation.Add(tup.Item1, tup.Item2); @@ -105,10 +105,10 @@ private SelectTransformer( this.noSwingingFields = noSwingingFields; this.doMultiStringTransform = doMultiStringTransform; - this.swingingFields = new List>(); - this.computedFields = new Dictionary(); - this.multiStringOperations = new List(); - this.multiStringResultFields = new List(); + this.swingingFields = []; + this.computedFields = []; + this.multiStringOperations = []; + this.multiStringResultFields = []; var body = function.Body; diff --git a/Sources/Core/Microsoft.StreamProcessing/Transformer/TemplateClasses.cs b/Sources/Core/Microsoft.StreamProcessing/Transformer/TemplateClasses.cs index 92386842b..9b6ea98bc 100644 --- a/Sources/Core/Microsoft.StreamProcessing/Transformer/TemplateClasses.cs +++ b/Sources/Core/Microsoft.StreamProcessing/Transformer/TemplateClasses.cs @@ -365,7 +365,7 @@ public static IEnumerable AssemblyReferencesNeededFor(params Expressio private sealed class AssemblyLocationFinder : ExpressionVisitor { - private readonly HashSet assemblyLocations = new HashSet(); + private readonly HashSet assemblyLocations = []; private AssemblyLocationFinder() { } public static IEnumerable GetAssemblyLocationsFor(Expression e) @@ -612,7 +612,7 @@ internal sealed class ColumnarRepresentation public readonly MyFieldInfo PseudoField; // used only when noFields is true public IEnumerable AllFields => this.noFields - ? new List() { this.PseudoField } + ? [this.PseudoField] : this.Fields.Values; public ColumnarRepresentation(Type t) @@ -734,12 +734,10 @@ public static void GetGeneratedCode(Type keyType, Type payloadType, out string g { var template = new SafeBatchTemplate(); - assemblyReferences = new List - { - Transformer.SystemRuntimeSerializationDll // needed for [DataContract] and [DataMember] in generated code - }; - - assemblyReferences.AddRange(Transformer.AssemblyReferencesNeededFor(keyType)); + assemblyReferences = + [ + Transformer.SystemRuntimeSerializationDll, .. Transformer.AssemblyReferencesNeededFor(keyType) // needed for [DataContract] and [DataMember] in generated code + ]; template.keyType = keyType; assemblyReferences.AddRange(Transformer.AssemblyReferencesNeededFor(payloadType)); @@ -780,7 +778,7 @@ internal partial class MemoryPoolTemplate internal MemoryPoolTemplate(ColumnarRepresentation keyRepresentation, ColumnarRepresentation payloadRepresentation) { - this.assemblyReferences = new List(); + this.assemblyReferences = []; var keyType = keyRepresentation == null ? typeof(Empty) : keyRepresentation.RepresentationFor; diff --git a/Sources/Core/Microsoft.StreamProcessing/Utilities/Config.cs b/Sources/Core/Microsoft.StreamProcessing/Utilities/Config.cs index badaa164f..c70a6bfd5 100644 --- a/Sources/Core/Microsoft.StreamProcessing/Utilities/Config.cs +++ b/Sources/Core/Microsoft.StreamProcessing/Utilities/Config.cs @@ -467,11 +467,15 @@ public static string Describe() // in VSTest, which is a good thing, since Config is static and those tests may clash otherwise. internal sealed class ConfigModifier { - // lockable gate allowing only one ConfigModifier active at a time - private static readonly object gate = new object(); + // Serializes concurrent ConfigModifier usage across tests. + // SemaphoreSlim instead of Monitor so that async tests can release from a different thread. + // AsyncLocal depth counter makes it re-entrant within the same async call context (e.g. nested + // using blocks within a single test) without blocking on the semaphore a second time. + private static readonly SemaphoreSlim gate = new SemaphoreSlim(1, 1); + private static readonly AsyncLocal gateDepth = new AsyncLocal(); // collection of Config modifications - private readonly List modifications = new List(); + private readonly List modifications = []; public ConfigModifier GeneratedCodePath(string value) { @@ -723,7 +727,8 @@ public ConfigModifier SerializationCompressionLevel(SerializationCompressionLeve public IDisposable Modify() { - Monitor.Enter(gate); + if (gateDepth.Value == 0) gate.Wait(); + gateDepth.Value++; foreach (var m in this.modifications) m.Modify(); @@ -732,7 +737,8 @@ public IDisposable Modify() foreach (var m in this.modifications) m.Modify(); - Monitor.Exit(gate); + gateDepth.Value--; + if (gateDepth.Value == 0) gate.Release(); }); } diff --git a/Sources/Core/Microsoft.StreamProcessing/Utilities/ExpressionExtensions.cs b/Sources/Core/Microsoft.StreamProcessing/Utilities/ExpressionExtensions.cs index 94f5ccf96..40f4a6b17 100644 --- a/Sources/Core/Microsoft.StreamProcessing/Utilities/ExpressionExtensions.cs +++ b/Sources/Core/Microsoft.StreamProcessing/Utilities/ExpressionExtensions.cs @@ -188,7 +188,7 @@ protected override Expression VisitMethodCall(MethodCallExpression node) internal sealed class EqualityComparer : ExpressionVisitor { - private readonly Dictionary parameterMap = new Dictionary(); + private readonly Dictionary parameterMap = []; private int uniqueParameterNumber; private EqualityComparer() => this.uniqueParameterNumber = 0; @@ -353,7 +353,7 @@ private bool Equals(MemberBinding mb1, MemberBinding mb2) internal sealed class VariableFinder : ExpressionVisitor { - private readonly List foundVariables = new List(); + private readonly List foundVariables = []; public static List Find(Expression exp) { @@ -428,11 +428,11 @@ protected override Expression VisitParameter(ParameterExpression node) internal class ConvertToCSharp : ExpressionVisitor { public readonly TextWriter writer; - private readonly HashSet nonExpressionFeatures = new HashSet - { + private readonly HashSet nonExpressionFeatures = + [ ExpressionType.Loop, ExpressionType.Block - }; + ]; public ConvertToCSharp(TextWriter writer) => this.writer = writer ?? throw new ArgumentNullException(nameof(writer)); @@ -1266,8 +1266,8 @@ private ColumnOriented() { } var me = new ColumnOriented { - parameterTableForDecomposableTypes = new Dictionary, ParameterInformation>(), - parameterTableForAtomicTypes = new Dictionary() + parameterTableForDecomposableTypes = [], + parameterTableForAtomicTypes = [] }; var parameterMapping = new Dictionary(); var i = 0; diff --git a/Sources/Core/Microsoft.StreamProcessing/Utilities/Native32.cs b/Sources/Core/Microsoft.StreamProcessing/Utilities/Native32.cs index f2924c0e7..d19a7ca57 100644 --- a/Sources/Core/Microsoft.StreamProcessing/Utilities/Native32.cs +++ b/Sources/Core/Microsoft.StreamProcessing/Utilities/Native32.cs @@ -74,8 +74,16 @@ internal static void AffinitizeThread(int processor) { if (utid == pt.Id) { - long AffinityMask = 1 << processor; - pt.ProcessorAffinity = (IntPtr)(AffinityMask); // Set affinity for this + if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) + { + pt.IdealProcessor = processor; + } + + if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) + { + long AffinityMask = 1 << processor; + pt.ProcessorAffinity = (IntPtr)(AffinityMask); // Set affinity for this + } } } } diff --git a/Sources/Core/Microsoft.StreamProcessing/Utilities/TypeExtensions.cs b/Sources/Core/Microsoft.StreamProcessing/Utilities/TypeExtensions.cs index ff24319a2..5a081a51a 100644 --- a/Sources/Core/Microsoft.StreamProcessing/Utilities/TypeExtensions.cs +++ b/Sources/Core/Microsoft.StreamProcessing/Utilities/TypeExtensions.cs @@ -32,7 +32,7 @@ static TypeExtensions() foreach (var pair in OperatorNameLookup) { KnownSupportedOperators.TryAdd( - pair.Key, new HashSet { typeof(long), typeof(ulong), typeof(int), typeof(uint), typeof(short), typeof(ushort), typeof(double), typeof(float), typeof(decimal), typeof(byte), typeof(sbyte) }); + pair.Key, [typeof(long), typeof(ulong), typeof(int), typeof(uint), typeof(short), typeof(ushort), typeof(double), typeof(float), typeof(decimal), typeof(byte), typeof(sbyte)]); } } @@ -518,7 +518,7 @@ public static string GetCSharpSourceSyntax(this Type t) public static string GetCSharpSourceSyntax(this Type t, ref List introducedGenericTypeParameters) { - if (introducedGenericTypeParameters == null) introducedGenericTypeParameters = new List(); + if (introducedGenericTypeParameters == null) introducedGenericTypeParameters = []; string ret = TurnTypeIntoCSharpSource(t, ref introducedGenericTypeParameters); return ret; } @@ -678,11 +678,11 @@ public static bool IsUnsupported(this Type type) && !type.GetTypeInfo().IsInterface && !(type.GetTypeInfo().IsGenericType && SupportedInterfaces.Contains(type.GetGenericTypeDefinition()))); - private static readonly HashSet SupportedInterfaces = new HashSet - { + private static readonly HashSet SupportedInterfaces = + [ typeof(IList<>), typeof(IDictionary<,>) - }; + ]; /// /// Validates that a type can be serialized. diff --git a/Sources/Core/Microsoft.StreamProcessing/Utilities/Utility.cs b/Sources/Core/Microsoft.StreamProcessing/Utilities/Utility.cs index 7dc5c98d5..e6200adf6 100644 --- a/Sources/Core/Microsoft.StreamProcessing/Utilities/Utility.cs +++ b/Sources/Core/Microsoft.StreamProcessing/Utilities/Utility.cs @@ -91,7 +91,7 @@ public static void Add(this IDictionary> dict, { if (!dict.TryGetValue(key, out var list)) { - list = new List(); + list = []; dict.Add(key, list); } list.Add(value); diff --git a/Sources/Microsoft.StreamProcessing.ruleset b/Sources/Microsoft.StreamProcessing.ruleset deleted file mode 100644 index b9cb6cefc..000000000 --- a/Sources/Microsoft.StreamProcessing.ruleset +++ /dev/null @@ -1,198 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Sources/Test/Directory.Build.props b/Sources/Test/Directory.Build.props index 588c632b2..b046b9e77 100644 --- a/Sources/Test/Directory.Build.props +++ b/Sources/Test/Directory.Build.props @@ -7,7 +7,6 @@ false - $(MSBuildThisFileDirectory)Microsoft.StreamProcessing.Test.ruleset prompt 4 true @@ -27,8 +26,4 @@ - - - - diff --git a/Sources/Test/Microsoft.StreamProcessing.Test.ruleset b/Sources/Test/Microsoft.StreamProcessing.Test.ruleset deleted file mode 100644 index ca4f78706..000000000 --- a/Sources/Test/Microsoft.StreamProcessing.Test.ruleset +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/Sources/Test/SimpleTesting/AdHocTests.cs b/Sources/Test/SimpleTesting/AdHocTests.cs index 41c0cca20..0e861838b 100644 --- a/Sources/Test/SimpleTesting/AdHocTests.cs +++ b/Sources/Test/SimpleTesting/AdHocTests.cs @@ -44,7 +44,7 @@ public void Properties() .ToObservable() .ToStreamable(DisorderPolicy.Throw(), FlushPolicy.FlushOnPunctuation, PeriodicPunctuationPolicy.None(), OnCompletedPolicy.None); - var q2 = q1.Select(x => string.Join(",", x.A, x.B, x.C, x.D, x.E)); + var q2 = q1.Select(x => string.Join(",", new object[] { x.A, x.B, x.C, x.D, x.E })); int count = 0; q2.ToStreamEventObservable().ForEachAsync(x => count++).Wait(); @@ -67,7 +67,7 @@ public void Fields() .ToObservable() .ToStreamable(DisorderPolicy.Throw(), FlushPolicy.FlushOnPunctuation, PeriodicPunctuationPolicy.None(), OnCompletedPolicy.None); - var q2 = q1.Select(x => string.Join(",", x.A, x.B, x.C, x.D, x.E)); + var q2 = q1.Select(x => string.Join(",", new object[] { x.A, x.B, x.C, x.D, x.E })); int count = 0; q2.ToStreamEventObservable().ForEachAsync(x => count++).Wait(); @@ -141,11 +141,11 @@ private void TestSerialization() ms.Position = 0; ColumnBatch resultStr = s.Deserialize(ms); - Assert.IsTrue(resultStr.UsedLength == inputStr.UsedLength); + Assert.AreEqual(inputStr.UsedLength, resultStr.UsedLength); for (int j = 0; j < inputStr.UsedLength; j++) { - Assert.IsTrue(inputStr.col[j] == resultStr.col[j]); + Assert.AreEqual(resultStr.col[j], inputStr.col[j]); } resultStr.ReturnClear(); inputStr.ReturnClear(); @@ -165,9 +165,9 @@ public void StreamEventArrayIngress1() var s = input.ToObservable(); var str = s.ToStreamable(); var output = str.ToStreamMessageObservable().ToEnumerable().ToArray(); - Assert.IsTrue(output.Length == 1); // first batch with all data and one punctuation - Assert.IsTrue(output[0].Count == length + 1); - Assert.IsTrue(output[0].vother.col[output[0].Count - 1] == StreamEvent.PunctuationOtherTime); + Assert.HasCount(1, output); // first batch with all data and one punctuation + Assert.AreEqual(length + 1, output[0].Count); + Assert.AreEqual(StreamEvent.PunctuationOtherTime, output[0].vother.col[output[0].Count - 1]); for (int i = 0; i < output.Length; i++) output[i].Free(); } @@ -185,11 +185,11 @@ public void StreamEventArrayIngress2() var s = input.ToObservable(); var str = s.ToStreamable(); var output = str.ToStreamMessageObservable().ToEnumerable().ToArray(); - Assert.IsTrue(output.Length == 4); // four data batches - Assert.IsTrue(output[0].Count + output[1].Count + output[2].Count + output[3].Count == length + 1); + Assert.HasCount(4, output); // four data batches + Assert.AreEqual(length + 1, output[0].Count + output[1].Count + output[2].Count + output[3].Count); // fourth data batch should have a punctuation at the end - Assert.IsTrue(output[3].vother.col[output[3].Count - 1] == StreamEvent.PunctuationOtherTime); + Assert.AreEqual(StreamEvent.PunctuationOtherTime, output[3].vother.col[output[3].Count - 1]); for (int i = 0; i < output.Length; i++) output[i].Free(); } @@ -211,15 +211,15 @@ public void StreamEventArrayIngress3() // 10 pairs of data and punc, then one with just a punctuation at infinity int expectedDataBatches = 11; - Assert.IsTrue(output.Length == expectedDataBatches); + Assert.HasCount(expectedDataBatches, output); var dataEventCount = 0; for (int i = 0; i < output.Length; i++) { // Data batch should end with a punctuation - Assert.IsTrue(output[i].vother.col[output[i].Count - 1] == StreamEvent.PunctuationOtherTime); + Assert.AreEqual(StreamEvent.PunctuationOtherTime, output[i].vother.col[output[i].Count - 1]); dataEventCount += output[i].Count - 1; // exclude punctuation } - Assert.IsTrue(dataEventCount == length - 10); // because every 10th row was a punctuation, not a data row + Assert.AreEqual(length - 10, dataEventCount); // because every 10th row was a punctuation, not a data row for (int i = 0; i < output.Length; i++) output[i].Free(); } @@ -255,7 +255,7 @@ public void PartitionedStreamAdjustIngressPolicy() egress.Wait(); output = output.Where(o => o.IsData).ToList(); - Assert.AreEqual(2, output.Count); + Assert.HasCount(2, output); Assert.AreEqual(70, output[0].SyncTime); Assert.AreEqual(22, output[1].SyncTime); } @@ -405,7 +405,7 @@ public void UnderFlowFalseFlush() OnCompletedPolicy.None); var output = new List>(); - var egress = qc.RegisterOutput(ingress).ForEachAsync(o => output.Add(o)); + var egress = qc.RegisterOutput(ingress).ForEachAsync(output.Add); var process = qc.Restore(); process.Flush(); egress.Wait(); @@ -507,7 +507,7 @@ public void InactiveAndNewPartitions() OnCompletedPolicy.EndOfStream); var output = new List>(); - var egress = qc.RegisterOutput(ingress).ForEachAsync(o => output.Add(o)); + var egress = qc.RegisterOutput(ingress).ForEachAsync(output.Add); var process = qc.Restore(); process.Flush(); egress.Wait(); @@ -547,7 +547,7 @@ public void FileStreamPassthrough() // Stream from file var fromFile = filePath.ToStreamableFromFile(readPropertiesFromStream: serializeStreamProperties); var output = new List>(); - fromFile.ToStreamEventObservable().Where(e => e.IsData).ForEachAsync(r => output.Add(r)).Wait(); + fromFile.ToStreamEventObservable().Where(e => e.IsData).ForEachAsync(output.Add).Wait(); Assert.IsTrue(inputData.SequenceEqual(output)); } @@ -579,7 +579,7 @@ public void FileStreamDoubleQuery() for (int i = 0; i < 2; i++) { var output = new List>(); - streamable.ToStreamEventObservable().Where(e => e.IsData).ForEachAsync(e => output.Add(e)).Wait(); + streamable.ToStreamEventObservable().Where(e => e.IsData).ForEachAsync(output.Add).Wait(); Assert.IsTrue(inputData.SequenceEqual(output)); } } @@ -651,7 +651,7 @@ public void ExplicitAndGeneratedLowWatermarks() var output = new List>(); input.ToStreamEventObservable() - .ForEachAsync(x => output.Add(x)) + .ForEachAsync(output.Add) .Wait(); var expected = new List> @@ -863,7 +863,7 @@ public void LASJ_OutOfOrderLWM() e => e); var output = new List>(); - var egress = qc.RegisterOutput(query).ForEachAsync(o => output.Add(o)); + var egress = qc.RegisterOutput(query).ForEachAsync(output.Add); var process = qc.Restore(); process.Flush(); egress.Wait(); @@ -898,7 +898,7 @@ public void SimpleShardTest() .Unshard() .ToStreamEventObservable() .Where(e => e.IsData) - .ForEachAsync(e => output.Add(e)); + .ForEachAsync(output.Add); Assert.IsTrue(output.SequenceEqual(input)); } @@ -920,11 +920,11 @@ public void SinglePunctuationBatchTimestamps() batch => { var min = batch.MinTimestamp; - Assert.IsTrue(min >= currentMin); + Assert.IsGreaterThanOrEqualTo(currentMin, min); currentMin = min; var max = batch.MaxTimestamp; - Assert.IsTrue(max >= currentMax); + Assert.IsGreaterThanOrEqualTo(currentMax, max); currentMax = max; batch.Free(); @@ -957,7 +957,7 @@ public void AggressivePartitionCleanup_LASJ() e => e); var output = new List>(); - qc.RegisterOutput(query).ForEachAsync(o => output.Add(o)); + qc.RegisterOutput(query).ForEachAsync(output.Add); var process = qc.Restore(); // Set up state so that the left has an "invisible" (i.e. unmatched on the right) interval. @@ -1045,7 +1045,7 @@ public void AggressivePartitionCleanup_EquiJoin() (l, r) => l); var output = new List>(); - qc.RegisterOutput(query).ForEachAsync(o => output.Add(o)); + qc.RegisterOutput(query).ForEachAsync(output.Add); var process = qc.Restore(); // Set up state so that there is outstanding start edges/intervals @@ -1129,7 +1129,7 @@ public void AggressivePartitionCleanup_Clip() e => e); var output = new List>(); - qc.RegisterOutput(query).ForEachAsync(o => output.Add(o)); + qc.RegisterOutput(query).ForEachAsync(output.Add); var process = qc.Restore(); // Set up state so that there is outstanding start edges/intervals @@ -1190,7 +1190,7 @@ public void OutOfOrderRepro() var input = new Subject>(); var ingress = qc.RegisterInput(input, DisorderPolicy.Drop(reorderLatency: 500)); var output = new List>(); - var egress = qc.RegisterOutput(ingress).ForEachAsync(o => output.Add(o)); + var egress = qc.RegisterOutput(ingress).ForEachAsync(output.Add); var process = qc.Restore(); // These will be buffered due to reorderLatency @@ -1247,7 +1247,7 @@ public void ColumnarUngroupNullRefRepro() (g, byNamePayload) => new Payload { GroupId = g.Key, Name = byNamePayload.Name, Reading = byNamePayload.Reading }) .ToStreamEventObservable()); var output = new List>(); - var egress = qc.RegisterOutput(ingress).Where(e => e.IsData).ForEachAsync(o => output.Add(o)); + var egress = qc.RegisterOutput(ingress).Where(e => e.IsData).ForEachAsync(output.Add); var process = qc.Restore(); process.Flush(); egress.Wait(); @@ -1311,8 +1311,10 @@ public async Task DisposeTest1() await inputTask; // Make sure we really got an output data event. - Assert.IsTrue(lastSeenSubscription > 0); + Assert.IsGreaterThan(0, lastSeenSubscription); } + + public TestContext TestContext { get; set; } } [TestClass] @@ -1347,16 +1349,16 @@ public void PublishTest1() var input = inputSubject.ToStreamable().SetProperty().IsConstantDuration(true, StreamEvent.InfinitySyncTime).Publish(); - var output1 = input.ToStreamEventObservable().Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(x => outputList1.Add(x)); + var output1 = input.ToStreamEventObservable().Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputList1.Add); input.Connect(); - preConnectData.ForEachAsync(x => inputSubject.OnNext(x)).Wait(); + preConnectData.ForEachAsync(inputSubject.OnNext).Wait(); inputSubject.OnNext(StreamEvent.CreatePunctuation(1)); - var output2 = input.ToStreamEventObservable().Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(x => outputList2.Add(x)); + var output2 = input.ToStreamEventObservable().Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputList2.Add); - postConnectData.ForEachAsync(x => inputSubject.OnNext(x)).Wait(); + postConnectData.ForEachAsync(inputSubject.OnNext).Wait(); inputSubject.OnCompleted(); @@ -1412,7 +1414,7 @@ public struct NormalizedHttpEvent countedNE = countedNE.AlterEventDuration(1); var output2 = countedNE.ToStreamEventObservable(ReshapingPolicy.CoalesceEndEdges).ToEnumerable().ToArray(); - Assert.IsTrue(output2.Count() == 9); + Assert.AreEqual(9, output2.Count()); } } @@ -1748,10 +1750,7 @@ private void CommonInitialize() var result = Query(inputEvents); var resultObs = this.container.RegisterOutput(result); - resultObs.Subscribe(x => - { - this.results.Enqueue(x); - }); + resultObs.Subscribe(this.results.Enqueue); } internal QueryProcessor() @@ -1842,7 +1841,7 @@ public void LeftJoinOutOfOrder() s => s, s => s, e1 => e1, - (e1, e2) => null)).ForEachAsync(o => output.Add(o)); + (e1, e2) => null)).ForEachAsync(output.Add); var process = qc.Restore(); // This test used to rely on lagAllowance=50 and (Global)PeriodicPunctuationPolicy=10 to generate global punctuations and flush contents. @@ -1871,7 +1870,7 @@ public void LeftJoinOutOfOrder() process.Flush(); var outputData = output.Where(o => o.IsData).ToList(); - Assert.IsTrue(outputData.Count == 2); + Assert.HasCount(2, outputData); } [TestMethod, TestCategory("Gated")] @@ -1949,7 +1948,7 @@ public void StartEdge1() .ToArray(); var x = events.Length; - Assert.IsTrue(x == inputEnumerable.Count()); + Assert.AreEqual(inputEnumerable.Count(), x); } } @@ -2133,12 +2132,14 @@ public void JoinClipTest() }); var result = successes.ToStreamEventObservable().ToEnumerable().ToArray(); - Assert.IsTrue(false); // should never reach here. + Assert.Fail(); // should never reach here. } - catch (Exception e) + catch (InvalidOperationException) { - Assert.IsTrue(e is InvalidOperationException); + // expected, because the Join should not be able to match the clipped events with the finishing events, since the clipped events have had their lifetime shifted by 1 tick, and thus should not overlap with the finishing events. + return; } + Assert.Fail(); // should never reach here. } /// @@ -2170,7 +2171,7 @@ public void UnionWithOneColumnarAndOneNot01() .ToStreamEventObservable() .Where(e => e.IsData) .Select(e => e.Payload) - .ForEachAsync(x => outputList.Add(x)); + .ForEachAsync(outputList.Add); streamResult.Connect(); @@ -2208,7 +2209,7 @@ public void UnionWithOneColumnarAndOneNot02() .ToStreamEventObservable() .Where(e => e.IsData) .Select(e => e.Payload) - .ForEachAsync(x => outputList.Add(x)); + .ForEachAsync(outputList.Add); streamResult.Connect(); @@ -2249,7 +2250,7 @@ public void Select8() .ToEnumerable() .ToArray() ; - Assert.IsTrue(expected.Count() == output.Length); + Assert.AreEqual(output.Length, expected.Count()); for (int i = 0; i < output.Length; i++) Assert.IsTrue(expected.ElementAt(i).Equals(output[i])); } @@ -2321,6 +2322,21 @@ public class LeftComparerPayload_WithCodegen : TestWithConfigSettingsAndMemoryLe public LeftComparerPayload_WithCodegen() : base(new ConfigModifier().DontFallBackToRowBasedExecution(true)) { } + // Named result type so the full closed generic EquiJoinStreamable<,,,,> can be + // referenced at compile time (anonymous types cannot be named in typeof/generic arguments). + public struct JoinResult { public int LeftX; public int RightX; } + + [TestInitialize] + public void ClearCodegenCache() + { + // Clear the EquiJoin codegen cache before each test so that JoinTestWithException + // always triggers a fresh compile and deterministically throws StreamProcessingException, + // regardless of which tests ran before it in the same process. + // The join is built via Map+Reduce, so the inner EquiJoinStreamable uses TKey=CompoundGroupKey. + EquiJoinStreamable, ClassOverridingEquals, int, JoinResult> + .cachedPipes.Clear(); + } + public class ClassOverridingEquals { public int x; @@ -2330,9 +2346,10 @@ public class ClassOverridingEquals } /// - /// This test has a left comparer which has a reference to the left - /// payload instead of just to its fields. This causes the streamable - /// to thrown an exception. + /// This test has a left comparer which has a reference to the left payload instead of + /// just to its fields. Codegen should always throw StreamProcessingException when + /// compiling this join fresh. The [TestInitialize] method clears the codegen cache + /// before this test runs to ensure deterministic behavior in the full test suite. /// [TestMethod] public void JoinTestWithException() @@ -2349,20 +2366,17 @@ public void JoinTestWithException() .ToStreamable() ; - bool exceptionHappened = false; + bool threw = false; try { - var result = stream1 - .Join(stream2, e => e.x, e => e, (left, right) => new { LeftX = left.x, RightX = right, }) - .ToStreamEventObservable() - .ToEnumerable() - .ToArray(); - } - catch (StreamProcessingException) - { - exceptionHappened = true; + stream1 + .Join(stream2, e => e.x, e => e, (left, right) => new JoinResult { LeftX = left.x, RightX = right }) + .ToStreamEventObservable() + .ToEnumerable() + .ToArray(); } - Assert.IsTrue(exceptionHappened); + catch (StreamProcessingException) { threw = true; } + Assert.IsTrue(threw, "Expected StreamProcessingException from codegen failure on ClassOverridingEquals"); } } @@ -2404,18 +2418,15 @@ public void JoinTestWithoutException() .ToStreamable() ; - try - { - var result = stream1 + + var result = stream1 .Join(stream2, e => e.x, e => e, (left, right) => new { LeftX = left.x, RightX = right, }) .ToStreamEventObservable() .ToEnumerable() .ToArray(); - Assert.IsTrue(true); // just test that no exception happened - } - catch (Exception) + if (object.ReferenceEquals(result, null)) { - Assert.IsTrue(false); // should never reach here. + // just to use the result and avoid "unused variable" warning } } diff --git a/Sources/Test/SimpleTesting/Aggregates/PerKeyAggregate.cs b/Sources/Test/SimpleTesting/Aggregates/PerKeyAggregate.cs index c3acc3535..5998c5884 100644 --- a/Sources/Test/SimpleTesting/Aggregates/PerKeyAggregate.cs +++ b/Sources/Test/SimpleTesting/Aggregates/PerKeyAggregate.cs @@ -4,7 +4,6 @@ // ********************************************************************* using System; using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; using System.Linq; using System.Reactive.Linq; using Microsoft.StreamProcessing; @@ -13,7 +12,6 @@ namespace SimpleTesting { - [SuppressMessage("StyleCop.CSharp.SpacingRules", "SA1009", Justification = "Reviewed.")] [TestClass] public class AggregateByKey : TestWithConfigSettingsAndMemoryLeakDetection { @@ -149,7 +147,7 @@ public void TestAggregateByKeyTupleDecomposition() input .GroupAggregate(s => true, w => w.Count(), (g, c) => ValueTuple.Create(g.Key, c)) .ToStreamEventObservable() - .ForEachAsync(e => output.Add(e)) + .ForEachAsync(output.Add) .Wait(); var correct = new[] diff --git a/Sources/Test/SimpleTesting/CheckpointRestoreTests.cs b/Sources/Test/SimpleTesting/CheckpointRestoreTests.cs index 02483aca7..2cae343d3 100644 --- a/Sources/Test/SimpleTesting/CheckpointRestoreTests.cs +++ b/Sources/Test/SimpleTesting/CheckpointRestoreTests.cs @@ -71,9 +71,9 @@ public void BasicUnaryCheckpointHoppingWindowSumRow() var output1 = container1.RegisterOutput(query1); - var outputAsync1 = output1.Where(e => e.IsData).ForEachAsync(o => outputListWithCheckpoint.Add(o)); + var outputAsync1 = output1.Where(e => e.IsData).ForEachAsync(outputListWithCheckpoint.Add); var pipe1 = container1.Restore(null); - preCheckpointData.ForEachAsync(e => preCheckpointSubject.OnNext(e)).Wait(); + preCheckpointData.ForEachAsync(preCheckpointSubject.OnNext).Wait(); pipe1.Checkpoint(state); state.Seek(0, SeekOrigin.Begin); @@ -83,10 +83,10 @@ public void BasicUnaryCheckpointHoppingWindowSumRow() var query2 = input2.HoppingWindowLifetime(window, period).Sum(e => (ulong)e); var output2 = container2.RegisterOutput(query2); - var outputAsync2 = output2.Where(e => e.IsData).ForEachAsync(o => outputListWithCheckpoint.Add(o)); + var outputAsync2 = output2.Where(e => e.IsData).ForEachAsync(outputListWithCheckpoint.Add); var pipe2 = container2.Restore(state); - postCheckpointData.ForEachAsync(e => postCheckpointSubject.OnNext(e)).Wait(); + postCheckpointData.ForEachAsync(postCheckpointSubject.OnNext).Wait(); postCheckpointSubject.OnCompleted(); outputAsync2.Wait(); outputListWithCheckpoint.Sort((x, y) => @@ -104,7 +104,7 @@ public void BasicUnaryCheckpointHoppingWindowSumRow() var query3 = input3.HoppingWindowLifetime(window, period).Sum(e => (ulong)e); var output3 = container3.RegisterOutput(query3); - var outputAsync3 = output3.Where(e => e.IsData).ForEachAsync(o => outputListWithoutCheckpoint.Add(o)); + var outputAsync3 = output3.Where(e => e.IsData).ForEachAsync(outputListWithoutCheckpoint.Add); container3.Restore(null); outputAsync3.Wait(); outputListWithoutCheckpoint.Sort((x, y) => @@ -200,9 +200,9 @@ public void BasicUnaryCheckpoint0Row() var query1 = CreateBasicQuery(input1); var output1 = container1.RegisterOutput(query1); - var outputAsync1 = output1.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithCheckpoint.Add(o)); + var outputAsync1 = output1.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithCheckpoint.Add); var pipe1 = container1.Restore(null); - preCheckpointData.ForEachAsync(e => preCheckpointSubject.OnNext(e)).Wait(); + preCheckpointData.ForEachAsync(preCheckpointSubject.OnNext).Wait(); pipe1.Checkpoint(state); state.Seek(0, SeekOrigin.Begin); @@ -212,9 +212,9 @@ public void BasicUnaryCheckpoint0Row() var query2 = CreateBasicQuery(input2); var output2 = container2.RegisterOutput(query2); - var outputAsync2 = output2.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithCheckpoint.Add(o)); + var outputAsync2 = output2.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithCheckpoint.Add); var pipe2 = container2.Restore(state); - postCheckpointData.ForEachAsync(e => postCheckpointSubject.OnNext(e)).Wait(); + postCheckpointData.ForEachAsync(postCheckpointSubject.OnNext).Wait(); postCheckpointSubject.OnCompleted(); outputAsync2.Wait(); outputListWithCheckpoint.Sort(); @@ -224,7 +224,7 @@ public void BasicUnaryCheckpoint0Row() var query3 = CreateBasicQuery(input3); var output3 = container3.RegisterOutput(query3); - var outputAsync3 = output3.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithoutCheckpoint.Add(o)); + var outputAsync3 = output3.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithoutCheckpoint.Add); container3.Restore(null); outputAsync3.Wait(); @@ -265,9 +265,9 @@ public void BasicUnaryCheckpointDisorderPolicyRow() var query1 = CreateBasicQuery(input1); var output1 = container1.RegisterOutput(query1); - var outputAsync1 = output1.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithCheckpoint.Add(o)); + var outputAsync1 = output1.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithCheckpoint.Add); var pipe1 = container1.Restore(null); - preCheckpointData.ForEachAsync(e => preCheckpointSubject.OnNext(e)).Wait(); + preCheckpointData.ForEachAsync(preCheckpointSubject.OnNext).Wait(); pipe1.Checkpoint(state); state.Seek(0, SeekOrigin.Begin); @@ -277,9 +277,9 @@ public void BasicUnaryCheckpointDisorderPolicyRow() var query2 = CreateBasicQuery(input2); var output2 = container2.RegisterOutput(query2); - var outputAsync2 = output2.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithCheckpoint.Add(o)); + var outputAsync2 = output2.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithCheckpoint.Add); var pipe2 = container2.Restore(state); - postCheckpointData.ForEachAsync(e => postCheckpointSubject.OnNext(e)).Wait(); + postCheckpointData.ForEachAsync(postCheckpointSubject.OnNext).Wait(); postCheckpointSubject.OnCompleted(); outputAsync2.Wait(); outputListWithCheckpoint.Sort(); @@ -289,7 +289,7 @@ public void BasicUnaryCheckpointDisorderPolicyRow() var query3 = CreateBasicQuery(input3); var output3 = container3.RegisterOutput(query3); - var outputAsync3 = output3.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithoutCheckpoint.Add(o)); + var outputAsync3 = output3.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithoutCheckpoint.Add); container3.Restore(null); outputAsync3.Wait(); @@ -333,9 +333,9 @@ public void BasicMulticastCheckpoint0Row() var query1 = query1_left.Union(query1right); var output1 = container1.RegisterOutput(query1); - var outputAsync1 = output1.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithCheckpoint.Add(o)); + var outputAsync1 = output1.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithCheckpoint.Add); var pipe1 = container1.Restore(null); - preCheckpointData.ForEachAsync(e => preCheckpointSubject.OnNext(e)).Wait(); + preCheckpointData.ForEachAsync(preCheckpointSubject.OnNext).Wait(); pipe1.Checkpoint(state); state.Seek(0, SeekOrigin.Begin); @@ -348,9 +348,9 @@ public void BasicMulticastCheckpoint0Row() var query2 = query2_left.Union(query2right); var output2 = container2.RegisterOutput(query2); - var outputAsync2 = output2.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithCheckpoint.Add(o)); + var outputAsync2 = output2.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithCheckpoint.Add); var pipe2 = container2.Restore(state); - postCheckpointData.ForEachAsync(e => postCheckpointSubject.OnNext(e)).Wait(); + postCheckpointData.ForEachAsync(postCheckpointSubject.OnNext).Wait(); postCheckpointSubject.OnCompleted(); outputAsync2.Wait(); outputListWithCheckpoint.Sort(); @@ -363,7 +363,7 @@ public void BasicMulticastCheckpoint0Row() var query3 = query3_left.Union(query3right); var output3 = container3.RegisterOutput(query3); - var outputAsync3 = output3.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithoutCheckpoint.Add(o)); + var outputAsync3 = output3.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithoutCheckpoint.Add); container3.Restore(null); outputAsync3.Wait(); outputListWithoutCheckpoint.Sort(); @@ -408,7 +408,7 @@ public void BasicUnaryCheckpointAnonTypeSelectManyRow() var outputAsync1 = output1.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithCheckpoint.Add(o.p)); var pipe1 = container1.Restore(null); - preCheckpointData.ForEachAsync(e => preCheckpointSubject.OnNext(e)).Wait(); + preCheckpointData.ForEachAsync(preCheckpointSubject.OnNext).Wait(); pipe1.Checkpoint(state); state.Seek(0, SeekOrigin.Begin); @@ -420,7 +420,7 @@ public void BasicUnaryCheckpointAnonTypeSelectManyRow() var outputAsync2 = output2.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithCheckpoint.Add(o.p)); var pipe2 = container2.Restore(state); - postCheckpointData.ForEachAsync(e => postCheckpointSubject.OnNext(e)).Wait(); + postCheckpointData.ForEachAsync(postCheckpointSubject.OnNext).Wait(); postCheckpointSubject.OnCompleted(); outputAsync2.Wait(); outputListWithCheckpoint.Sort(); @@ -472,9 +472,9 @@ public void BasicUnaryCheckpointCountRow() var output1 = container1.RegisterOutput(query1); - var outputAsync1 = output1.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithCheckpoint.Add(o)); + var outputAsync1 = output1.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithCheckpoint.Add); var pipe1 = container1.Restore(null); - preCheckpointData.ForEachAsync(e => preCheckpointSubject.OnNext(e)).Wait(); + preCheckpointData.ForEachAsync(preCheckpointSubject.OnNext).Wait(); pipe1.Checkpoint(state); state.Seek(0, SeekOrigin.Begin); @@ -484,9 +484,9 @@ public void BasicUnaryCheckpointCountRow() var query2 = input2.Count(); var output2 = container2.RegisterOutput(query2); - var outputAsync2 = output2.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithCheckpoint.Add(o)); + var outputAsync2 = output2.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithCheckpoint.Add); var pipe2 = container2.Restore(state); - postCheckpointData.ForEachAsync(e => postCheckpointSubject.OnNext(e)).Wait(); + postCheckpointData.ForEachAsync(postCheckpointSubject.OnNext).Wait(); postCheckpointSubject.OnCompleted(); outputAsync2.Wait(); outputListWithCheckpoint.Sort(); @@ -496,7 +496,7 @@ public void BasicUnaryCheckpointCountRow() var query3 = input3.Count(); var output3 = container3.RegisterOutput(query3); - var outputAsync3 = output3.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithoutCheckpoint.Add(o)); + var outputAsync3 = output3.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithoutCheckpoint.Add); container3.Restore(null); outputAsync3.Wait(); @@ -538,9 +538,9 @@ public void BasicUnaryCheckpointGroupedSumRow() var output1 = container1.RegisterOutput(query1); - var outputAsync1 = output1.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithCheckpoint.Add(o)); + var outputAsync1 = output1.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithCheckpoint.Add); var pipe1 = container1.Restore(null); - preCheckpointData.ForEachAsync(e => preCheckpointSubject.OnNext(e)).Wait(); + preCheckpointData.ForEachAsync(preCheckpointSubject.OnNext).Wait(); pipe1.Checkpoint(state); state.Seek(0, SeekOrigin.Begin); @@ -550,9 +550,9 @@ public void BasicUnaryCheckpointGroupedSumRow() var query2 = input2.GroupApply(e => e.Item1, str => str.Sum(e => (ulong)e.Item2), (g, c) => new StructTuple { Item1 = g.Key, Item2 = c }); var output2 = container2.RegisterOutput(query2); - var outputAsync2 = output2.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithCheckpoint.Add(o)); + var outputAsync2 = output2.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithCheckpoint.Add); var pipe2 = container2.Restore(state); - postCheckpointData.ForEachAsync(e => postCheckpointSubject.OnNext(e)).Wait(); + postCheckpointData.ForEachAsync(postCheckpointSubject.OnNext).Wait(); postCheckpointSubject.OnCompleted(); outputAsync2.Wait(); outputListWithCheckpoint.Sort((a, b) => a.Item1.CompareTo(b.Item1) == 0 ? a.Item2.CompareTo(b.Item2) : a.Item1.CompareTo(b.Item1)); @@ -562,7 +562,7 @@ public void BasicUnaryCheckpointGroupedSumRow() var query3 = input3.GroupApply(e => e.Item1, str => str.Sum(e => (ulong)e.Item2), (g, c) => new StructTuple { Item1 = g.Key, Item2 = c }); var output3 = container3.RegisterOutput(query3); - var outputAsync3 = output3.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithoutCheckpoint.Add(o)); + var outputAsync3 = output3.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithoutCheckpoint.Add); container3.Restore(null); outputAsync3.Wait(); @@ -620,11 +620,11 @@ public void BasicUnaryCheckpointEquiJoinRow() var output1 = container1.RegisterOutput(query1); - var outputAsync1 = output1.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithCheckpoint.Add(o)); + var outputAsync1 = output1.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithCheckpoint.Add); var pipe1 = container1.Restore(null); - preCheckpointData1.ForEachAsync(e => preCheckpointSubject1.OnNext(e)).Wait(); - preCheckpointData2.ForEachAsync(e => preCheckpointSubject2.OnNext(e)).Wait(); + preCheckpointData1.ForEachAsync(preCheckpointSubject1.OnNext).Wait(); + preCheckpointData2.ForEachAsync(preCheckpointSubject2.OnNext).Wait(); pipe1.Checkpoint(state); @@ -636,11 +636,11 @@ public void BasicUnaryCheckpointEquiJoinRow() var query2 = input21.Join(input22, e => e.Item1, e => e.Item1, (l, r) => new StructTuple { Item1 = l.Item1, Item2 = r.Item2 }); var output2 = container2.RegisterOutput(query2); - var outputAsync2 = output2.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithCheckpoint.Add(o)); + var outputAsync2 = output2.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithCheckpoint.Add); var pipe2 = container2.Restore(state); - postCheckpointData1.ForEachAsync(e => postCheckpointSubject1.OnNext(e)).Wait(); - postCheckpointData2.ForEachAsync(e => postCheckpointSubject2.OnNext(e)).Wait(); + postCheckpointData1.ForEachAsync(postCheckpointSubject1.OnNext).Wait(); + postCheckpointData2.ForEachAsync(postCheckpointSubject2.OnNext).Wait(); postCheckpointSubject1.OnCompleted(); postCheckpointSubject2.OnCompleted(); outputAsync2.Wait(); @@ -652,7 +652,7 @@ public void BasicUnaryCheckpointEquiJoinRow() var query3 = input31.Join(input32, e => e.Item1, e => e.Item1, (l, r) => new StructTuple { Item1 = l.Item1, Item2 = r.Item2 }); var output3 = container3.RegisterOutput(query3); - var outputAsync3 = output3.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithoutCheckpoint.Add(o)); + var outputAsync3 = output3.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithoutCheckpoint.Add); container3.Restore(null); outputAsync3.Wait(); @@ -713,11 +713,11 @@ public void BasicUnaryCheckpointLASJRow() var output1 = container1.RegisterOutput(query1); - var outputAsync1 = output1.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithCheckpoint.Add(o)); + var outputAsync1 = output1.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithCheckpoint.Add); var pipe1 = container1.Restore(null); - preCheckpointData1.ForEachAsync(e => preCheckpointSubject1.OnNext(e)).Wait(); - preCheckpointData2.ForEachAsync(e => preCheckpointSubject2.OnNext(e)).Wait(); + preCheckpointData1.ForEachAsync(preCheckpointSubject1.OnNext).Wait(); + preCheckpointData2.ForEachAsync(preCheckpointSubject2.OnNext).Wait(); pipe1.Checkpoint(state); @@ -729,11 +729,11 @@ public void BasicUnaryCheckpointLASJRow() var query2 = input21.WhereNotExists(input22, e => e.Item1, e => e.Item1); var output2 = container2.RegisterOutput(query2); - var outputAsync2 = output2.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithCheckpoint.Add(o)); + var outputAsync2 = output2.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithCheckpoint.Add); var pipe2 = container2.Restore(state); - postCheckpointData1.ForEachAsync(e => postCheckpointSubject1.OnNext(e)).Wait(); - postCheckpointData2.ForEachAsync(e => postCheckpointSubject2.OnNext(e)).Wait(); + postCheckpointData1.ForEachAsync(postCheckpointSubject1.OnNext).Wait(); + postCheckpointData2.ForEachAsync(postCheckpointSubject2.OnNext).Wait(); postCheckpointSubject1.OnCompleted(); postCheckpointSubject2.OnCompleted(); outputAsync2.Wait(); @@ -745,7 +745,7 @@ public void BasicUnaryCheckpointLASJRow() var query3 = input31.WhereNotExists(input32, e => e.Item1, e => e.Item1); var output3 = container3.RegisterOutput(query3); - var outputAsync3 = output3.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithoutCheckpoint.Add(o)); + var outputAsync3 = output3.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithoutCheckpoint.Add); container3.Restore(null); outputAsync3.Wait(); @@ -806,11 +806,11 @@ public void LeftUnaryCheckpointLASJRow() var output1 = container1.RegisterOutput(query1); - var outputAsync1 = output1.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithCheckpoint.Add(o)); + var outputAsync1 = output1.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithCheckpoint.Add); var pipe1 = container1.Restore(null); - preCheckpointData1.ForEachAsync(e => preCheckpointSubject1.OnNext(e)).Wait(); - preCheckpointData2.ForEachAsync(e => preCheckpointSubject2.OnNext(e)).Wait(); + preCheckpointData1.ForEachAsync(preCheckpointSubject1.OnNext).Wait(); + preCheckpointData2.ForEachAsync(preCheckpointSubject2.OnNext).Wait(); pipe1.Checkpoint(state); @@ -822,11 +822,11 @@ public void LeftUnaryCheckpointLASJRow() var query2 = input21.WhereNotExists(input22, e => e.Item1, e => e.Item1); var output2 = container2.RegisterOutput(query2); - var outputAsync2 = output2.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithCheckpoint.Add(o)); + var outputAsync2 = output2.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithCheckpoint.Add); var pipe2 = container2.Restore(state); - postCheckpointData1.ForEachAsync(e => postCheckpointSubject1.OnNext(e)).Wait(); - postCheckpointData2.ForEachAsync(e => postCheckpointSubject2.OnNext(e)).Wait(); + postCheckpointData1.ForEachAsync(postCheckpointSubject1.OnNext).Wait(); + postCheckpointData2.ForEachAsync(postCheckpointSubject2.OnNext).Wait(); postCheckpointSubject1.OnCompleted(); postCheckpointSubject2.OnCompleted(); outputAsync2.Wait(); @@ -838,7 +838,7 @@ public void LeftUnaryCheckpointLASJRow() var query3 = input31.WhereNotExists(input32, e => e.Item1, e => e.Item1); var output3 = container3.RegisterOutput(query3); - var outputAsync3 = output3.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithoutCheckpoint.Add(o)); + var outputAsync3 = output3.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithoutCheckpoint.Add); container3.Restore(null); outputAsync3.Wait(); @@ -899,11 +899,11 @@ public void RightUnaryCheckpointLASJRow() var output1 = container1.RegisterOutput(query1); - var outputAsync1 = output1.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithCheckpoint.Add(o)); + var outputAsync1 = output1.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithCheckpoint.Add); var pipe1 = container1.Restore(null); - preCheckpointData1.ForEachAsync(e => preCheckpointSubject1.OnNext(e)).Wait(); - preCheckpointData2.ForEachAsync(e => preCheckpointSubject2.OnNext(e)).Wait(); + preCheckpointData1.ForEachAsync(preCheckpointSubject1.OnNext).Wait(); + preCheckpointData2.ForEachAsync(preCheckpointSubject2.OnNext).Wait(); pipe1.Checkpoint(state); @@ -915,11 +915,11 @@ public void RightUnaryCheckpointLASJRow() var query2 = input21.WhereNotExists(input22, e => e.Item1, e => e.Item1); var output2 = container2.RegisterOutput(query2); - var outputAsync2 = output2.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithCheckpoint.Add(o)); + var outputAsync2 = output2.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithCheckpoint.Add); var pipe2 = container2.Restore(state); - postCheckpointData1.ForEachAsync(e => postCheckpointSubject1.OnNext(e)).Wait(); - postCheckpointData2.ForEachAsync(e => postCheckpointSubject2.OnNext(e)).Wait(); + postCheckpointData1.ForEachAsync(postCheckpointSubject1.OnNext).Wait(); + postCheckpointData2.ForEachAsync(postCheckpointSubject2.OnNext).Wait(); postCheckpointSubject1.OnCompleted(); postCheckpointSubject2.OnCompleted(); outputAsync2.Wait(); @@ -931,7 +931,7 @@ public void RightUnaryCheckpointLASJRow() var query3 = input31.WhereNotExists(input32, e => e.Item1, e => e.Item1); var output3 = container3.RegisterOutput(query3); - var outputAsync3 = output3.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithoutCheckpoint.Add(o)); + var outputAsync3 = output3.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithoutCheckpoint.Add); container3.Restore(null); outputAsync3.Wait(); @@ -977,10 +977,10 @@ public void SelfUnaryCheckpointLASJRow() var output1 = container1.RegisterOutput(query1); - var outputAsync1 = output1.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithCheckpoint.Add(o)); + var outputAsync1 = output1.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithCheckpoint.Add); var pipe1 = container1.Restore(null); - preCheckpointData.ForEachAsync(e => preCheckpointSubject.OnNext(e)).Wait(); + preCheckpointData.ForEachAsync(preCheckpointSubject.OnNext).Wait(); pipe1.Checkpoint(state); @@ -991,10 +991,10 @@ public void SelfUnaryCheckpointLASJRow() var query2 = input2.GroupApply(o => 1, s => s.Multicast(p => p.WhereNotExists(p.Where(i => false), e => e.Item1, e => e.Item1))); var output2 = container2.RegisterOutput(query2); - var outputAsync2 = output2.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithCheckpoint.Add(o)); + var outputAsync2 = output2.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithCheckpoint.Add); var pipe2 = container2.Restore(state); - postCheckpointData.ForEachAsync(e => postCheckpointSubject.OnNext(e)).Wait(); + postCheckpointData.ForEachAsync(postCheckpointSubject.OnNext).Wait(); postCheckpointSubject.OnCompleted(); outputAsync2.Wait(); outputListWithCheckpoint.Sort((a, b) => a.Item1.CompareTo(b.Item1) == 0 ? a.Item2.CompareTo(b.Item2) : a.Item1.CompareTo(b.Item1)); @@ -1004,7 +1004,7 @@ public void SelfUnaryCheckpointLASJRow() var query3 = input3.GroupApply(o => 1, s => s.Multicast(p => p.WhereNotExists(p.Where(i => false), e => e.Item1, e => e.Item1))); var output3 = container3.RegisterOutput(query3); - var outputAsync3 = output3.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithoutCheckpoint.Add(o)); + var outputAsync3 = output3.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithoutCheckpoint.Add); container3.Restore(null); outputAsync3.Wait(); @@ -1064,11 +1064,11 @@ public void BasicUnaryCheckpointClipRow() var output1 = container1.RegisterOutput(query1); - var outputAsync1 = output1.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithCheckpoint.Add(o)); + var outputAsync1 = output1.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithCheckpoint.Add); var pipe1 = container1.Restore(null); - preCheckpointData1.ForEachAsync(e => preCheckpointSubject1.OnNext(e)).Wait(); - preCheckpointData2.ForEachAsync(e => preCheckpointSubject2.OnNext(e)).Wait(); + preCheckpointData1.ForEachAsync(preCheckpointSubject1.OnNext).Wait(); + preCheckpointData2.ForEachAsync(preCheckpointSubject2.OnNext).Wait(); pipe1.Checkpoint(state); @@ -1080,11 +1080,11 @@ public void BasicUnaryCheckpointClipRow() var query2 = input21.ClipEventDuration(input22, e => e.Item1, e => e.Item1); var output2 = container2.RegisterOutput(query2); - var outputAsync2 = output2.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithCheckpoint.Add(o)); + var outputAsync2 = output2.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithCheckpoint.Add); var pipe2 = container2.Restore(state); - postCheckpointData1.ForEachAsync(e => postCheckpointSubject1.OnNext(e)).Wait(); - postCheckpointData2.ForEachAsync(e => postCheckpointSubject2.OnNext(e)).Wait(); + postCheckpointData1.ForEachAsync(postCheckpointSubject1.OnNext).Wait(); + postCheckpointData2.ForEachAsync(postCheckpointSubject2.OnNext).Wait(); postCheckpointSubject1.OnCompleted(); postCheckpointSubject2.OnCompleted(); outputAsync2.Wait(); @@ -1096,7 +1096,7 @@ public void BasicUnaryCheckpointClipRow() var query3 = input31.ClipEventDuration(input32, e => e.Item1, e => e.Item1); var output3 = container3.RegisterOutput(query3); - var outputAsync3 = output3.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithoutCheckpoint.Add(o)); + var outputAsync3 = output3.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithoutCheckpoint.Add); container3.Restore(null); outputAsync3.Wait(); @@ -1139,7 +1139,7 @@ public void BasicEmptyCheckpointErrorRow() var query1 = query1_left.Union(query1right); var output1 = container1.RegisterOutput(query1); - var outputAsync1 = output1.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithCheckpoint.Add(o)); + var outputAsync1 = output1.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithCheckpoint.Add); try { @@ -1185,9 +1185,9 @@ public void BasicUnaryCheckpointErrorRow() var query1 = CreateBasicQuery(input1); var output1 = container1.RegisterOutput(query1); - var outputAsync1 = output1.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputList.Add(o)); + var outputAsync1 = output1.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputList.Add); var pipe1 = container1.Restore(null); - preCheckpointData.ForEachAsync(e => preCheckpointSubject.OnNext(e)).Wait(); + preCheckpointData.ForEachAsync(preCheckpointSubject.OnNext).Wait(); pipe1.Checkpoint(state); state.Seek(0, SeekOrigin.Begin); @@ -1197,9 +1197,9 @@ public void BasicUnaryCheckpointErrorRow() var query2 = CreateBasicQuery(input2); var output2 = container2.RegisterOutput(query2); - var outputAsync2 = output2.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputList.Add(o)); + var outputAsync2 = output2.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputList.Add); var pipe2 = container2.Restore(state); - postCheckpointData.ForEachAsync(e => postCheckpointSubject.OnNext(e)).Wait(); + postCheckpointData.ForEachAsync(postCheckpointSubject.OnNext).Wait(); outputAsync2.Wait(); } catch (AggregateException e) @@ -1243,9 +1243,9 @@ public void BasicDisorderPolicyErrorRow() var query1 = CreateBasicQuery(input1); var output1 = container1.RegisterOutput(query1); - var outputAsync1 = output1.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputList.Add(o)); + var outputAsync1 = output1.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputList.Add); var pipe1 = container1.Restore(null); - preCheckpointData.ForEachAsync(e => preCheckpointSubject.OnNext(e)).Wait(); + preCheckpointData.ForEachAsync(preCheckpointSubject.OnNext).Wait(); pipe1.Checkpoint(state); state.Seek(0, SeekOrigin.Begin); @@ -1257,9 +1257,9 @@ public void BasicDisorderPolicyErrorRow() var query2 = CreateBasicQuery(input2); var output2 = container2.RegisterOutput(query2); - var outputAsync2 = output2.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputList.Add(o)); + var outputAsync2 = output2.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputList.Add); var pipe2 = container2.Restore(state); - postCheckpointData.ForEachAsync(e => postCheckpointSubject.OnNext(e)).Wait(); + postCheckpointData.ForEachAsync(postCheckpointSubject.OnNext).Wait(); postCheckpointSubject.OnCompleted(); outputAsync2.Wait(); } @@ -1300,9 +1300,9 @@ public void BasicDisorderAdjustPolicyRow() var query1 = CreateBasicQuery(input1); var output1 = container1.RegisterOutput(query1); - var outputAsync1 = output1.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputList.Add(o)); + var outputAsync1 = output1.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputList.Add); var pipe1 = container1.Restore(null); - preCheckpointData.ForEachAsync(e => preCheckpointSubject.OnNext(e)).Wait(); + preCheckpointData.ForEachAsync(preCheckpointSubject.OnNext).Wait(); pipe1.Checkpoint(state); state.Seek(0, SeekOrigin.Begin); @@ -1312,13 +1312,13 @@ public void BasicDisorderAdjustPolicyRow() var query2 = CreateBasicQuery(input2); var output2 = container2.RegisterOutput(query2); - var outputAsync2 = output2.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputList.Add(o)); + var outputAsync2 = output2.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputList.Add); var pipe2 = container2.Restore(state); - postCheckpointData.ForEachAsync(e => postCheckpointSubject.OnNext(e)).Wait(); + postCheckpointData.ForEachAsync(postCheckpointSubject.OnNext).Wait(); postCheckpointSubject.OnCompleted(); outputAsync2.Wait(); - Assert.IsTrue(outputList.Count == 10000); + Assert.HasCount(10000, outputList); preCheckpointSubject.OnCompleted(); } @@ -1542,9 +1542,9 @@ public void BasicUnaryCheckpointHoppingWindowSumRowSmallBatch() var output1 = container1.RegisterOutput(query1); - var outputAsync1 = output1.Where(e => e.IsData).ForEachAsync(o => outputListWithCheckpoint.Add(o)); + var outputAsync1 = output1.Where(e => e.IsData).ForEachAsync(outputListWithCheckpoint.Add); var pipe1 = container1.Restore(null); - preCheckpointData.ForEachAsync(e => preCheckpointSubject.OnNext(e)).Wait(); + preCheckpointData.ForEachAsync(preCheckpointSubject.OnNext).Wait(); pipe1.Checkpoint(state); state.Seek(0, SeekOrigin.Begin); @@ -1554,10 +1554,10 @@ public void BasicUnaryCheckpointHoppingWindowSumRowSmallBatch() var query2 = input2.HoppingWindowLifetime(window, period).Sum(e => (ulong)e); var output2 = container2.RegisterOutput(query2); - var outputAsync2 = output2.Where(e => e.IsData).ForEachAsync(o => outputListWithCheckpoint.Add(o)); + var outputAsync2 = output2.Where(e => e.IsData).ForEachAsync(outputListWithCheckpoint.Add); var pipe2 = container2.Restore(state); - postCheckpointData.ForEachAsync(e => postCheckpointSubject.OnNext(e)).Wait(); + postCheckpointData.ForEachAsync(postCheckpointSubject.OnNext).Wait(); postCheckpointSubject.OnCompleted(); outputAsync2.Wait(); outputListWithCheckpoint.Sort((x, y) => @@ -1575,7 +1575,7 @@ public void BasicUnaryCheckpointHoppingWindowSumRowSmallBatch() var query3 = input3.HoppingWindowLifetime(window, period).Sum(e => (ulong)e); var output3 = container3.RegisterOutput(query3); - var outputAsync3 = output3.Where(e => e.IsData).ForEachAsync(o => outputListWithoutCheckpoint.Add(o)); + var outputAsync3 = output3.Where(e => e.IsData).ForEachAsync(outputListWithoutCheckpoint.Add); container3.Restore(null); outputAsync3.Wait(); outputListWithoutCheckpoint.Sort((x, y) => @@ -1672,9 +1672,9 @@ public void BasicUnaryCheckpoint0RowSmallBatch() var query1 = CreateBasicQuery(input1); var output1 = container1.RegisterOutput(query1); - var outputAsync1 = output1.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithCheckpoint.Add(o)); + var outputAsync1 = output1.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithCheckpoint.Add); var pipe1 = container1.Restore(null); - preCheckpointData.ForEachAsync(e => preCheckpointSubject.OnNext(e)).Wait(); + preCheckpointData.ForEachAsync(preCheckpointSubject.OnNext).Wait(); pipe1.Checkpoint(state); state.Seek(0, SeekOrigin.Begin); @@ -1684,9 +1684,9 @@ public void BasicUnaryCheckpoint0RowSmallBatch() var query2 = CreateBasicQuery(input2); var output2 = container2.RegisterOutput(query2); - var outputAsync2 = output2.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithCheckpoint.Add(o)); + var outputAsync2 = output2.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithCheckpoint.Add); var pipe2 = container2.Restore(state); - postCheckpointData.ForEachAsync(e => postCheckpointSubject.OnNext(e)).Wait(); + postCheckpointData.ForEachAsync(postCheckpointSubject.OnNext).Wait(); postCheckpointSubject.OnCompleted(); outputAsync2.Wait(); outputListWithCheckpoint.Sort(); @@ -1696,7 +1696,7 @@ public void BasicUnaryCheckpoint0RowSmallBatch() var query3 = CreateBasicQuery(input3); var output3 = container3.RegisterOutput(query3); - var outputAsync3 = output3.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithoutCheckpoint.Add(o)); + var outputAsync3 = output3.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithoutCheckpoint.Add); container3.Restore(null); outputAsync3.Wait(); @@ -1737,9 +1737,9 @@ public void BasicUnaryCheckpointDisorderPolicyRowSmallBatch() var query1 = CreateBasicQuery(input1); var output1 = container1.RegisterOutput(query1); - var outputAsync1 = output1.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithCheckpoint.Add(o)); + var outputAsync1 = output1.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithCheckpoint.Add); var pipe1 = container1.Restore(null); - preCheckpointData.ForEachAsync(e => preCheckpointSubject.OnNext(e)).Wait(); + preCheckpointData.ForEachAsync(preCheckpointSubject.OnNext).Wait(); pipe1.Checkpoint(state); state.Seek(0, SeekOrigin.Begin); @@ -1749,9 +1749,9 @@ public void BasicUnaryCheckpointDisorderPolicyRowSmallBatch() var query2 = CreateBasicQuery(input2); var output2 = container2.RegisterOutput(query2); - var outputAsync2 = output2.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithCheckpoint.Add(o)); + var outputAsync2 = output2.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithCheckpoint.Add); var pipe2 = container2.Restore(state); - postCheckpointData.ForEachAsync(e => postCheckpointSubject.OnNext(e)).Wait(); + postCheckpointData.ForEachAsync(postCheckpointSubject.OnNext).Wait(); postCheckpointSubject.OnCompleted(); outputAsync2.Wait(); outputListWithCheckpoint.Sort(); @@ -1761,7 +1761,7 @@ public void BasicUnaryCheckpointDisorderPolicyRowSmallBatch() var query3 = CreateBasicQuery(input3); var output3 = container3.RegisterOutput(query3); - var outputAsync3 = output3.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithoutCheckpoint.Add(o)); + var outputAsync3 = output3.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithoutCheckpoint.Add); container3.Restore(null); outputAsync3.Wait(); @@ -1805,9 +1805,9 @@ public void BasicMulticastCheckpoint0RowSmallBatch() var query1 = query1_left.Union(query1right); var output1 = container1.RegisterOutput(query1); - var outputAsync1 = output1.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithCheckpoint.Add(o)); + var outputAsync1 = output1.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithCheckpoint.Add); var pipe1 = container1.Restore(null); - preCheckpointData.ForEachAsync(e => preCheckpointSubject.OnNext(e)).Wait(); + preCheckpointData.ForEachAsync(preCheckpointSubject.OnNext).Wait(); pipe1.Checkpoint(state); state.Seek(0, SeekOrigin.Begin); @@ -1820,9 +1820,9 @@ public void BasicMulticastCheckpoint0RowSmallBatch() var query2 = query2_left.Union(query2right); var output2 = container2.RegisterOutput(query2); - var outputAsync2 = output2.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithCheckpoint.Add(o)); + var outputAsync2 = output2.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithCheckpoint.Add); var pipe2 = container2.Restore(state); - postCheckpointData.ForEachAsync(e => postCheckpointSubject.OnNext(e)).Wait(); + postCheckpointData.ForEachAsync(postCheckpointSubject.OnNext).Wait(); postCheckpointSubject.OnCompleted(); outputAsync2.Wait(); outputListWithCheckpoint.Sort(); @@ -1835,7 +1835,7 @@ public void BasicMulticastCheckpoint0RowSmallBatch() var query3 = query3_left.Union(query3right); var output3 = container3.RegisterOutput(query3); - var outputAsync3 = output3.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithoutCheckpoint.Add(o)); + var outputAsync3 = output3.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithoutCheckpoint.Add); container3.Restore(null); outputAsync3.Wait(); outputListWithoutCheckpoint.Sort(); @@ -1880,7 +1880,7 @@ public void BasicUnaryCheckpointAnonTypeSelectManyRowSmallBatch() var outputAsync1 = output1.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithCheckpoint.Add(o.p)); var pipe1 = container1.Restore(null); - preCheckpointData.ForEachAsync(e => preCheckpointSubject.OnNext(e)).Wait(); + preCheckpointData.ForEachAsync(preCheckpointSubject.OnNext).Wait(); pipe1.Checkpoint(state); state.Seek(0, SeekOrigin.Begin); @@ -1892,7 +1892,7 @@ public void BasicUnaryCheckpointAnonTypeSelectManyRowSmallBatch() var outputAsync2 = output2.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithCheckpoint.Add(o.p)); var pipe2 = container2.Restore(state); - postCheckpointData.ForEachAsync(e => postCheckpointSubject.OnNext(e)).Wait(); + postCheckpointData.ForEachAsync(postCheckpointSubject.OnNext).Wait(); postCheckpointSubject.OnCompleted(); outputAsync2.Wait(); outputListWithCheckpoint.Sort(); @@ -1944,9 +1944,9 @@ public void BasicUnaryCheckpointCountRowSmallBatch() var output1 = container1.RegisterOutput(query1); - var outputAsync1 = output1.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithCheckpoint.Add(o)); + var outputAsync1 = output1.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithCheckpoint.Add); var pipe1 = container1.Restore(null); - preCheckpointData.ForEachAsync(e => preCheckpointSubject.OnNext(e)).Wait(); + preCheckpointData.ForEachAsync(preCheckpointSubject.OnNext).Wait(); pipe1.Checkpoint(state); state.Seek(0, SeekOrigin.Begin); @@ -1956,9 +1956,9 @@ public void BasicUnaryCheckpointCountRowSmallBatch() var query2 = input2.Count(); var output2 = container2.RegisterOutput(query2); - var outputAsync2 = output2.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithCheckpoint.Add(o)); + var outputAsync2 = output2.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithCheckpoint.Add); var pipe2 = container2.Restore(state); - postCheckpointData.ForEachAsync(e => postCheckpointSubject.OnNext(e)).Wait(); + postCheckpointData.ForEachAsync(postCheckpointSubject.OnNext).Wait(); postCheckpointSubject.OnCompleted(); outputAsync2.Wait(); outputListWithCheckpoint.Sort(); @@ -1968,7 +1968,7 @@ public void BasicUnaryCheckpointCountRowSmallBatch() var query3 = input3.Count(); var output3 = container3.RegisterOutput(query3); - var outputAsync3 = output3.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithoutCheckpoint.Add(o)); + var outputAsync3 = output3.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithoutCheckpoint.Add); container3.Restore(null); outputAsync3.Wait(); @@ -2010,9 +2010,9 @@ public void BasicUnaryCheckpointGroupedSumRowSmallBatch() var output1 = container1.RegisterOutput(query1); - var outputAsync1 = output1.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithCheckpoint.Add(o)); + var outputAsync1 = output1.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithCheckpoint.Add); var pipe1 = container1.Restore(null); - preCheckpointData.ForEachAsync(e => preCheckpointSubject.OnNext(e)).Wait(); + preCheckpointData.ForEachAsync(preCheckpointSubject.OnNext).Wait(); pipe1.Checkpoint(state); state.Seek(0, SeekOrigin.Begin); @@ -2022,9 +2022,9 @@ public void BasicUnaryCheckpointGroupedSumRowSmallBatch() var query2 = input2.GroupApply(e => e.Item1, str => str.Sum(e => (ulong)e.Item2), (g, c) => new StructTuple { Item1 = g.Key, Item2 = c }); var output2 = container2.RegisterOutput(query2); - var outputAsync2 = output2.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithCheckpoint.Add(o)); + var outputAsync2 = output2.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithCheckpoint.Add); var pipe2 = container2.Restore(state); - postCheckpointData.ForEachAsync(e => postCheckpointSubject.OnNext(e)).Wait(); + postCheckpointData.ForEachAsync(postCheckpointSubject.OnNext).Wait(); postCheckpointSubject.OnCompleted(); outputAsync2.Wait(); outputListWithCheckpoint.Sort((a, b) => a.Item1.CompareTo(b.Item1) == 0 ? a.Item2.CompareTo(b.Item2) : a.Item1.CompareTo(b.Item1)); @@ -2034,7 +2034,7 @@ public void BasicUnaryCheckpointGroupedSumRowSmallBatch() var query3 = input3.GroupApply(e => e.Item1, str => str.Sum(e => (ulong)e.Item2), (g, c) => new StructTuple { Item1 = g.Key, Item2 = c }); var output3 = container3.RegisterOutput(query3); - var outputAsync3 = output3.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithoutCheckpoint.Add(o)); + var outputAsync3 = output3.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithoutCheckpoint.Add); container3.Restore(null); outputAsync3.Wait(); @@ -2092,11 +2092,11 @@ public void BasicUnaryCheckpointEquiJoinRowSmallBatch() var output1 = container1.RegisterOutput(query1); - var outputAsync1 = output1.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithCheckpoint.Add(o)); + var outputAsync1 = output1.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithCheckpoint.Add); var pipe1 = container1.Restore(null); - preCheckpointData1.ForEachAsync(e => preCheckpointSubject1.OnNext(e)).Wait(); - preCheckpointData2.ForEachAsync(e => preCheckpointSubject2.OnNext(e)).Wait(); + preCheckpointData1.ForEachAsync(preCheckpointSubject1.OnNext).Wait(); + preCheckpointData2.ForEachAsync(preCheckpointSubject2.OnNext).Wait(); pipe1.Checkpoint(state); @@ -2108,11 +2108,11 @@ public void BasicUnaryCheckpointEquiJoinRowSmallBatch() var query2 = input21.Join(input22, e => e.Item1, e => e.Item1, (l, r) => new StructTuple { Item1 = l.Item1, Item2 = r.Item2 }); var output2 = container2.RegisterOutput(query2); - var outputAsync2 = output2.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithCheckpoint.Add(o)); + var outputAsync2 = output2.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithCheckpoint.Add); var pipe2 = container2.Restore(state); - postCheckpointData1.ForEachAsync(e => postCheckpointSubject1.OnNext(e)).Wait(); - postCheckpointData2.ForEachAsync(e => postCheckpointSubject2.OnNext(e)).Wait(); + postCheckpointData1.ForEachAsync(postCheckpointSubject1.OnNext).Wait(); + postCheckpointData2.ForEachAsync(postCheckpointSubject2.OnNext).Wait(); postCheckpointSubject1.OnCompleted(); postCheckpointSubject2.OnCompleted(); outputAsync2.Wait(); @@ -2124,7 +2124,7 @@ public void BasicUnaryCheckpointEquiJoinRowSmallBatch() var query3 = input31.Join(input32, e => e.Item1, e => e.Item1, (l, r) => new StructTuple { Item1 = l.Item1, Item2 = r.Item2 }); var output3 = container3.RegisterOutput(query3); - var outputAsync3 = output3.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithoutCheckpoint.Add(o)); + var outputAsync3 = output3.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithoutCheckpoint.Add); container3.Restore(null); outputAsync3.Wait(); @@ -2185,11 +2185,11 @@ public void BasicUnaryCheckpointLASJRowSmallBatch() var output1 = container1.RegisterOutput(query1); - var outputAsync1 = output1.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithCheckpoint.Add(o)); + var outputAsync1 = output1.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithCheckpoint.Add); var pipe1 = container1.Restore(null); - preCheckpointData1.ForEachAsync(e => preCheckpointSubject1.OnNext(e)).Wait(); - preCheckpointData2.ForEachAsync(e => preCheckpointSubject2.OnNext(e)).Wait(); + preCheckpointData1.ForEachAsync(preCheckpointSubject1.OnNext).Wait(); + preCheckpointData2.ForEachAsync(preCheckpointSubject2.OnNext).Wait(); pipe1.Checkpoint(state); @@ -2201,11 +2201,11 @@ public void BasicUnaryCheckpointLASJRowSmallBatch() var query2 = input21.WhereNotExists(input22, e => e.Item1, e => e.Item1); var output2 = container2.RegisterOutput(query2); - var outputAsync2 = output2.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithCheckpoint.Add(o)); + var outputAsync2 = output2.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithCheckpoint.Add); var pipe2 = container2.Restore(state); - postCheckpointData1.ForEachAsync(e => postCheckpointSubject1.OnNext(e)).Wait(); - postCheckpointData2.ForEachAsync(e => postCheckpointSubject2.OnNext(e)).Wait(); + postCheckpointData1.ForEachAsync(postCheckpointSubject1.OnNext).Wait(); + postCheckpointData2.ForEachAsync(postCheckpointSubject2.OnNext).Wait(); postCheckpointSubject1.OnCompleted(); postCheckpointSubject2.OnCompleted(); outputAsync2.Wait(); @@ -2217,7 +2217,7 @@ public void BasicUnaryCheckpointLASJRowSmallBatch() var query3 = input31.WhereNotExists(input32, e => e.Item1, e => e.Item1); var output3 = container3.RegisterOutput(query3); - var outputAsync3 = output3.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithoutCheckpoint.Add(o)); + var outputAsync3 = output3.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithoutCheckpoint.Add); container3.Restore(null); outputAsync3.Wait(); @@ -2278,11 +2278,11 @@ public void LeftUnaryCheckpointLASJRowSmallBatch() var output1 = container1.RegisterOutput(query1); - var outputAsync1 = output1.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithCheckpoint.Add(o)); + var outputAsync1 = output1.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithCheckpoint.Add); var pipe1 = container1.Restore(null); - preCheckpointData1.ForEachAsync(e => preCheckpointSubject1.OnNext(e)).Wait(); - preCheckpointData2.ForEachAsync(e => preCheckpointSubject2.OnNext(e)).Wait(); + preCheckpointData1.ForEachAsync(preCheckpointSubject1.OnNext).Wait(); + preCheckpointData2.ForEachAsync(preCheckpointSubject2.OnNext).Wait(); pipe1.Checkpoint(state); @@ -2294,11 +2294,11 @@ public void LeftUnaryCheckpointLASJRowSmallBatch() var query2 = input21.WhereNotExists(input22, e => e.Item1, e => e.Item1); var output2 = container2.RegisterOutput(query2); - var outputAsync2 = output2.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithCheckpoint.Add(o)); + var outputAsync2 = output2.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithCheckpoint.Add); var pipe2 = container2.Restore(state); - postCheckpointData1.ForEachAsync(e => postCheckpointSubject1.OnNext(e)).Wait(); - postCheckpointData2.ForEachAsync(e => postCheckpointSubject2.OnNext(e)).Wait(); + postCheckpointData1.ForEachAsync(postCheckpointSubject1.OnNext).Wait(); + postCheckpointData2.ForEachAsync(postCheckpointSubject2.OnNext).Wait(); postCheckpointSubject1.OnCompleted(); postCheckpointSubject2.OnCompleted(); outputAsync2.Wait(); @@ -2310,7 +2310,7 @@ public void LeftUnaryCheckpointLASJRowSmallBatch() var query3 = input31.WhereNotExists(input32, e => e.Item1, e => e.Item1); var output3 = container3.RegisterOutput(query3); - var outputAsync3 = output3.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithoutCheckpoint.Add(o)); + var outputAsync3 = output3.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithoutCheckpoint.Add); container3.Restore(null); outputAsync3.Wait(); @@ -2371,11 +2371,11 @@ public void RightUnaryCheckpointLASJRowSmallBatch() var output1 = container1.RegisterOutput(query1); - var outputAsync1 = output1.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithCheckpoint.Add(o)); + var outputAsync1 = output1.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithCheckpoint.Add); var pipe1 = container1.Restore(null); - preCheckpointData1.ForEachAsync(e => preCheckpointSubject1.OnNext(e)).Wait(); - preCheckpointData2.ForEachAsync(e => preCheckpointSubject2.OnNext(e)).Wait(); + preCheckpointData1.ForEachAsync(preCheckpointSubject1.OnNext).Wait(); + preCheckpointData2.ForEachAsync(preCheckpointSubject2.OnNext).Wait(); pipe1.Checkpoint(state); @@ -2387,11 +2387,11 @@ public void RightUnaryCheckpointLASJRowSmallBatch() var query2 = input21.WhereNotExists(input22, e => e.Item1, e => e.Item1); var output2 = container2.RegisterOutput(query2); - var outputAsync2 = output2.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithCheckpoint.Add(o)); + var outputAsync2 = output2.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithCheckpoint.Add); var pipe2 = container2.Restore(state); - postCheckpointData1.ForEachAsync(e => postCheckpointSubject1.OnNext(e)).Wait(); - postCheckpointData2.ForEachAsync(e => postCheckpointSubject2.OnNext(e)).Wait(); + postCheckpointData1.ForEachAsync(postCheckpointSubject1.OnNext).Wait(); + postCheckpointData2.ForEachAsync(postCheckpointSubject2.OnNext).Wait(); postCheckpointSubject1.OnCompleted(); postCheckpointSubject2.OnCompleted(); outputAsync2.Wait(); @@ -2403,7 +2403,7 @@ public void RightUnaryCheckpointLASJRowSmallBatch() var query3 = input31.WhereNotExists(input32, e => e.Item1, e => e.Item1); var output3 = container3.RegisterOutput(query3); - var outputAsync3 = output3.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithoutCheckpoint.Add(o)); + var outputAsync3 = output3.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithoutCheckpoint.Add); container3.Restore(null); outputAsync3.Wait(); @@ -2449,10 +2449,10 @@ public void SelfUnaryCheckpointLASJRowSmallBatch() var output1 = container1.RegisterOutput(query1); - var outputAsync1 = output1.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithCheckpoint.Add(o)); + var outputAsync1 = output1.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithCheckpoint.Add); var pipe1 = container1.Restore(null); - preCheckpointData.ForEachAsync(e => preCheckpointSubject.OnNext(e)).Wait(); + preCheckpointData.ForEachAsync(preCheckpointSubject.OnNext).Wait(); pipe1.Checkpoint(state); @@ -2463,10 +2463,10 @@ public void SelfUnaryCheckpointLASJRowSmallBatch() var query2 = input2.GroupApply(o => 1, s => s.Multicast(p => p.WhereNotExists(p.Where(i => false), e => e.Item1, e => e.Item1))); var output2 = container2.RegisterOutput(query2); - var outputAsync2 = output2.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithCheckpoint.Add(o)); + var outputAsync2 = output2.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithCheckpoint.Add); var pipe2 = container2.Restore(state); - postCheckpointData.ForEachAsync(e => postCheckpointSubject.OnNext(e)).Wait(); + postCheckpointData.ForEachAsync(postCheckpointSubject.OnNext).Wait(); postCheckpointSubject.OnCompleted(); outputAsync2.Wait(); outputListWithCheckpoint.Sort((a, b) => a.Item1.CompareTo(b.Item1) == 0 ? a.Item2.CompareTo(b.Item2) : a.Item1.CompareTo(b.Item1)); @@ -2476,7 +2476,7 @@ public void SelfUnaryCheckpointLASJRowSmallBatch() var query3 = input3.GroupApply(o => 1, s => s.Multicast(p => p.WhereNotExists(p.Where(i => false), e => e.Item1, e => e.Item1))); var output3 = container3.RegisterOutput(query3); - var outputAsync3 = output3.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithoutCheckpoint.Add(o)); + var outputAsync3 = output3.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithoutCheckpoint.Add); container3.Restore(null); outputAsync3.Wait(); @@ -2536,11 +2536,11 @@ public void BasicUnaryCheckpointClipRowSmallBatch() var output1 = container1.RegisterOutput(query1); - var outputAsync1 = output1.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithCheckpoint.Add(o)); + var outputAsync1 = output1.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithCheckpoint.Add); var pipe1 = container1.Restore(null); - preCheckpointData1.ForEachAsync(e => preCheckpointSubject1.OnNext(e)).Wait(); - preCheckpointData2.ForEachAsync(e => preCheckpointSubject2.OnNext(e)).Wait(); + preCheckpointData1.ForEachAsync(preCheckpointSubject1.OnNext).Wait(); + preCheckpointData2.ForEachAsync(preCheckpointSubject2.OnNext).Wait(); pipe1.Checkpoint(state); @@ -2552,11 +2552,11 @@ public void BasicUnaryCheckpointClipRowSmallBatch() var query2 = input21.ClipEventDuration(input22, e => e.Item1, e => e.Item1); var output2 = container2.RegisterOutput(query2); - var outputAsync2 = output2.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithCheckpoint.Add(o)); + var outputAsync2 = output2.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithCheckpoint.Add); var pipe2 = container2.Restore(state); - postCheckpointData1.ForEachAsync(e => postCheckpointSubject1.OnNext(e)).Wait(); - postCheckpointData2.ForEachAsync(e => postCheckpointSubject2.OnNext(e)).Wait(); + postCheckpointData1.ForEachAsync(postCheckpointSubject1.OnNext).Wait(); + postCheckpointData2.ForEachAsync(postCheckpointSubject2.OnNext).Wait(); postCheckpointSubject1.OnCompleted(); postCheckpointSubject2.OnCompleted(); outputAsync2.Wait(); @@ -2568,7 +2568,7 @@ public void BasicUnaryCheckpointClipRowSmallBatch() var query3 = input31.ClipEventDuration(input32, e => e.Item1, e => e.Item1); var output3 = container3.RegisterOutput(query3); - var outputAsync3 = output3.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithoutCheckpoint.Add(o)); + var outputAsync3 = output3.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithoutCheckpoint.Add); container3.Restore(null); outputAsync3.Wait(); @@ -2611,7 +2611,7 @@ public void BasicEmptyCheckpointErrorRowSmallBatch() var query1 = query1_left.Union(query1right); var output1 = container1.RegisterOutput(query1); - var outputAsync1 = output1.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithCheckpoint.Add(o)); + var outputAsync1 = output1.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithCheckpoint.Add); try { @@ -2657,9 +2657,9 @@ public void BasicUnaryCheckpointErrorRowSmallBatch() var query1 = CreateBasicQuery(input1); var output1 = container1.RegisterOutput(query1); - var outputAsync1 = output1.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputList.Add(o)); + var outputAsync1 = output1.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputList.Add); var pipe1 = container1.Restore(null); - preCheckpointData.ForEachAsync(e => preCheckpointSubject.OnNext(e)).Wait(); + preCheckpointData.ForEachAsync(preCheckpointSubject.OnNext).Wait(); pipe1.Checkpoint(state); state.Seek(0, SeekOrigin.Begin); @@ -2669,9 +2669,9 @@ public void BasicUnaryCheckpointErrorRowSmallBatch() var query2 = CreateBasicQuery(input2); var output2 = container2.RegisterOutput(query2); - var outputAsync2 = output2.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputList.Add(o)); + var outputAsync2 = output2.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputList.Add); var pipe2 = container2.Restore(state); - postCheckpointData.ForEachAsync(e => postCheckpointSubject.OnNext(e)).Wait(); + postCheckpointData.ForEachAsync(postCheckpointSubject.OnNext).Wait(); outputAsync2.Wait(); } catch (AggregateException e) @@ -2715,9 +2715,9 @@ public void BasicDisorderPolicyErrorRowSmallBatch() var query1 = CreateBasicQuery(input1); var output1 = container1.RegisterOutput(query1); - var outputAsync1 = output1.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputList.Add(o)); + var outputAsync1 = output1.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputList.Add); var pipe1 = container1.Restore(null); - preCheckpointData.ForEachAsync(e => preCheckpointSubject.OnNext(e)).Wait(); + preCheckpointData.ForEachAsync(preCheckpointSubject.OnNext).Wait(); pipe1.Checkpoint(state); state.Seek(0, SeekOrigin.Begin); @@ -2729,9 +2729,9 @@ public void BasicDisorderPolicyErrorRowSmallBatch() var query2 = CreateBasicQuery(input2); var output2 = container2.RegisterOutput(query2); - var outputAsync2 = output2.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputList.Add(o)); + var outputAsync2 = output2.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputList.Add); var pipe2 = container2.Restore(state); - postCheckpointData.ForEachAsync(e => postCheckpointSubject.OnNext(e)).Wait(); + postCheckpointData.ForEachAsync(postCheckpointSubject.OnNext).Wait(); postCheckpointSubject.OnCompleted(); outputAsync2.Wait(); } @@ -2772,9 +2772,9 @@ public void BasicDisorderAdjustPolicyRowSmallBatch() var query1 = CreateBasicQuery(input1); var output1 = container1.RegisterOutput(query1); - var outputAsync1 = output1.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputList.Add(o)); + var outputAsync1 = output1.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputList.Add); var pipe1 = container1.Restore(null); - preCheckpointData.ForEachAsync(e => preCheckpointSubject.OnNext(e)).Wait(); + preCheckpointData.ForEachAsync(preCheckpointSubject.OnNext).Wait(); pipe1.Checkpoint(state); state.Seek(0, SeekOrigin.Begin); @@ -2784,13 +2784,13 @@ public void BasicDisorderAdjustPolicyRowSmallBatch() var query2 = CreateBasicQuery(input2); var output2 = container2.RegisterOutput(query2); - var outputAsync2 = output2.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputList.Add(o)); + var outputAsync2 = output2.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputList.Add); var pipe2 = container2.Restore(state); - postCheckpointData.ForEachAsync(e => postCheckpointSubject.OnNext(e)).Wait(); + postCheckpointData.ForEachAsync(postCheckpointSubject.OnNext).Wait(); postCheckpointSubject.OnCompleted(); outputAsync2.Wait(); - Assert.IsTrue(outputList.Count == 10000); + Assert.HasCount(10000, outputList); preCheckpointSubject.OnCompleted(); } @@ -3013,9 +3013,9 @@ public void BasicUnaryCheckpointHoppingWindowSumColumnar() var output1 = container1.RegisterOutput(query1); - var outputAsync1 = output1.Where(e => e.IsData).ForEachAsync(o => outputListWithCheckpoint.Add(o)); + var outputAsync1 = output1.Where(e => e.IsData).ForEachAsync(outputListWithCheckpoint.Add); var pipe1 = container1.Restore(null); - preCheckpointData.ForEachAsync(e => preCheckpointSubject.OnNext(e)).Wait(); + preCheckpointData.ForEachAsync(preCheckpointSubject.OnNext).Wait(); pipe1.Checkpoint(state); state.Seek(0, SeekOrigin.Begin); @@ -3025,10 +3025,10 @@ public void BasicUnaryCheckpointHoppingWindowSumColumnar() var query2 = input2.HoppingWindowLifetime(window, period).Sum(e => (ulong)e); var output2 = container2.RegisterOutput(query2); - var outputAsync2 = output2.Where(e => e.IsData).ForEachAsync(o => outputListWithCheckpoint.Add(o)); + var outputAsync2 = output2.Where(e => e.IsData).ForEachAsync(outputListWithCheckpoint.Add); var pipe2 = container2.Restore(state); - postCheckpointData.ForEachAsync(e => postCheckpointSubject.OnNext(e)).Wait(); + postCheckpointData.ForEachAsync(postCheckpointSubject.OnNext).Wait(); postCheckpointSubject.OnCompleted(); outputAsync2.Wait(); outputListWithCheckpoint.Sort((x, y) => @@ -3046,7 +3046,7 @@ public void BasicUnaryCheckpointHoppingWindowSumColumnar() var query3 = input3.HoppingWindowLifetime(window, period).Sum(e => (ulong)e); var output3 = container3.RegisterOutput(query3); - var outputAsync3 = output3.Where(e => e.IsData).ForEachAsync(o => outputListWithoutCheckpoint.Add(o)); + var outputAsync3 = output3.Where(e => e.IsData).ForEachAsync(outputListWithoutCheckpoint.Add); container3.Restore(null); outputAsync3.Wait(); outputListWithoutCheckpoint.Sort((x, y) => @@ -3142,9 +3142,9 @@ public void BasicUnaryCheckpoint0Columnar() var query1 = CreateBasicQuery(input1); var output1 = container1.RegisterOutput(query1); - var outputAsync1 = output1.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithCheckpoint.Add(o)); + var outputAsync1 = output1.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithCheckpoint.Add); var pipe1 = container1.Restore(null); - preCheckpointData.ForEachAsync(e => preCheckpointSubject.OnNext(e)).Wait(); + preCheckpointData.ForEachAsync(preCheckpointSubject.OnNext).Wait(); pipe1.Checkpoint(state); state.Seek(0, SeekOrigin.Begin); @@ -3154,9 +3154,9 @@ public void BasicUnaryCheckpoint0Columnar() var query2 = CreateBasicQuery(input2); var output2 = container2.RegisterOutput(query2); - var outputAsync2 = output2.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithCheckpoint.Add(o)); + var outputAsync2 = output2.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithCheckpoint.Add); var pipe2 = container2.Restore(state); - postCheckpointData.ForEachAsync(e => postCheckpointSubject.OnNext(e)).Wait(); + postCheckpointData.ForEachAsync(postCheckpointSubject.OnNext).Wait(); postCheckpointSubject.OnCompleted(); outputAsync2.Wait(); outputListWithCheckpoint.Sort(); @@ -3166,7 +3166,7 @@ public void BasicUnaryCheckpoint0Columnar() var query3 = CreateBasicQuery(input3); var output3 = container3.RegisterOutput(query3); - var outputAsync3 = output3.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithoutCheckpoint.Add(o)); + var outputAsync3 = output3.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithoutCheckpoint.Add); container3.Restore(null); outputAsync3.Wait(); @@ -3207,9 +3207,9 @@ public void BasicUnaryCheckpointDisorderPolicyColumnar() var query1 = CreateBasicQuery(input1); var output1 = container1.RegisterOutput(query1); - var outputAsync1 = output1.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithCheckpoint.Add(o)); + var outputAsync1 = output1.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithCheckpoint.Add); var pipe1 = container1.Restore(null); - preCheckpointData.ForEachAsync(e => preCheckpointSubject.OnNext(e)).Wait(); + preCheckpointData.ForEachAsync(preCheckpointSubject.OnNext).Wait(); pipe1.Checkpoint(state); state.Seek(0, SeekOrigin.Begin); @@ -3219,9 +3219,9 @@ public void BasicUnaryCheckpointDisorderPolicyColumnar() var query2 = CreateBasicQuery(input2); var output2 = container2.RegisterOutput(query2); - var outputAsync2 = output2.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithCheckpoint.Add(o)); + var outputAsync2 = output2.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithCheckpoint.Add); var pipe2 = container2.Restore(state); - postCheckpointData.ForEachAsync(e => postCheckpointSubject.OnNext(e)).Wait(); + postCheckpointData.ForEachAsync(postCheckpointSubject.OnNext).Wait(); postCheckpointSubject.OnCompleted(); outputAsync2.Wait(); outputListWithCheckpoint.Sort(); @@ -3231,7 +3231,7 @@ public void BasicUnaryCheckpointDisorderPolicyColumnar() var query3 = CreateBasicQuery(input3); var output3 = container3.RegisterOutput(query3); - var outputAsync3 = output3.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithoutCheckpoint.Add(o)); + var outputAsync3 = output3.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithoutCheckpoint.Add); container3.Restore(null); outputAsync3.Wait(); @@ -3275,9 +3275,9 @@ public void BasicMulticastCheckpoint0Columnar() var query1 = query1_left.Union(query1right); var output1 = container1.RegisterOutput(query1); - var outputAsync1 = output1.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithCheckpoint.Add(o)); + var outputAsync1 = output1.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithCheckpoint.Add); var pipe1 = container1.Restore(null); - preCheckpointData.ForEachAsync(e => preCheckpointSubject.OnNext(e)).Wait(); + preCheckpointData.ForEachAsync(preCheckpointSubject.OnNext).Wait(); pipe1.Checkpoint(state); state.Seek(0, SeekOrigin.Begin); @@ -3290,9 +3290,9 @@ public void BasicMulticastCheckpoint0Columnar() var query2 = query2_left.Union(query2right); var output2 = container2.RegisterOutput(query2); - var outputAsync2 = output2.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithCheckpoint.Add(o)); + var outputAsync2 = output2.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithCheckpoint.Add); var pipe2 = container2.Restore(state); - postCheckpointData.ForEachAsync(e => postCheckpointSubject.OnNext(e)).Wait(); + postCheckpointData.ForEachAsync(postCheckpointSubject.OnNext).Wait(); postCheckpointSubject.OnCompleted(); outputAsync2.Wait(); outputListWithCheckpoint.Sort(); @@ -3305,7 +3305,7 @@ public void BasicMulticastCheckpoint0Columnar() var query3 = query3_left.Union(query3right); var output3 = container3.RegisterOutput(query3); - var outputAsync3 = output3.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithoutCheckpoint.Add(o)); + var outputAsync3 = output3.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithoutCheckpoint.Add); container3.Restore(null); outputAsync3.Wait(); outputListWithoutCheckpoint.Sort(); @@ -3350,7 +3350,7 @@ public void BasicUnaryCheckpointAnonTypeSelectManyColumnar() var outputAsync1 = output1.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithCheckpoint.Add(o.p)); var pipe1 = container1.Restore(null); - preCheckpointData.ForEachAsync(e => preCheckpointSubject.OnNext(e)).Wait(); + preCheckpointData.ForEachAsync(preCheckpointSubject.OnNext).Wait(); pipe1.Checkpoint(state); state.Seek(0, SeekOrigin.Begin); @@ -3362,7 +3362,7 @@ public void BasicUnaryCheckpointAnonTypeSelectManyColumnar() var outputAsync2 = output2.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithCheckpoint.Add(o.p)); var pipe2 = container2.Restore(state); - postCheckpointData.ForEachAsync(e => postCheckpointSubject.OnNext(e)).Wait(); + postCheckpointData.ForEachAsync(postCheckpointSubject.OnNext).Wait(); postCheckpointSubject.OnCompleted(); outputAsync2.Wait(); outputListWithCheckpoint.Sort(); @@ -3414,9 +3414,9 @@ public void BasicUnaryCheckpointCountColumnar() var output1 = container1.RegisterOutput(query1); - var outputAsync1 = output1.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithCheckpoint.Add(o)); + var outputAsync1 = output1.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithCheckpoint.Add); var pipe1 = container1.Restore(null); - preCheckpointData.ForEachAsync(e => preCheckpointSubject.OnNext(e)).Wait(); + preCheckpointData.ForEachAsync(preCheckpointSubject.OnNext).Wait(); pipe1.Checkpoint(state); state.Seek(0, SeekOrigin.Begin); @@ -3426,9 +3426,9 @@ public void BasicUnaryCheckpointCountColumnar() var query2 = input2.Count(); var output2 = container2.RegisterOutput(query2); - var outputAsync2 = output2.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithCheckpoint.Add(o)); + var outputAsync2 = output2.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithCheckpoint.Add); var pipe2 = container2.Restore(state); - postCheckpointData.ForEachAsync(e => postCheckpointSubject.OnNext(e)).Wait(); + postCheckpointData.ForEachAsync(postCheckpointSubject.OnNext).Wait(); postCheckpointSubject.OnCompleted(); outputAsync2.Wait(); outputListWithCheckpoint.Sort(); @@ -3438,7 +3438,7 @@ public void BasicUnaryCheckpointCountColumnar() var query3 = input3.Count(); var output3 = container3.RegisterOutput(query3); - var outputAsync3 = output3.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithoutCheckpoint.Add(o)); + var outputAsync3 = output3.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithoutCheckpoint.Add); container3.Restore(null); outputAsync3.Wait(); @@ -3480,9 +3480,9 @@ public void BasicUnaryCheckpointGroupedSumColumnar() var output1 = container1.RegisterOutput(query1); - var outputAsync1 = output1.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithCheckpoint.Add(o)); + var outputAsync1 = output1.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithCheckpoint.Add); var pipe1 = container1.Restore(null); - preCheckpointData.ForEachAsync(e => preCheckpointSubject.OnNext(e)).Wait(); + preCheckpointData.ForEachAsync(preCheckpointSubject.OnNext).Wait(); pipe1.Checkpoint(state); state.Seek(0, SeekOrigin.Begin); @@ -3492,9 +3492,9 @@ public void BasicUnaryCheckpointGroupedSumColumnar() var query2 = input2.GroupApply(e => e.Item1, str => str.Sum(e => (ulong)e.Item2), (g, c) => new StructTuple { Item1 = g.Key, Item2 = c }); var output2 = container2.RegisterOutput(query2); - var outputAsync2 = output2.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithCheckpoint.Add(o)); + var outputAsync2 = output2.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithCheckpoint.Add); var pipe2 = container2.Restore(state); - postCheckpointData.ForEachAsync(e => postCheckpointSubject.OnNext(e)).Wait(); + postCheckpointData.ForEachAsync(postCheckpointSubject.OnNext).Wait(); postCheckpointSubject.OnCompleted(); outputAsync2.Wait(); outputListWithCheckpoint.Sort((a, b) => a.Item1.CompareTo(b.Item1) == 0 ? a.Item2.CompareTo(b.Item2) : a.Item1.CompareTo(b.Item1)); @@ -3504,7 +3504,7 @@ public void BasicUnaryCheckpointGroupedSumColumnar() var query3 = input3.GroupApply(e => e.Item1, str => str.Sum(e => (ulong)e.Item2), (g, c) => new StructTuple { Item1 = g.Key, Item2 = c }); var output3 = container3.RegisterOutput(query3); - var outputAsync3 = output3.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithoutCheckpoint.Add(o)); + var outputAsync3 = output3.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithoutCheckpoint.Add); container3.Restore(null); outputAsync3.Wait(); @@ -3562,11 +3562,11 @@ public void BasicUnaryCheckpointEquiJoinColumnar() var output1 = container1.RegisterOutput(query1); - var outputAsync1 = output1.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithCheckpoint.Add(o)); + var outputAsync1 = output1.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithCheckpoint.Add); var pipe1 = container1.Restore(null); - preCheckpointData1.ForEachAsync(e => preCheckpointSubject1.OnNext(e)).Wait(); - preCheckpointData2.ForEachAsync(e => preCheckpointSubject2.OnNext(e)).Wait(); + preCheckpointData1.ForEachAsync(preCheckpointSubject1.OnNext).Wait(); + preCheckpointData2.ForEachAsync(preCheckpointSubject2.OnNext).Wait(); pipe1.Checkpoint(state); @@ -3578,11 +3578,11 @@ public void BasicUnaryCheckpointEquiJoinColumnar() var query2 = input21.Join(input22, e => e.Item1, e => e.Item1, (l, r) => new StructTuple { Item1 = l.Item1, Item2 = r.Item2 }); var output2 = container2.RegisterOutput(query2); - var outputAsync2 = output2.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithCheckpoint.Add(o)); + var outputAsync2 = output2.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithCheckpoint.Add); var pipe2 = container2.Restore(state); - postCheckpointData1.ForEachAsync(e => postCheckpointSubject1.OnNext(e)).Wait(); - postCheckpointData2.ForEachAsync(e => postCheckpointSubject2.OnNext(e)).Wait(); + postCheckpointData1.ForEachAsync(postCheckpointSubject1.OnNext).Wait(); + postCheckpointData2.ForEachAsync(postCheckpointSubject2.OnNext).Wait(); postCheckpointSubject1.OnCompleted(); postCheckpointSubject2.OnCompleted(); outputAsync2.Wait(); @@ -3594,7 +3594,7 @@ public void BasicUnaryCheckpointEquiJoinColumnar() var query3 = input31.Join(input32, e => e.Item1, e => e.Item1, (l, r) => new StructTuple { Item1 = l.Item1, Item2 = r.Item2 }); var output3 = container3.RegisterOutput(query3); - var outputAsync3 = output3.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithoutCheckpoint.Add(o)); + var outputAsync3 = output3.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithoutCheckpoint.Add); container3.Restore(null); outputAsync3.Wait(); @@ -3655,11 +3655,11 @@ public void BasicUnaryCheckpointLASJColumnar() var output1 = container1.RegisterOutput(query1); - var outputAsync1 = output1.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithCheckpoint.Add(o)); + var outputAsync1 = output1.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithCheckpoint.Add); var pipe1 = container1.Restore(null); - preCheckpointData1.ForEachAsync(e => preCheckpointSubject1.OnNext(e)).Wait(); - preCheckpointData2.ForEachAsync(e => preCheckpointSubject2.OnNext(e)).Wait(); + preCheckpointData1.ForEachAsync(preCheckpointSubject1.OnNext).Wait(); + preCheckpointData2.ForEachAsync(preCheckpointSubject2.OnNext).Wait(); pipe1.Checkpoint(state); @@ -3671,11 +3671,11 @@ public void BasicUnaryCheckpointLASJColumnar() var query2 = input21.WhereNotExists(input22, e => e.Item1, e => e.Item1); var output2 = container2.RegisterOutput(query2); - var outputAsync2 = output2.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithCheckpoint.Add(o)); + var outputAsync2 = output2.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithCheckpoint.Add); var pipe2 = container2.Restore(state); - postCheckpointData1.ForEachAsync(e => postCheckpointSubject1.OnNext(e)).Wait(); - postCheckpointData2.ForEachAsync(e => postCheckpointSubject2.OnNext(e)).Wait(); + postCheckpointData1.ForEachAsync(postCheckpointSubject1.OnNext).Wait(); + postCheckpointData2.ForEachAsync(postCheckpointSubject2.OnNext).Wait(); postCheckpointSubject1.OnCompleted(); postCheckpointSubject2.OnCompleted(); outputAsync2.Wait(); @@ -3687,7 +3687,7 @@ public void BasicUnaryCheckpointLASJColumnar() var query3 = input31.WhereNotExists(input32, e => e.Item1, e => e.Item1); var output3 = container3.RegisterOutput(query3); - var outputAsync3 = output3.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithoutCheckpoint.Add(o)); + var outputAsync3 = output3.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithoutCheckpoint.Add); container3.Restore(null); outputAsync3.Wait(); @@ -3748,11 +3748,11 @@ public void LeftUnaryCheckpointLASJColumnar() var output1 = container1.RegisterOutput(query1); - var outputAsync1 = output1.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithCheckpoint.Add(o)); + var outputAsync1 = output1.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithCheckpoint.Add); var pipe1 = container1.Restore(null); - preCheckpointData1.ForEachAsync(e => preCheckpointSubject1.OnNext(e)).Wait(); - preCheckpointData2.ForEachAsync(e => preCheckpointSubject2.OnNext(e)).Wait(); + preCheckpointData1.ForEachAsync(preCheckpointSubject1.OnNext).Wait(); + preCheckpointData2.ForEachAsync(preCheckpointSubject2.OnNext).Wait(); pipe1.Checkpoint(state); @@ -3764,11 +3764,11 @@ public void LeftUnaryCheckpointLASJColumnar() var query2 = input21.WhereNotExists(input22, e => e.Item1, e => e.Item1); var output2 = container2.RegisterOutput(query2); - var outputAsync2 = output2.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithCheckpoint.Add(o)); + var outputAsync2 = output2.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithCheckpoint.Add); var pipe2 = container2.Restore(state); - postCheckpointData1.ForEachAsync(e => postCheckpointSubject1.OnNext(e)).Wait(); - postCheckpointData2.ForEachAsync(e => postCheckpointSubject2.OnNext(e)).Wait(); + postCheckpointData1.ForEachAsync(postCheckpointSubject1.OnNext).Wait(); + postCheckpointData2.ForEachAsync(postCheckpointSubject2.OnNext).Wait(); postCheckpointSubject1.OnCompleted(); postCheckpointSubject2.OnCompleted(); outputAsync2.Wait(); @@ -3780,7 +3780,7 @@ public void LeftUnaryCheckpointLASJColumnar() var query3 = input31.WhereNotExists(input32, e => e.Item1, e => e.Item1); var output3 = container3.RegisterOutput(query3); - var outputAsync3 = output3.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithoutCheckpoint.Add(o)); + var outputAsync3 = output3.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithoutCheckpoint.Add); container3.Restore(null); outputAsync3.Wait(); @@ -3841,11 +3841,11 @@ public void RightUnaryCheckpointLASJColumnar() var output1 = container1.RegisterOutput(query1); - var outputAsync1 = output1.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithCheckpoint.Add(o)); + var outputAsync1 = output1.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithCheckpoint.Add); var pipe1 = container1.Restore(null); - preCheckpointData1.ForEachAsync(e => preCheckpointSubject1.OnNext(e)).Wait(); - preCheckpointData2.ForEachAsync(e => preCheckpointSubject2.OnNext(e)).Wait(); + preCheckpointData1.ForEachAsync(preCheckpointSubject1.OnNext).Wait(); + preCheckpointData2.ForEachAsync(preCheckpointSubject2.OnNext).Wait(); pipe1.Checkpoint(state); @@ -3857,11 +3857,11 @@ public void RightUnaryCheckpointLASJColumnar() var query2 = input21.WhereNotExists(input22, e => e.Item1, e => e.Item1); var output2 = container2.RegisterOutput(query2); - var outputAsync2 = output2.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithCheckpoint.Add(o)); + var outputAsync2 = output2.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithCheckpoint.Add); var pipe2 = container2.Restore(state); - postCheckpointData1.ForEachAsync(e => postCheckpointSubject1.OnNext(e)).Wait(); - postCheckpointData2.ForEachAsync(e => postCheckpointSubject2.OnNext(e)).Wait(); + postCheckpointData1.ForEachAsync(postCheckpointSubject1.OnNext).Wait(); + postCheckpointData2.ForEachAsync(postCheckpointSubject2.OnNext).Wait(); postCheckpointSubject1.OnCompleted(); postCheckpointSubject2.OnCompleted(); outputAsync2.Wait(); @@ -3873,7 +3873,7 @@ public void RightUnaryCheckpointLASJColumnar() var query3 = input31.WhereNotExists(input32, e => e.Item1, e => e.Item1); var output3 = container3.RegisterOutput(query3); - var outputAsync3 = output3.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithoutCheckpoint.Add(o)); + var outputAsync3 = output3.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithoutCheckpoint.Add); container3.Restore(null); outputAsync3.Wait(); @@ -3919,10 +3919,10 @@ public void SelfUnaryCheckpointLASJColumnar() var output1 = container1.RegisterOutput(query1); - var outputAsync1 = output1.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithCheckpoint.Add(o)); + var outputAsync1 = output1.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithCheckpoint.Add); var pipe1 = container1.Restore(null); - preCheckpointData.ForEachAsync(e => preCheckpointSubject.OnNext(e)).Wait(); + preCheckpointData.ForEachAsync(preCheckpointSubject.OnNext).Wait(); pipe1.Checkpoint(state); @@ -3933,10 +3933,10 @@ public void SelfUnaryCheckpointLASJColumnar() var query2 = input2.GroupApply(o => 1, s => s.Multicast(p => p.WhereNotExists(p.Where(i => false), e => e.Item1, e => e.Item1))); var output2 = container2.RegisterOutput(query2); - var outputAsync2 = output2.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithCheckpoint.Add(o)); + var outputAsync2 = output2.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithCheckpoint.Add); var pipe2 = container2.Restore(state); - postCheckpointData.ForEachAsync(e => postCheckpointSubject.OnNext(e)).Wait(); + postCheckpointData.ForEachAsync(postCheckpointSubject.OnNext).Wait(); postCheckpointSubject.OnCompleted(); outputAsync2.Wait(); outputListWithCheckpoint.Sort((a, b) => a.Item1.CompareTo(b.Item1) == 0 ? a.Item2.CompareTo(b.Item2) : a.Item1.CompareTo(b.Item1)); @@ -3946,7 +3946,7 @@ public void SelfUnaryCheckpointLASJColumnar() var query3 = input3.GroupApply(o => 1, s => s.Multicast(p => p.WhereNotExists(p.Where(i => false), e => e.Item1, e => e.Item1))); var output3 = container3.RegisterOutput(query3); - var outputAsync3 = output3.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithoutCheckpoint.Add(o)); + var outputAsync3 = output3.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithoutCheckpoint.Add); container3.Restore(null); outputAsync3.Wait(); @@ -4006,11 +4006,11 @@ public void BasicUnaryCheckpointClipColumnar() var output1 = container1.RegisterOutput(query1); - var outputAsync1 = output1.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithCheckpoint.Add(o)); + var outputAsync1 = output1.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithCheckpoint.Add); var pipe1 = container1.Restore(null); - preCheckpointData1.ForEachAsync(e => preCheckpointSubject1.OnNext(e)).Wait(); - preCheckpointData2.ForEachAsync(e => preCheckpointSubject2.OnNext(e)).Wait(); + preCheckpointData1.ForEachAsync(preCheckpointSubject1.OnNext).Wait(); + preCheckpointData2.ForEachAsync(preCheckpointSubject2.OnNext).Wait(); pipe1.Checkpoint(state); @@ -4022,11 +4022,11 @@ public void BasicUnaryCheckpointClipColumnar() var query2 = input21.ClipEventDuration(input22, e => e.Item1, e => e.Item1); var output2 = container2.RegisterOutput(query2); - var outputAsync2 = output2.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithCheckpoint.Add(o)); + var outputAsync2 = output2.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithCheckpoint.Add); var pipe2 = container2.Restore(state); - postCheckpointData1.ForEachAsync(e => postCheckpointSubject1.OnNext(e)).Wait(); - postCheckpointData2.ForEachAsync(e => postCheckpointSubject2.OnNext(e)).Wait(); + postCheckpointData1.ForEachAsync(postCheckpointSubject1.OnNext).Wait(); + postCheckpointData2.ForEachAsync(postCheckpointSubject2.OnNext).Wait(); postCheckpointSubject1.OnCompleted(); postCheckpointSubject2.OnCompleted(); outputAsync2.Wait(); @@ -4038,7 +4038,7 @@ public void BasicUnaryCheckpointClipColumnar() var query3 = input31.ClipEventDuration(input32, e => e.Item1, e => e.Item1); var output3 = container3.RegisterOutput(query3); - var outputAsync3 = output3.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithoutCheckpoint.Add(o)); + var outputAsync3 = output3.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithoutCheckpoint.Add); container3.Restore(null); outputAsync3.Wait(); @@ -4081,7 +4081,7 @@ public void BasicEmptyCheckpointErrorColumnar() var query1 = query1_left.Union(query1right); var output1 = container1.RegisterOutput(query1); - var outputAsync1 = output1.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithCheckpoint.Add(o)); + var outputAsync1 = output1.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithCheckpoint.Add); try { @@ -4127,9 +4127,9 @@ public void BasicUnaryCheckpointErrorColumnar() var query1 = CreateBasicQuery(input1); var output1 = container1.RegisterOutput(query1); - var outputAsync1 = output1.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputList.Add(o)); + var outputAsync1 = output1.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputList.Add); var pipe1 = container1.Restore(null); - preCheckpointData.ForEachAsync(e => preCheckpointSubject.OnNext(e)).Wait(); + preCheckpointData.ForEachAsync(preCheckpointSubject.OnNext).Wait(); pipe1.Checkpoint(state); state.Seek(0, SeekOrigin.Begin); @@ -4139,9 +4139,9 @@ public void BasicUnaryCheckpointErrorColumnar() var query2 = CreateBasicQuery(input2); var output2 = container2.RegisterOutput(query2); - var outputAsync2 = output2.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputList.Add(o)); + var outputAsync2 = output2.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputList.Add); var pipe2 = container2.Restore(state); - postCheckpointData.ForEachAsync(e => postCheckpointSubject.OnNext(e)).Wait(); + postCheckpointData.ForEachAsync(postCheckpointSubject.OnNext).Wait(); outputAsync2.Wait(); } catch (AggregateException e) @@ -4185,9 +4185,9 @@ public void BasicDisorderPolicyErrorColumnar() var query1 = CreateBasicQuery(input1); var output1 = container1.RegisterOutput(query1); - var outputAsync1 = output1.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputList.Add(o)); + var outputAsync1 = output1.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputList.Add); var pipe1 = container1.Restore(null); - preCheckpointData.ForEachAsync(e => preCheckpointSubject.OnNext(e)).Wait(); + preCheckpointData.ForEachAsync(preCheckpointSubject.OnNext).Wait(); pipe1.Checkpoint(state); state.Seek(0, SeekOrigin.Begin); @@ -4199,9 +4199,9 @@ public void BasicDisorderPolicyErrorColumnar() var query2 = CreateBasicQuery(input2); var output2 = container2.RegisterOutput(query2); - var outputAsync2 = output2.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputList.Add(o)); + var outputAsync2 = output2.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputList.Add); var pipe2 = container2.Restore(state); - postCheckpointData.ForEachAsync(e => postCheckpointSubject.OnNext(e)).Wait(); + postCheckpointData.ForEachAsync(postCheckpointSubject.OnNext).Wait(); postCheckpointSubject.OnCompleted(); outputAsync2.Wait(); } @@ -4242,9 +4242,9 @@ public void BasicDisorderAdjustPolicyColumnar() var query1 = CreateBasicQuery(input1); var output1 = container1.RegisterOutput(query1); - var outputAsync1 = output1.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputList.Add(o)); + var outputAsync1 = output1.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputList.Add); var pipe1 = container1.Restore(null); - preCheckpointData.ForEachAsync(e => preCheckpointSubject.OnNext(e)).Wait(); + preCheckpointData.ForEachAsync(preCheckpointSubject.OnNext).Wait(); pipe1.Checkpoint(state); state.Seek(0, SeekOrigin.Begin); @@ -4254,13 +4254,13 @@ public void BasicDisorderAdjustPolicyColumnar() var query2 = CreateBasicQuery(input2); var output2 = container2.RegisterOutput(query2); - var outputAsync2 = output2.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputList.Add(o)); + var outputAsync2 = output2.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputList.Add); var pipe2 = container2.Restore(state); - postCheckpointData.ForEachAsync(e => postCheckpointSubject.OnNext(e)).Wait(); + postCheckpointData.ForEachAsync(postCheckpointSubject.OnNext).Wait(); postCheckpointSubject.OnCompleted(); outputAsync2.Wait(); - Assert.IsTrue(outputList.Count == 10000); + Assert.HasCount(10000, outputList); preCheckpointSubject.OnCompleted(); } @@ -4484,9 +4484,9 @@ public void BasicUnaryCheckpointHoppingWindowSumColumnarSmallBatch() var output1 = container1.RegisterOutput(query1); - var outputAsync1 = output1.Where(e => e.IsData).ForEachAsync(o => outputListWithCheckpoint.Add(o)); + var outputAsync1 = output1.Where(e => e.IsData).ForEachAsync(outputListWithCheckpoint.Add); var pipe1 = container1.Restore(null); - preCheckpointData.ForEachAsync(e => preCheckpointSubject.OnNext(e)).Wait(); + preCheckpointData.ForEachAsync(preCheckpointSubject.OnNext).Wait(); pipe1.Checkpoint(state); state.Seek(0, SeekOrigin.Begin); @@ -4496,10 +4496,10 @@ public void BasicUnaryCheckpointHoppingWindowSumColumnarSmallBatch() var query2 = input2.HoppingWindowLifetime(window, period).Sum(e => (ulong)e); var output2 = container2.RegisterOutput(query2); - var outputAsync2 = output2.Where(e => e.IsData).ForEachAsync(o => outputListWithCheckpoint.Add(o)); + var outputAsync2 = output2.Where(e => e.IsData).ForEachAsync(outputListWithCheckpoint.Add); var pipe2 = container2.Restore(state); - postCheckpointData.ForEachAsync(e => postCheckpointSubject.OnNext(e)).Wait(); + postCheckpointData.ForEachAsync(postCheckpointSubject.OnNext).Wait(); postCheckpointSubject.OnCompleted(); outputAsync2.Wait(); outputListWithCheckpoint.Sort((x, y) => @@ -4517,7 +4517,7 @@ public void BasicUnaryCheckpointHoppingWindowSumColumnarSmallBatch() var query3 = input3.HoppingWindowLifetime(window, period).Sum(e => (ulong)e); var output3 = container3.RegisterOutput(query3); - var outputAsync3 = output3.Where(e => e.IsData).ForEachAsync(o => outputListWithoutCheckpoint.Add(o)); + var outputAsync3 = output3.Where(e => e.IsData).ForEachAsync(outputListWithoutCheckpoint.Add); container3.Restore(null); outputAsync3.Wait(); outputListWithoutCheckpoint.Sort((x, y) => @@ -4614,9 +4614,9 @@ public void BasicUnaryCheckpoint0ColumnarSmallBatch() var query1 = CreateBasicQuery(input1); var output1 = container1.RegisterOutput(query1); - var outputAsync1 = output1.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithCheckpoint.Add(o)); + var outputAsync1 = output1.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithCheckpoint.Add); var pipe1 = container1.Restore(null); - preCheckpointData.ForEachAsync(e => preCheckpointSubject.OnNext(e)).Wait(); + preCheckpointData.ForEachAsync(preCheckpointSubject.OnNext).Wait(); pipe1.Checkpoint(state); state.Seek(0, SeekOrigin.Begin); @@ -4626,9 +4626,9 @@ public void BasicUnaryCheckpoint0ColumnarSmallBatch() var query2 = CreateBasicQuery(input2); var output2 = container2.RegisterOutput(query2); - var outputAsync2 = output2.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithCheckpoint.Add(o)); + var outputAsync2 = output2.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithCheckpoint.Add); var pipe2 = container2.Restore(state); - postCheckpointData.ForEachAsync(e => postCheckpointSubject.OnNext(e)).Wait(); + postCheckpointData.ForEachAsync(postCheckpointSubject.OnNext).Wait(); postCheckpointSubject.OnCompleted(); outputAsync2.Wait(); outputListWithCheckpoint.Sort(); @@ -4638,7 +4638,7 @@ public void BasicUnaryCheckpoint0ColumnarSmallBatch() var query3 = CreateBasicQuery(input3); var output3 = container3.RegisterOutput(query3); - var outputAsync3 = output3.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithoutCheckpoint.Add(o)); + var outputAsync3 = output3.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithoutCheckpoint.Add); container3.Restore(null); outputAsync3.Wait(); @@ -4679,9 +4679,9 @@ public void BasicUnaryCheckpointDisorderPolicyColumnarSmallBatch() var query1 = CreateBasicQuery(input1); var output1 = container1.RegisterOutput(query1); - var outputAsync1 = output1.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithCheckpoint.Add(o)); + var outputAsync1 = output1.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithCheckpoint.Add); var pipe1 = container1.Restore(null); - preCheckpointData.ForEachAsync(e => preCheckpointSubject.OnNext(e)).Wait(); + preCheckpointData.ForEachAsync(preCheckpointSubject.OnNext).Wait(); pipe1.Checkpoint(state); state.Seek(0, SeekOrigin.Begin); @@ -4691,9 +4691,9 @@ public void BasicUnaryCheckpointDisorderPolicyColumnarSmallBatch() var query2 = CreateBasicQuery(input2); var output2 = container2.RegisterOutput(query2); - var outputAsync2 = output2.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithCheckpoint.Add(o)); + var outputAsync2 = output2.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithCheckpoint.Add); var pipe2 = container2.Restore(state); - postCheckpointData.ForEachAsync(e => postCheckpointSubject.OnNext(e)).Wait(); + postCheckpointData.ForEachAsync(postCheckpointSubject.OnNext).Wait(); postCheckpointSubject.OnCompleted(); outputAsync2.Wait(); outputListWithCheckpoint.Sort(); @@ -4703,7 +4703,7 @@ public void BasicUnaryCheckpointDisorderPolicyColumnarSmallBatch() var query3 = CreateBasicQuery(input3); var output3 = container3.RegisterOutput(query3); - var outputAsync3 = output3.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithoutCheckpoint.Add(o)); + var outputAsync3 = output3.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithoutCheckpoint.Add); container3.Restore(null); outputAsync3.Wait(); @@ -4747,9 +4747,9 @@ public void BasicMulticastCheckpoint0ColumnarSmallBatch() var query1 = query1_left.Union(query1right); var output1 = container1.RegisterOutput(query1); - var outputAsync1 = output1.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithCheckpoint.Add(o)); + var outputAsync1 = output1.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithCheckpoint.Add); var pipe1 = container1.Restore(null); - preCheckpointData.ForEachAsync(e => preCheckpointSubject.OnNext(e)).Wait(); + preCheckpointData.ForEachAsync(preCheckpointSubject.OnNext).Wait(); pipe1.Checkpoint(state); state.Seek(0, SeekOrigin.Begin); @@ -4762,9 +4762,9 @@ public void BasicMulticastCheckpoint0ColumnarSmallBatch() var query2 = query2_left.Union(query2right); var output2 = container2.RegisterOutput(query2); - var outputAsync2 = output2.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithCheckpoint.Add(o)); + var outputAsync2 = output2.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithCheckpoint.Add); var pipe2 = container2.Restore(state); - postCheckpointData.ForEachAsync(e => postCheckpointSubject.OnNext(e)).Wait(); + postCheckpointData.ForEachAsync(postCheckpointSubject.OnNext).Wait(); postCheckpointSubject.OnCompleted(); outputAsync2.Wait(); outputListWithCheckpoint.Sort(); @@ -4777,7 +4777,7 @@ public void BasicMulticastCheckpoint0ColumnarSmallBatch() var query3 = query3_left.Union(query3right); var output3 = container3.RegisterOutput(query3); - var outputAsync3 = output3.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithoutCheckpoint.Add(o)); + var outputAsync3 = output3.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithoutCheckpoint.Add); container3.Restore(null); outputAsync3.Wait(); outputListWithoutCheckpoint.Sort(); @@ -4822,7 +4822,7 @@ public void BasicUnaryCheckpointAnonTypeSelectManyColumnarSmallBatch() var outputAsync1 = output1.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithCheckpoint.Add(o.p)); var pipe1 = container1.Restore(null); - preCheckpointData.ForEachAsync(e => preCheckpointSubject.OnNext(e)).Wait(); + preCheckpointData.ForEachAsync(preCheckpointSubject.OnNext).Wait(); pipe1.Checkpoint(state); state.Seek(0, SeekOrigin.Begin); @@ -4834,7 +4834,7 @@ public void BasicUnaryCheckpointAnonTypeSelectManyColumnarSmallBatch() var outputAsync2 = output2.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithCheckpoint.Add(o.p)); var pipe2 = container2.Restore(state); - postCheckpointData.ForEachAsync(e => postCheckpointSubject.OnNext(e)).Wait(); + postCheckpointData.ForEachAsync(postCheckpointSubject.OnNext).Wait(); postCheckpointSubject.OnCompleted(); outputAsync2.Wait(); outputListWithCheckpoint.Sort(); @@ -4886,9 +4886,9 @@ public void BasicUnaryCheckpointCountColumnarSmallBatch() var output1 = container1.RegisterOutput(query1); - var outputAsync1 = output1.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithCheckpoint.Add(o)); + var outputAsync1 = output1.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithCheckpoint.Add); var pipe1 = container1.Restore(null); - preCheckpointData.ForEachAsync(e => preCheckpointSubject.OnNext(e)).Wait(); + preCheckpointData.ForEachAsync(preCheckpointSubject.OnNext).Wait(); pipe1.Checkpoint(state); state.Seek(0, SeekOrigin.Begin); @@ -4898,9 +4898,9 @@ public void BasicUnaryCheckpointCountColumnarSmallBatch() var query2 = input2.Count(); var output2 = container2.RegisterOutput(query2); - var outputAsync2 = output2.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithCheckpoint.Add(o)); + var outputAsync2 = output2.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithCheckpoint.Add); var pipe2 = container2.Restore(state); - postCheckpointData.ForEachAsync(e => postCheckpointSubject.OnNext(e)).Wait(); + postCheckpointData.ForEachAsync(postCheckpointSubject.OnNext).Wait(); postCheckpointSubject.OnCompleted(); outputAsync2.Wait(); outputListWithCheckpoint.Sort(); @@ -4910,7 +4910,7 @@ public void BasicUnaryCheckpointCountColumnarSmallBatch() var query3 = input3.Count(); var output3 = container3.RegisterOutput(query3); - var outputAsync3 = output3.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithoutCheckpoint.Add(o)); + var outputAsync3 = output3.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithoutCheckpoint.Add); container3.Restore(null); outputAsync3.Wait(); @@ -4952,9 +4952,9 @@ public void BasicUnaryCheckpointGroupedSumColumnarSmallBatch() var output1 = container1.RegisterOutput(query1); - var outputAsync1 = output1.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithCheckpoint.Add(o)); + var outputAsync1 = output1.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithCheckpoint.Add); var pipe1 = container1.Restore(null); - preCheckpointData.ForEachAsync(e => preCheckpointSubject.OnNext(e)).Wait(); + preCheckpointData.ForEachAsync(preCheckpointSubject.OnNext).Wait(); pipe1.Checkpoint(state); state.Seek(0, SeekOrigin.Begin); @@ -4964,9 +4964,9 @@ public void BasicUnaryCheckpointGroupedSumColumnarSmallBatch() var query2 = input2.GroupApply(e => e.Item1, str => str.Sum(e => (ulong)e.Item2), (g, c) => new StructTuple { Item1 = g.Key, Item2 = c }); var output2 = container2.RegisterOutput(query2); - var outputAsync2 = output2.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithCheckpoint.Add(o)); + var outputAsync2 = output2.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithCheckpoint.Add); var pipe2 = container2.Restore(state); - postCheckpointData.ForEachAsync(e => postCheckpointSubject.OnNext(e)).Wait(); + postCheckpointData.ForEachAsync(postCheckpointSubject.OnNext).Wait(); postCheckpointSubject.OnCompleted(); outputAsync2.Wait(); outputListWithCheckpoint.Sort((a, b) => a.Item1.CompareTo(b.Item1) == 0 ? a.Item2.CompareTo(b.Item2) : a.Item1.CompareTo(b.Item1)); @@ -4976,7 +4976,7 @@ public void BasicUnaryCheckpointGroupedSumColumnarSmallBatch() var query3 = input3.GroupApply(e => e.Item1, str => str.Sum(e => (ulong)e.Item2), (g, c) => new StructTuple { Item1 = g.Key, Item2 = c }); var output3 = container3.RegisterOutput(query3); - var outputAsync3 = output3.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithoutCheckpoint.Add(o)); + var outputAsync3 = output3.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithoutCheckpoint.Add); container3.Restore(null); outputAsync3.Wait(); @@ -5034,11 +5034,11 @@ public void BasicUnaryCheckpointEquiJoinColumnarSmallBatch() var output1 = container1.RegisterOutput(query1); - var outputAsync1 = output1.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithCheckpoint.Add(o)); + var outputAsync1 = output1.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithCheckpoint.Add); var pipe1 = container1.Restore(null); - preCheckpointData1.ForEachAsync(e => preCheckpointSubject1.OnNext(e)).Wait(); - preCheckpointData2.ForEachAsync(e => preCheckpointSubject2.OnNext(e)).Wait(); + preCheckpointData1.ForEachAsync(preCheckpointSubject1.OnNext).Wait(); + preCheckpointData2.ForEachAsync(preCheckpointSubject2.OnNext).Wait(); pipe1.Checkpoint(state); @@ -5050,11 +5050,11 @@ public void BasicUnaryCheckpointEquiJoinColumnarSmallBatch() var query2 = input21.Join(input22, e => e.Item1, e => e.Item1, (l, r) => new StructTuple { Item1 = l.Item1, Item2 = r.Item2 }); var output2 = container2.RegisterOutput(query2); - var outputAsync2 = output2.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithCheckpoint.Add(o)); + var outputAsync2 = output2.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithCheckpoint.Add); var pipe2 = container2.Restore(state); - postCheckpointData1.ForEachAsync(e => postCheckpointSubject1.OnNext(e)).Wait(); - postCheckpointData2.ForEachAsync(e => postCheckpointSubject2.OnNext(e)).Wait(); + postCheckpointData1.ForEachAsync(postCheckpointSubject1.OnNext).Wait(); + postCheckpointData2.ForEachAsync(postCheckpointSubject2.OnNext).Wait(); postCheckpointSubject1.OnCompleted(); postCheckpointSubject2.OnCompleted(); outputAsync2.Wait(); @@ -5066,7 +5066,7 @@ public void BasicUnaryCheckpointEquiJoinColumnarSmallBatch() var query3 = input31.Join(input32, e => e.Item1, e => e.Item1, (l, r) => new StructTuple { Item1 = l.Item1, Item2 = r.Item2 }); var output3 = container3.RegisterOutput(query3); - var outputAsync3 = output3.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithoutCheckpoint.Add(o)); + var outputAsync3 = output3.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithoutCheckpoint.Add); container3.Restore(null); outputAsync3.Wait(); @@ -5127,11 +5127,11 @@ public void BasicUnaryCheckpointLASJColumnarSmallBatch() var output1 = container1.RegisterOutput(query1); - var outputAsync1 = output1.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithCheckpoint.Add(o)); + var outputAsync1 = output1.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithCheckpoint.Add); var pipe1 = container1.Restore(null); - preCheckpointData1.ForEachAsync(e => preCheckpointSubject1.OnNext(e)).Wait(); - preCheckpointData2.ForEachAsync(e => preCheckpointSubject2.OnNext(e)).Wait(); + preCheckpointData1.ForEachAsync(preCheckpointSubject1.OnNext).Wait(); + preCheckpointData2.ForEachAsync(preCheckpointSubject2.OnNext).Wait(); pipe1.Checkpoint(state); @@ -5143,11 +5143,11 @@ public void BasicUnaryCheckpointLASJColumnarSmallBatch() var query2 = input21.WhereNotExists(input22, e => e.Item1, e => e.Item1); var output2 = container2.RegisterOutput(query2); - var outputAsync2 = output2.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithCheckpoint.Add(o)); + var outputAsync2 = output2.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithCheckpoint.Add); var pipe2 = container2.Restore(state); - postCheckpointData1.ForEachAsync(e => postCheckpointSubject1.OnNext(e)).Wait(); - postCheckpointData2.ForEachAsync(e => postCheckpointSubject2.OnNext(e)).Wait(); + postCheckpointData1.ForEachAsync(postCheckpointSubject1.OnNext).Wait(); + postCheckpointData2.ForEachAsync(postCheckpointSubject2.OnNext).Wait(); postCheckpointSubject1.OnCompleted(); postCheckpointSubject2.OnCompleted(); outputAsync2.Wait(); @@ -5159,7 +5159,7 @@ public void BasicUnaryCheckpointLASJColumnarSmallBatch() var query3 = input31.WhereNotExists(input32, e => e.Item1, e => e.Item1); var output3 = container3.RegisterOutput(query3); - var outputAsync3 = output3.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithoutCheckpoint.Add(o)); + var outputAsync3 = output3.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithoutCheckpoint.Add); container3.Restore(null); outputAsync3.Wait(); @@ -5220,11 +5220,11 @@ public void LeftUnaryCheckpointLASJColumnarSmallBatch() var output1 = container1.RegisterOutput(query1); - var outputAsync1 = output1.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithCheckpoint.Add(o)); + var outputAsync1 = output1.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithCheckpoint.Add); var pipe1 = container1.Restore(null); - preCheckpointData1.ForEachAsync(e => preCheckpointSubject1.OnNext(e)).Wait(); - preCheckpointData2.ForEachAsync(e => preCheckpointSubject2.OnNext(e)).Wait(); + preCheckpointData1.ForEachAsync(preCheckpointSubject1.OnNext).Wait(); + preCheckpointData2.ForEachAsync(preCheckpointSubject2.OnNext).Wait(); pipe1.Checkpoint(state); @@ -5236,11 +5236,11 @@ public void LeftUnaryCheckpointLASJColumnarSmallBatch() var query2 = input21.WhereNotExists(input22, e => e.Item1, e => e.Item1); var output2 = container2.RegisterOutput(query2); - var outputAsync2 = output2.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithCheckpoint.Add(o)); + var outputAsync2 = output2.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithCheckpoint.Add); var pipe2 = container2.Restore(state); - postCheckpointData1.ForEachAsync(e => postCheckpointSubject1.OnNext(e)).Wait(); - postCheckpointData2.ForEachAsync(e => postCheckpointSubject2.OnNext(e)).Wait(); + postCheckpointData1.ForEachAsync(postCheckpointSubject1.OnNext).Wait(); + postCheckpointData2.ForEachAsync(postCheckpointSubject2.OnNext).Wait(); postCheckpointSubject1.OnCompleted(); postCheckpointSubject2.OnCompleted(); outputAsync2.Wait(); @@ -5252,7 +5252,7 @@ public void LeftUnaryCheckpointLASJColumnarSmallBatch() var query3 = input31.WhereNotExists(input32, e => e.Item1, e => e.Item1); var output3 = container3.RegisterOutput(query3); - var outputAsync3 = output3.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithoutCheckpoint.Add(o)); + var outputAsync3 = output3.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithoutCheckpoint.Add); container3.Restore(null); outputAsync3.Wait(); @@ -5313,11 +5313,11 @@ public void RightUnaryCheckpointLASJColumnarSmallBatch() var output1 = container1.RegisterOutput(query1); - var outputAsync1 = output1.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithCheckpoint.Add(o)); + var outputAsync1 = output1.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithCheckpoint.Add); var pipe1 = container1.Restore(null); - preCheckpointData1.ForEachAsync(e => preCheckpointSubject1.OnNext(e)).Wait(); - preCheckpointData2.ForEachAsync(e => preCheckpointSubject2.OnNext(e)).Wait(); + preCheckpointData1.ForEachAsync(preCheckpointSubject1.OnNext).Wait(); + preCheckpointData2.ForEachAsync(preCheckpointSubject2.OnNext).Wait(); pipe1.Checkpoint(state); @@ -5329,11 +5329,11 @@ public void RightUnaryCheckpointLASJColumnarSmallBatch() var query2 = input21.WhereNotExists(input22, e => e.Item1, e => e.Item1); var output2 = container2.RegisterOutput(query2); - var outputAsync2 = output2.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithCheckpoint.Add(o)); + var outputAsync2 = output2.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithCheckpoint.Add); var pipe2 = container2.Restore(state); - postCheckpointData1.ForEachAsync(e => postCheckpointSubject1.OnNext(e)).Wait(); - postCheckpointData2.ForEachAsync(e => postCheckpointSubject2.OnNext(e)).Wait(); + postCheckpointData1.ForEachAsync(postCheckpointSubject1.OnNext).Wait(); + postCheckpointData2.ForEachAsync(postCheckpointSubject2.OnNext).Wait(); postCheckpointSubject1.OnCompleted(); postCheckpointSubject2.OnCompleted(); outputAsync2.Wait(); @@ -5345,7 +5345,7 @@ public void RightUnaryCheckpointLASJColumnarSmallBatch() var query3 = input31.WhereNotExists(input32, e => e.Item1, e => e.Item1); var output3 = container3.RegisterOutput(query3); - var outputAsync3 = output3.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithoutCheckpoint.Add(o)); + var outputAsync3 = output3.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithoutCheckpoint.Add); container3.Restore(null); outputAsync3.Wait(); @@ -5391,10 +5391,10 @@ public void SelfUnaryCheckpointLASJColumnarSmallBatch() var output1 = container1.RegisterOutput(query1); - var outputAsync1 = output1.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithCheckpoint.Add(o)); + var outputAsync1 = output1.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithCheckpoint.Add); var pipe1 = container1.Restore(null); - preCheckpointData.ForEachAsync(e => preCheckpointSubject.OnNext(e)).Wait(); + preCheckpointData.ForEachAsync(preCheckpointSubject.OnNext).Wait(); pipe1.Checkpoint(state); @@ -5405,10 +5405,10 @@ public void SelfUnaryCheckpointLASJColumnarSmallBatch() var query2 = input2.GroupApply(o => 1, s => s.Multicast(p => p.WhereNotExists(p.Where(i => false), e => e.Item1, e => e.Item1))); var output2 = container2.RegisterOutput(query2); - var outputAsync2 = output2.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithCheckpoint.Add(o)); + var outputAsync2 = output2.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithCheckpoint.Add); var pipe2 = container2.Restore(state); - postCheckpointData.ForEachAsync(e => postCheckpointSubject.OnNext(e)).Wait(); + postCheckpointData.ForEachAsync(postCheckpointSubject.OnNext).Wait(); postCheckpointSubject.OnCompleted(); outputAsync2.Wait(); outputListWithCheckpoint.Sort((a, b) => a.Item1.CompareTo(b.Item1) == 0 ? a.Item2.CompareTo(b.Item2) : a.Item1.CompareTo(b.Item1)); @@ -5418,7 +5418,7 @@ public void SelfUnaryCheckpointLASJColumnarSmallBatch() var query3 = input3.GroupApply(o => 1, s => s.Multicast(p => p.WhereNotExists(p.Where(i => false), e => e.Item1, e => e.Item1))); var output3 = container3.RegisterOutput(query3); - var outputAsync3 = output3.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithoutCheckpoint.Add(o)); + var outputAsync3 = output3.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithoutCheckpoint.Add); container3.Restore(null); outputAsync3.Wait(); @@ -5478,11 +5478,11 @@ public void BasicUnaryCheckpointClipColumnarSmallBatch() var output1 = container1.RegisterOutput(query1); - var outputAsync1 = output1.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithCheckpoint.Add(o)); + var outputAsync1 = output1.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithCheckpoint.Add); var pipe1 = container1.Restore(null); - preCheckpointData1.ForEachAsync(e => preCheckpointSubject1.OnNext(e)).Wait(); - preCheckpointData2.ForEachAsync(e => preCheckpointSubject2.OnNext(e)).Wait(); + preCheckpointData1.ForEachAsync(preCheckpointSubject1.OnNext).Wait(); + preCheckpointData2.ForEachAsync(preCheckpointSubject2.OnNext).Wait(); pipe1.Checkpoint(state); @@ -5494,11 +5494,11 @@ public void BasicUnaryCheckpointClipColumnarSmallBatch() var query2 = input21.ClipEventDuration(input22, e => e.Item1, e => e.Item1); var output2 = container2.RegisterOutput(query2); - var outputAsync2 = output2.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithCheckpoint.Add(o)); + var outputAsync2 = output2.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithCheckpoint.Add); var pipe2 = container2.Restore(state); - postCheckpointData1.ForEachAsync(e => postCheckpointSubject1.OnNext(e)).Wait(); - postCheckpointData2.ForEachAsync(e => postCheckpointSubject2.OnNext(e)).Wait(); + postCheckpointData1.ForEachAsync(postCheckpointSubject1.OnNext).Wait(); + postCheckpointData2.ForEachAsync(postCheckpointSubject2.OnNext).Wait(); postCheckpointSubject1.OnCompleted(); postCheckpointSubject2.OnCompleted(); outputAsync2.Wait(); @@ -5510,7 +5510,7 @@ public void BasicUnaryCheckpointClipColumnarSmallBatch() var query3 = input31.ClipEventDuration(input32, e => e.Item1, e => e.Item1); var output3 = container3.RegisterOutput(query3); - var outputAsync3 = output3.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithoutCheckpoint.Add(o)); + var outputAsync3 = output3.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithoutCheckpoint.Add); container3.Restore(null); outputAsync3.Wait(); @@ -5553,7 +5553,7 @@ public void BasicEmptyCheckpointErrorColumnarSmallBatch() var query1 = query1_left.Union(query1right); var output1 = container1.RegisterOutput(query1); - var outputAsync1 = output1.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputListWithCheckpoint.Add(o)); + var outputAsync1 = output1.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputListWithCheckpoint.Add); try { @@ -5599,9 +5599,9 @@ public void BasicUnaryCheckpointErrorColumnarSmallBatch() var query1 = CreateBasicQuery(input1); var output1 = container1.RegisterOutput(query1); - var outputAsync1 = output1.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputList.Add(o)); + var outputAsync1 = output1.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputList.Add); var pipe1 = container1.Restore(null); - preCheckpointData.ForEachAsync(e => preCheckpointSubject.OnNext(e)).Wait(); + preCheckpointData.ForEachAsync(preCheckpointSubject.OnNext).Wait(); pipe1.Checkpoint(state); state.Seek(0, SeekOrigin.Begin); @@ -5611,9 +5611,9 @@ public void BasicUnaryCheckpointErrorColumnarSmallBatch() var query2 = CreateBasicQuery(input2); var output2 = container2.RegisterOutput(query2); - var outputAsync2 = output2.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputList.Add(o)); + var outputAsync2 = output2.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputList.Add); var pipe2 = container2.Restore(state); - postCheckpointData.ForEachAsync(e => postCheckpointSubject.OnNext(e)).Wait(); + postCheckpointData.ForEachAsync(postCheckpointSubject.OnNext).Wait(); outputAsync2.Wait(); } catch (AggregateException e) @@ -5657,9 +5657,9 @@ public void BasicDisorderPolicyErrorColumnarSmallBatch() var query1 = CreateBasicQuery(input1); var output1 = container1.RegisterOutput(query1); - var outputAsync1 = output1.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputList.Add(o)); + var outputAsync1 = output1.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputList.Add); var pipe1 = container1.Restore(null); - preCheckpointData.ForEachAsync(e => preCheckpointSubject.OnNext(e)).Wait(); + preCheckpointData.ForEachAsync(preCheckpointSubject.OnNext).Wait(); pipe1.Checkpoint(state); state.Seek(0, SeekOrigin.Begin); @@ -5671,9 +5671,9 @@ public void BasicDisorderPolicyErrorColumnarSmallBatch() var query2 = CreateBasicQuery(input2); var output2 = container2.RegisterOutput(query2); - var outputAsync2 = output2.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputList.Add(o)); + var outputAsync2 = output2.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputList.Add); var pipe2 = container2.Restore(state); - postCheckpointData.ForEachAsync(e => postCheckpointSubject.OnNext(e)).Wait(); + postCheckpointData.ForEachAsync(postCheckpointSubject.OnNext).Wait(); postCheckpointSubject.OnCompleted(); outputAsync2.Wait(); } @@ -5714,9 +5714,9 @@ public void BasicDisorderAdjustPolicyColumnarSmallBatch() var query1 = CreateBasicQuery(input1); var output1 = container1.RegisterOutput(query1); - var outputAsync1 = output1.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputList.Add(o)); + var outputAsync1 = output1.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputList.Add); var pipe1 = container1.Restore(null); - preCheckpointData.ForEachAsync(e => preCheckpointSubject.OnNext(e)).Wait(); + preCheckpointData.ForEachAsync(preCheckpointSubject.OnNext).Wait(); pipe1.Checkpoint(state); state.Seek(0, SeekOrigin.Begin); @@ -5726,13 +5726,13 @@ public void BasicDisorderAdjustPolicyColumnarSmallBatch() var query2 = CreateBasicQuery(input2); var output2 = container2.RegisterOutput(query2); - var outputAsync2 = output2.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(o => outputList.Add(o)); + var outputAsync2 = output2.Where(e => e.IsData).Select(e => e.Payload).ForEachAsync(outputList.Add); var pipe2 = container2.Restore(state); - postCheckpointData.ForEachAsync(e => postCheckpointSubject.OnNext(e)).Wait(); + postCheckpointData.ForEachAsync(postCheckpointSubject.OnNext).Wait(); postCheckpointSubject.OnCompleted(); outputAsync2.Wait(); - Assert.IsTrue(outputList.Count == 10000); + Assert.HasCount(10000, outputList); preCheckpointSubject.OnCompleted(); } diff --git a/Sources/Test/SimpleTesting/Collections/AbstractEventBatch.cs b/Sources/Test/SimpleTesting/Collections/AbstractEventBatch.cs index 28e73fb35..c07b95977 100644 --- a/Sources/Test/SimpleTesting/Collections/AbstractEventBatch.cs +++ b/Sources/Test/SimpleTesting/Collections/AbstractEventBatch.cs @@ -43,21 +43,21 @@ public void ComputeMinMax_Basic() // (a) message.Count = 0; - Assert.IsTrue(message.MinTimestamp == StreamEvent.MinSyncTime, "Empty message with Count=0 has MinTimestamp <> 0."); - Assert.IsTrue(message.MaxTimestamp == StreamEvent.MaxSyncTime, "Empty message with Count=0 has MaxTimestamp <> inf-1."); + Assert.AreEqual(StreamEvent.MinSyncTime, message.MinTimestamp, "Empty message with Count=0 has MinTimestamp <> 0."); + Assert.AreEqual(StreamEvent.MaxSyncTime, message.MaxTimestamp, "Empty message with Count=0 has MaxTimestamp <> inf-1."); // (b) message.Count = 1; message.vsync.col[0] = TESTVALUE; - Assert.IsTrue(message.MinTimestamp == StreamEvent.MinSyncTime, "Empty message with Count=1 has MinTimestamp <> 0."); - Assert.IsTrue(message.MaxTimestamp == StreamEvent.MaxSyncTime, "Empty message with Count=1 has MaxTimestamp <> inf-1."); + Assert.AreEqual(StreamEvent.MinSyncTime, message.MinTimestamp, "Empty message with Count=1 has MinTimestamp <> 0."); + Assert.AreEqual(StreamEvent.MaxSyncTime, message.MaxTimestamp, "Empty message with Count=1 has MaxTimestamp <> inf-1."); // (c) message.Count = 1; message.vsync.col[0] = TESTVALUE; OccupyAt(message, 0); - Assert.IsTrue(message.MinTimestamp == TESTVALUE, "Empty message with Count=1 has MinTimestamp <> TESTVALUE."); - Assert.IsTrue(message.MaxTimestamp == TESTVALUE, "Empty message with Count=1 has MaxTimestamp <> TESTVALUE"); + Assert.AreEqual(TESTVALUE, message.MinTimestamp, "Empty message with Count=1 has MinTimestamp <> TESTVALUE."); + Assert.AreEqual(TESTVALUE, message.MaxTimestamp, "Empty message with Count=1 has MaxTimestamp <> TESTVALUE"); VacateAt(message, 0); message.vsync.col[0] = 0; @@ -65,14 +65,14 @@ public void ComputeMinMax_Basic() message.Count = 100; message.vsync.col[5] = TESTVALUE - 1; message.vsync.col[42] = TESTVALUE; - Assert.IsTrue(message.MinTimestamp == StreamEvent.MinSyncTime, "Empty message with Count>1 has MinTimestamp <> 0."); - Assert.IsTrue(message.MaxTimestamp == StreamEvent.MaxSyncTime, "Empty message with Count>1 has MaxTimestamp <> inf-1"); + Assert.AreEqual(StreamEvent.MinSyncTime, message.MinTimestamp, "Empty message with Count>1 has MinTimestamp <> 0."); + Assert.AreEqual(StreamEvent.MaxSyncTime, message.MaxTimestamp, "Empty message with Count>1 has MaxTimestamp <> inf-1"); // (e) OccupyAt(message, 5); OccupyAt(message, 42); - Assert.IsTrue(message.MinTimestamp == TESTVALUE - 1, "Non-empty message with Count>1 has MinTimestamp <> TESTVALUE-1."); - Assert.IsTrue(message.MaxTimestamp == TESTVALUE, "Non-empty message with Count>1 has MaxTimestamp <> TESTVALUE"); + Assert.AreEqual(TESTVALUE - 1, message.MinTimestamp, "Non-empty message with Count>1 has MinTimestamp <> TESTVALUE-1."); + Assert.AreEqual(TESTVALUE, message.MaxTimestamp, "Non-empty message with Count>1 has MaxTimestamp <> TESTVALUE"); VacateAt(message, 5); VacateAt(message, 42); message.vsync.col[5] = 0; @@ -161,21 +161,21 @@ public void ComputeMinMax_Partitioned_Basic() // (a) message.Count = 0; - Assert.IsTrue(message.MinTimestamp == StreamEvent.MinSyncTime, "Empty message with Count=0 has MinTimestamp <> 0."); - Assert.IsTrue(message.MaxTimestamp == StreamEvent.MaxSyncTime, "Empty message with Count=0 has MaxTimestamp <> inf-1."); + Assert.AreEqual(StreamEvent.MinSyncTime, message.MinTimestamp, "Empty message with Count=0 has MinTimestamp <> 0."); + Assert.AreEqual(StreamEvent.MaxSyncTime, message.MaxTimestamp, "Empty message with Count=0 has MaxTimestamp <> inf-1."); // (b) message.Count = 1; message.vsync.col[0] = TESTVALUE; - Assert.IsTrue(message.MinTimestamp == StreamEvent.MinSyncTime, "Empty message with Count=1 has MinTimestamp <> 0."); - Assert.IsTrue(message.MaxTimestamp == StreamEvent.MaxSyncTime, "Empty message with Count=1 has MaxTimestamp <> inf-1."); + Assert.AreEqual(StreamEvent.MinSyncTime, message.MinTimestamp, "Empty message with Count=1 has MinTimestamp <> 0."); + Assert.AreEqual(StreamEvent.MaxSyncTime, message.MaxTimestamp, "Empty message with Count=1 has MaxTimestamp <> inf-1."); // (c) message.Count = 1; message.vsync.col[0] = TESTVALUE; OccupyAt(message, 0); - Assert.IsTrue(message.MinTimestamp == TESTVALUE, "Empty message with Count=1 has MinTimestamp <> TESTVALUE."); - Assert.IsTrue(message.MaxTimestamp == TESTVALUE, "Empty message with Count=1 has MaxTimestamp <> TESTVALUE"); + Assert.AreEqual(TESTVALUE, message.MinTimestamp, "Empty message with Count=1 has MinTimestamp <> TESTVALUE."); + Assert.AreEqual(TESTVALUE, message.MaxTimestamp, "Empty message with Count=1 has MaxTimestamp <> TESTVALUE"); VacateAt(message, 0); message.vsync.col[0] = 0; @@ -183,14 +183,14 @@ public void ComputeMinMax_Partitioned_Basic() message.Count = 100; message.vsync.col[5] = TESTVALUE - 1; message.vsync.col[42] = TESTVALUE; - Assert.IsTrue(message.MinTimestamp == StreamEvent.MinSyncTime, "Empty message with Count>1 has MinTimestamp <> 0."); - Assert.IsTrue(message.MaxTimestamp == StreamEvent.MaxSyncTime, "Empty message with Count>1 has MaxTimestamp <> inf-1"); + Assert.AreEqual(StreamEvent.MinSyncTime, message.MinTimestamp, "Empty message with Count>1 has MinTimestamp <> 0."); + Assert.AreEqual(StreamEvent.MaxSyncTime, message.MaxTimestamp, "Empty message with Count>1 has MaxTimestamp <> inf-1"); // (e) OccupyAt(message, 5); OccupyAt(message, 42); - Assert.IsTrue(message.MinTimestamp == TESTVALUE - 1, "Non-empty message with Count>1 has MinTimestamp <> TESTVALUE-1."); - Assert.IsTrue(message.MaxTimestamp == TESTVALUE, "Non-empty message with Count>1 has MaxTimestamp <> TESTVALUE"); + Assert.AreEqual(TESTVALUE - 1, message.MinTimestamp, "Non-empty message with Count>1 has MinTimestamp <> TESTVALUE-1."); + Assert.AreEqual(TESTVALUE, message.MaxTimestamp, "Non-empty message with Count>1 has MaxTimestamp <> TESTVALUE"); VacateAt(message, 5); VacateAt(message, 42); message.vsync.col[5] = 0; @@ -218,14 +218,14 @@ public void ComputeMinMax_Partitioned_Compound_Basic() message.Count = 100; message.vsync.col[5] = TESTVALUE; message.vsync.col[42] = TESTVALUE - 1; - Assert.IsTrue(message.MinTimestamp == StreamEvent.MinSyncTime, "Empty message with Count>1 has MinTimestamp <> 0."); - Assert.IsTrue(message.MaxTimestamp == StreamEvent.MaxSyncTime, "Empty message with Count>1 has MaxTimestamp <> inf-1"); + Assert.AreEqual(StreamEvent.MinSyncTime, message.MinTimestamp, "Empty message with Count>1 has MinTimestamp <> 0."); + Assert.AreEqual(StreamEvent.MaxSyncTime, message.MaxTimestamp, "Empty message with Count>1 has MaxTimestamp <> inf-1"); // (e) OccupyAt(message, 5); OccupyAt(message, 42); - Assert.IsTrue(message.MinTimestamp == TESTVALUE - 1, "Non-empty message with Count>1 has MinTimestamp <> TESTVALUE-1."); - Assert.IsTrue(message.MaxTimestamp == TESTVALUE, "Non-empty message with Count>1 has MaxTimestamp <> TESTVALUE"); + Assert.AreEqual(TESTVALUE - 1, message.MinTimestamp, "Non-empty message with Count>1 has MinTimestamp <> TESTVALUE-1."); + Assert.AreEqual(TESTVALUE, message.MaxTimestamp, "Non-empty message with Count>1 has MaxTimestamp <> TESTVALUE"); VacateAt(message, 5); VacateAt(message, 42); message.vsync.col[5] = 0; diff --git a/Sources/Test/SimpleTesting/Collections/FastListTest.cs b/Sources/Test/SimpleTesting/Collections/FastListTest.cs index 946f4c7c9..11c1957e0 100644 --- a/Sources/Test/SimpleTesting/Collections/FastListTest.cs +++ b/Sources/Test/SimpleTesting/Collections/FastListTest.cs @@ -39,9 +39,9 @@ private static void SimpleListTest() int indexA2 = list.Insert("a"); int indexB2 = list.Insert("b"); - Assert.IsTrue(indexA != indexA2); - Assert.IsTrue(indexA != indexB); - Assert.IsTrue(indexA2 != indexB2); + Assert.AreNotEqual(indexA2, indexA); + Assert.AreNotEqual(indexB, indexA); + Assert.AreNotEqual(indexB2, indexA2); Assert.IsFalse(list.IsEmpty); Assert.AreEqual(4, list.Count); @@ -131,7 +131,7 @@ private static void BetterListTest() { check += list.Values[index]; } - Assert.IsTrue(sum == check); + Assert.AreEqual(check, sum); } } } diff --git a/Sources/Test/SimpleTesting/Collections/FastMapTest.cs b/Sources/Test/SimpleTesting/Collections/FastMapTest.cs index 13cfb25c2..51750f2bf 100644 --- a/Sources/Test/SimpleTesting/Collections/FastMapTest.cs +++ b/Sources/Test/SimpleTesting/Collections/FastMapTest.cs @@ -40,9 +40,9 @@ private static void SimpleMapTest() int indexA5Two = map.Insert(5, "a"); int indexB5 = map.Insert(5, "b"); - Assert.IsTrue(indexA5 != indexA5Two); - Assert.IsTrue(indexA5 != indexB5); - Assert.IsTrue(indexA5Two != indexB5); + Assert.AreNotEqual(indexA5Two, indexA5); + Assert.AreNotEqual(indexB5, indexA5); + Assert.AreNotEqual(indexB5, indexA5Two); Assert.IsFalse(map.IsEmpty); Assert.AreEqual(4, map.Count); diff --git a/Sources/Test/SimpleTesting/ColumnarTests.cs b/Sources/Test/SimpleTesting/ColumnarTests.cs index ea06778aa..9e43a7627 100644 --- a/Sources/Test/SimpleTesting/ColumnarTests.cs +++ b/Sources/Test/SimpleTesting/ColumnarTests.cs @@ -4,7 +4,6 @@ // ********************************************************************* using System; using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; using System.Linq; using System.Linq.Expressions; using System.Reactive.Linq; @@ -29,8 +28,6 @@ public ColumnarTestBase() : base(new ConfigModifier() /// See SelectTransformer.Transform and SelectTransformer.ProjectionReturningResultInstance. /// This class covers all consumers of SelectTransformer.Transform /// - [SuppressMessage("StyleCop.CSharp.SpacingRules", "SA1008", Justification = "Reviewed.")] - [SuppressMessage("StyleCop.CSharp.SpacingRules", "SA1009", Justification = "Reviewed.")] [TestClass] public class GeneralProjectionFallbackTests : ColumnarTestBase { @@ -61,7 +58,7 @@ public class GeneralProjectionFallbackTests : ColumnarTestBase [TestMethod, TestCategory("Gated")] public void FixedIntervalEquiJoinTemplate() => EquiJoinWorker(constantDuration: 10); - private void EquiJoinWorker(long? constantDuration = null) + private static void EquiJoinWorker(long? constantDuration = null) { var left = new[] { @@ -86,7 +83,7 @@ private void EquiJoinWorker(long? constantDuration = null) var output = new List>(); left.Join(right, (l, r) => CreateValueTuple(l, r)) .ToStreamEventObservable() - .ForEachAsync(e => output.Add(e)) + .ForEachAsync(output.Add) .Wait(); var correct = new[] @@ -100,9 +97,7 @@ private void EquiJoinWorker(long? constantDuration = null) if (constantDuration.HasValue && constantDuration.Value != StreamEvent.InfinitySyncTime) { - correct = correct - .Select(e => e.IsPunctuation ? e : StreamEvent.CreateInterval(e.StartTime, e.StartTime + constantDuration.Value, e.Payload)) - .ToArray(); + correct = [.. correct.Select(e => e.IsPunctuation ? e : StreamEvent.CreateInterval(e.StartTime, e.StartTime + constantDuration.Value, e.Payload))]; } Assert.IsTrue(correct.SequenceEqual(output)); @@ -132,7 +127,7 @@ private void GroupWorker(bool group) input .GroupAggregate(s => true, w => w.Count(), (g, c) => CreateValueTuple(g.Key, c)) .ToStreamEventObservable() - .ForEachAsync(e => output.Add(e)) + .ForEachAsync(output.Add) .Wait(); var correct = new[] @@ -144,7 +139,7 @@ private void GroupWorker(bool group) Assert.IsTrue(correct.SequenceEqual(output)); } - private void SelectWorker(bool selectMany, bool fuse) + private static void SelectWorker(bool selectMany, bool fuse) { var input = new[] { @@ -175,7 +170,7 @@ private void SelectWorker(bool selectMany, bool fuse) selectStreamable .ToStreamEventObservable() - .ForEachAsync(e => output.Add(e)) + .ForEachAsync(output.Add) .Wait(); var correct = new[] diff --git a/Sources/Test/SimpleTesting/Common.cs b/Sources/Test/SimpleTesting/Common.cs index 29a080ad0..9ef0d7ca7 100644 --- a/Sources/Test/SimpleTesting/Common.cs +++ b/Sources/Test/SimpleTesting/Common.cs @@ -183,11 +183,6 @@ public static IEnumerable> ToEvents(this IEnumerable input, yield return StreamEvent.CreateInterval(vsSelector(e), veSelector(e), e); } } - -#if NET472 - // string.Split has different signatures across .NET Framework/Core, so use an extension so we can use a single signature - public static string[] Split(this string original, char separator, StringSplitOptions options) => original.Split(separator); -#endif } public static class Helpers diff --git a/Sources/Test/SimpleTesting/IngressEgress/DisorderedIngressAndEgressTests.cs b/Sources/Test/SimpleTesting/IngressEgress/DisorderedIngressAndEgressTests.cs index a750c1dea..ea5153be0 100644 --- a/Sources/Test/SimpleTesting/IngressEgress/DisorderedIngressAndEgressTests.cs +++ b/Sources/Test/SimpleTesting/IngressEgress/DisorderedIngressAndEgressTests.cs @@ -145,7 +145,7 @@ public void DisorderedStartEdgeTestRowDrop105Diagnostic() var diagnosticStream = ingress.GetDroppedAdjustedEventsDiagnostic(); var outOfOrderEvents = new List>(); - diagnosticStream.Subscribe(o => outOfOrderEvents.Add(o)); + diagnosticStream.Subscribe(outOfOrderEvents.Add); var outevents = prog.ToEnumerable().ToList(); Assert.IsTrue(outevents.IsOrdered(t => t.SyncTime)); @@ -206,7 +206,7 @@ public void DisorderedIntervalTestRowDrop105Diagnostic() var diagnosticStream = ingress.GetDroppedAdjustedEventsDiagnostic(); var outOfOrderEvents = new List>(); - diagnosticStream.Subscribe(o => outOfOrderEvents.Add(o)); + diagnosticStream.Subscribe(outOfOrderEvents.Add); var outevents = prog.ToEnumerable().ToList(); Assert.IsTrue(outevents.IsOrdered(t => t.SyncTime)); @@ -361,7 +361,7 @@ public void DisorderedStartEdgeTestRowDrop1020Diagnostic() var diagnosticStream = ingress.GetDroppedAdjustedEventsDiagnostic(); var outOfOrderEvents = new List>(); - diagnosticStream.Subscribe(o => outOfOrderEvents.Add(o)); + diagnosticStream.Subscribe(outOfOrderEvents.Add); var outevents = prog.ToEnumerable().ToList(); Assert.IsTrue(outevents.IsOrdered(t => t.SyncTime)); @@ -416,7 +416,7 @@ public void DisorderedIntervalTestRowDrop1020Diagnostic() var diagnosticStream = ingress.GetDroppedAdjustedEventsDiagnostic(); var outOfOrderEvents = new List>(); - diagnosticStream.Subscribe(o => outOfOrderEvents.Add(o)); + diagnosticStream.Subscribe(outOfOrderEvents.Add); var outevents = prog.ToEnumerable().ToList(); Assert.IsTrue(outevents.IsOrdered(t => t.SyncTime)); @@ -643,7 +643,7 @@ public void DisorderedStartEdgeTestRowDrop105TimeDiagnostic() var diagnosticStream = ingress.GetDroppedAdjustedEventsDiagnostic(); var outOfOrderEvents = new List>(); - diagnosticStream.Subscribe(o => outOfOrderEvents.Add(o)); + diagnosticStream.Subscribe(outOfOrderEvents.Add); var outevents = prog.ToEnumerable().ToList(); Assert.IsTrue(outevents.IsOrdered(t => t.SyncTime)); @@ -737,7 +737,7 @@ public void DisorderedIntervalTestRowDrop105TimeDiagnostic() var diagnosticStream = ingress.GetDroppedAdjustedEventsDiagnostic(); var outOfOrderEvents = new List>(); - diagnosticStream.Subscribe(o => outOfOrderEvents.Add(o)); + diagnosticStream.Subscribe(outOfOrderEvents.Add); var outevents = prog.ToEnumerable().ToList(); Assert.IsTrue(outevents.IsOrdered(t => t.SyncTime)); @@ -991,7 +991,7 @@ public void DisorderedStartEdgeTestRowDrop1020TimeDiagnostic() var diagnosticStream = ingress.GetDroppedAdjustedEventsDiagnostic(); var outOfOrderEvents = new List>(); - diagnosticStream.Subscribe(o => outOfOrderEvents.Add(o)); + diagnosticStream.Subscribe(outOfOrderEvents.Add); var outevents = prog.ToEnumerable().ToList(); Assert.IsTrue(outevents.IsOrdered(t => t.SyncTime)); @@ -1079,7 +1079,7 @@ public void DisorderedIntervalTestRowDrop1020TimeDiagnostic() var diagnosticStream = ingress.GetDroppedAdjustedEventsDiagnostic(); var outOfOrderEvents = new List>(); - diagnosticStream.Subscribe(o => outOfOrderEvents.Add(o)); + diagnosticStream.Subscribe(outOfOrderEvents.Add); var outevents = prog.ToEnumerable().ToList(); Assert.IsTrue(outevents.IsOrdered(t => t.SyncTime)); @@ -1186,7 +1186,7 @@ public void DisorderedStartEdgeTestRowThrow105() } catch(Exception) { - Assert.IsTrue(true); // Todo. Verify if the ingress/egress before the exception was correct. + // Todo. Verify if the ingress/egress before the exception was correct. } } @@ -1229,7 +1229,7 @@ public void DisorderedIntervalTestRowThrow105() } catch(Exception) { - Assert.IsTrue(true); // Todo. Verify if the ingress/egress before the exception was correct. + // Todo. Verify if the ingress/egress before the exception was correct. } } } @@ -1273,7 +1273,7 @@ public void DisorderedStartEdgeTestRowThrow105Diagnostic() var diagnosticStream = ingress.GetDroppedAdjustedEventsDiagnostic(); var outOfOrderEvents = new List>(); - diagnosticStream.Subscribe(o => outOfOrderEvents.Add(o)); + diagnosticStream.Subscribe(outOfOrderEvents.Add); var outevents = prog.ToEnumerable().ToList(); Assert.IsTrue(outevents.IsOrdered(t => t.SyncTime)); @@ -1285,7 +1285,7 @@ public void DisorderedStartEdgeTestRowThrow105Diagnostic() } catch(Exception) { - Assert.IsTrue(true); // Todo. Verify if the ingress/egress before the exception was correct. + // Todo. Verify if the ingress/egress before the exception was correct. } } @@ -1320,7 +1320,7 @@ public void DisorderedIntervalTestRowThrow105Diagnostic() var diagnosticStream = ingress.GetDroppedAdjustedEventsDiagnostic(); var outOfOrderEvents = new List>(); - diagnosticStream.Subscribe(o => outOfOrderEvents.Add(o)); + diagnosticStream.Subscribe(outOfOrderEvents.Add); var outevents = prog.ToEnumerable().ToList(); Assert.IsTrue(outevents.IsOrdered(t => t.SyncTime)); @@ -1332,7 +1332,7 @@ public void DisorderedIntervalTestRowThrow105Diagnostic() } catch(Exception) { - Assert.IsTrue(true); // Todo. Verify if the ingress/egress before the exception was correct. + // Todo. Verify if the ingress/egress before the exception was correct. } } } @@ -1475,7 +1475,7 @@ public void DisorderedStartEdgeTestRowThrow1020Diagnostic() var diagnosticStream = ingress.GetDroppedAdjustedEventsDiagnostic(); var outOfOrderEvents = new List>(); - diagnosticStream.Subscribe(o => outOfOrderEvents.Add(o)); + diagnosticStream.Subscribe(outOfOrderEvents.Add); var outevents = prog.ToEnumerable().ToList(); Assert.IsTrue(outevents.IsOrdered(t => t.SyncTime)); @@ -1537,7 +1537,7 @@ public void DisorderedIntervalTestRowThrow1020Diagnostic() var diagnosticStream = ingress.GetDroppedAdjustedEventsDiagnostic(); var outOfOrderEvents = new List>(); - diagnosticStream.Subscribe(o => outOfOrderEvents.Add(o)); + diagnosticStream.Subscribe(outOfOrderEvents.Add); var outevents = prog.ToEnumerable().ToList(); Assert.IsTrue(outevents.IsOrdered(t => t.SyncTime)); @@ -1616,7 +1616,7 @@ public void DisorderedStartEdgeTestRowThrow105Time() } catch(Exception) { - Assert.IsTrue(true); // Todo. Verify if the ingress/egress before the exception was correct. + // Todo. Verify if the ingress/egress before the exception was correct. } } @@ -1659,7 +1659,7 @@ public void DisorderedIntervalTestRowThrow105Time() } catch(Exception) { - Assert.IsTrue(true); // Todo. Verify if the ingress/egress before the exception was correct. + // Todo. Verify if the ingress/egress before the exception was correct. } } } @@ -1703,7 +1703,7 @@ public void DisorderedStartEdgeTestRowThrow105TimeDiagnostic() var diagnosticStream = ingress.GetDroppedAdjustedEventsDiagnostic(); var outOfOrderEvents = new List>(); - diagnosticStream.Subscribe(o => outOfOrderEvents.Add(o)); + diagnosticStream.Subscribe(outOfOrderEvents.Add); var outevents = prog.ToEnumerable().ToList(); Assert.IsTrue(outevents.IsOrdered(t => t.SyncTime)); @@ -1715,7 +1715,7 @@ public void DisorderedStartEdgeTestRowThrow105TimeDiagnostic() } catch(Exception) { - Assert.IsTrue(true); // Todo. Verify if the ingress/egress before the exception was correct. + // Todo. Verify if the ingress/egress before the exception was correct. } } @@ -1750,7 +1750,7 @@ public void DisorderedIntervalTestRowThrow105TimeDiagnostic() var diagnosticStream = ingress.GetDroppedAdjustedEventsDiagnostic(); var outOfOrderEvents = new List>(); - diagnosticStream.Subscribe(o => outOfOrderEvents.Add(o)); + diagnosticStream.Subscribe(outOfOrderEvents.Add); var outevents = prog.ToEnumerable().ToList(); Assert.IsTrue(outevents.IsOrdered(t => t.SyncTime)); @@ -1762,7 +1762,7 @@ public void DisorderedIntervalTestRowThrow105TimeDiagnostic() } catch(Exception) { - Assert.IsTrue(true); // Todo. Verify if the ingress/egress before the exception was correct. + // Todo. Verify if the ingress/egress before the exception was correct. } } } @@ -1971,7 +1971,7 @@ public void DisorderedStartEdgeTestRowThrow1020TimeDiagnostic() var diagnosticStream = ingress.GetDroppedAdjustedEventsDiagnostic(); var outOfOrderEvents = new List>(); - diagnosticStream.Subscribe(o => outOfOrderEvents.Add(o)); + diagnosticStream.Subscribe(outOfOrderEvents.Add); var outevents = prog.ToEnumerable().ToList(); Assert.IsTrue(outevents.IsOrdered(t => t.SyncTime)); @@ -2066,7 +2066,7 @@ public void DisorderedIntervalTestRowThrow1020TimeDiagnostic() var diagnosticStream = ingress.GetDroppedAdjustedEventsDiagnostic(); var outOfOrderEvents = new List>(); - diagnosticStream.Subscribe(o => outOfOrderEvents.Add(o)); + diagnosticStream.Subscribe(outOfOrderEvents.Add); var outevents = prog.ToEnumerable().ToList(); Assert.IsTrue(outevents.IsOrdered(t => t.SyncTime)); @@ -2270,7 +2270,7 @@ public void DisorderedStartEdgeTestRowAdjust105Diagnostic() var diagnosticStream = ingress.GetDroppedAdjustedEventsDiagnostic(); var outOfOrderEvents = new List>(); - diagnosticStream.Subscribe(o => outOfOrderEvents.Add(o)); + diagnosticStream.Subscribe(outOfOrderEvents.Add); var outevents = prog.ToEnumerable().ToList(); Assert.IsTrue(outevents.IsOrdered(t => t.SyncTime)); @@ -2332,7 +2332,7 @@ public void DisorderedIntervalTestRowAdjust105Diagnostic() var diagnosticStream = ingress.GetDroppedAdjustedEventsDiagnostic(); var outOfOrderEvents = new List>(); - diagnosticStream.Subscribe(o => outOfOrderEvents.Add(o)); + diagnosticStream.Subscribe(outOfOrderEvents.Add); var outevents = prog.ToEnumerable().ToList(); Assert.IsTrue(outevents.IsOrdered(t => t.SyncTime)); @@ -2491,7 +2491,7 @@ public void DisorderedStartEdgeTestRowAdjust1020Diagnostic() var diagnosticStream = ingress.GetDroppedAdjustedEventsDiagnostic(); var outOfOrderEvents = new List>(); - diagnosticStream.Subscribe(o => outOfOrderEvents.Add(o)); + diagnosticStream.Subscribe(outOfOrderEvents.Add); var outevents = prog.ToEnumerable().ToList(); Assert.IsTrue(outevents.IsOrdered(t => t.SyncTime)); @@ -2546,7 +2546,7 @@ public void DisorderedIntervalTestRowAdjust1020Diagnostic() var diagnosticStream = ingress.GetDroppedAdjustedEventsDiagnostic(); var outOfOrderEvents = new List>(); - diagnosticStream.Subscribe(o => outOfOrderEvents.Add(o)); + diagnosticStream.Subscribe(outOfOrderEvents.Add); var outevents = prog.ToEnumerable().ToList(); Assert.IsTrue(outevents.IsOrdered(t => t.SyncTime)); @@ -2778,7 +2778,7 @@ public void DisorderedStartEdgeTestRowAdjust105TimeDiagnostic() var diagnosticStream = ingress.GetDroppedAdjustedEventsDiagnostic(); var outOfOrderEvents = new List>(); - diagnosticStream.Subscribe(o => outOfOrderEvents.Add(o)); + diagnosticStream.Subscribe(outOfOrderEvents.Add); var outevents = prog.ToEnumerable().ToList(); Assert.IsTrue(outevents.IsOrdered(t => t.SyncTime)); @@ -2873,7 +2873,7 @@ public void DisorderedIntervalTestRowAdjust105TimeDiagnostic() var diagnosticStream = ingress.GetDroppedAdjustedEventsDiagnostic(); var outOfOrderEvents = new List>(); - diagnosticStream.Subscribe(o => outOfOrderEvents.Add(o)); + diagnosticStream.Subscribe(outOfOrderEvents.Add); var outevents = prog.ToEnumerable().ToList(); Assert.IsTrue(outevents.IsOrdered(t => t.SyncTime)); @@ -3131,7 +3131,7 @@ public void DisorderedStartEdgeTestRowAdjust1020TimeDiagnostic() var diagnosticStream = ingress.GetDroppedAdjustedEventsDiagnostic(); var outOfOrderEvents = new List>(); - diagnosticStream.Subscribe(o => outOfOrderEvents.Add(o)); + diagnosticStream.Subscribe(outOfOrderEvents.Add); var outevents = prog.ToEnumerable().ToList(); Assert.IsTrue(outevents.IsOrdered(t => t.SyncTime)); @@ -3219,7 +3219,7 @@ public void DisorderedIntervalTestRowAdjust1020TimeDiagnostic() var diagnosticStream = ingress.GetDroppedAdjustedEventsDiagnostic(); var outOfOrderEvents = new List>(); - diagnosticStream.Subscribe(o => outOfOrderEvents.Add(o)); + diagnosticStream.Subscribe(outOfOrderEvents.Add); var outevents = prog.ToEnumerable().ToList(); Assert.IsTrue(outevents.IsOrdered(t => t.SyncTime)); @@ -3415,7 +3415,7 @@ public void DisorderedStartEdgeTestRowSmallBatchDrop105Diagnostic() var diagnosticStream = ingress.GetDroppedAdjustedEventsDiagnostic(); var outOfOrderEvents = new List>(); - diagnosticStream.Subscribe(o => outOfOrderEvents.Add(o)); + diagnosticStream.Subscribe(outOfOrderEvents.Add); var outevents = prog.ToEnumerable().ToList(); Assert.IsTrue(outevents.IsOrdered(t => t.SyncTime)); @@ -3476,7 +3476,7 @@ public void DisorderedIntervalTestRowSmallBatchDrop105Diagnostic() var diagnosticStream = ingress.GetDroppedAdjustedEventsDiagnostic(); var outOfOrderEvents = new List>(); - diagnosticStream.Subscribe(o => outOfOrderEvents.Add(o)); + diagnosticStream.Subscribe(outOfOrderEvents.Add); var outevents = prog.ToEnumerable().ToList(); Assert.IsTrue(outevents.IsOrdered(t => t.SyncTime)); @@ -3633,7 +3633,7 @@ public void DisorderedStartEdgeTestRowSmallBatchDrop1020Diagnostic() var diagnosticStream = ingress.GetDroppedAdjustedEventsDiagnostic(); var outOfOrderEvents = new List>(); - diagnosticStream.Subscribe(o => outOfOrderEvents.Add(o)); + diagnosticStream.Subscribe(outOfOrderEvents.Add); var outevents = prog.ToEnumerable().ToList(); Assert.IsTrue(outevents.IsOrdered(t => t.SyncTime)); @@ -3688,7 +3688,7 @@ public void DisorderedIntervalTestRowSmallBatchDrop1020Diagnostic() var diagnosticStream = ingress.GetDroppedAdjustedEventsDiagnostic(); var outOfOrderEvents = new List>(); - diagnosticStream.Subscribe(o => outOfOrderEvents.Add(o)); + diagnosticStream.Subscribe(outOfOrderEvents.Add); var outevents = prog.ToEnumerable().ToList(); Assert.IsTrue(outevents.IsOrdered(t => t.SyncTime)); @@ -3917,7 +3917,7 @@ public void DisorderedStartEdgeTestRowSmallBatchDrop105TimeDiagnostic() var diagnosticStream = ingress.GetDroppedAdjustedEventsDiagnostic(); var outOfOrderEvents = new List>(); - diagnosticStream.Subscribe(o => outOfOrderEvents.Add(o)); + diagnosticStream.Subscribe(outOfOrderEvents.Add); var outevents = prog.ToEnumerable().ToList(); Assert.IsTrue(outevents.IsOrdered(t => t.SyncTime)); @@ -4011,7 +4011,7 @@ public void DisorderedIntervalTestRowSmallBatchDrop105TimeDiagnostic() var diagnosticStream = ingress.GetDroppedAdjustedEventsDiagnostic(); var outOfOrderEvents = new List>(); - diagnosticStream.Subscribe(o => outOfOrderEvents.Add(o)); + diagnosticStream.Subscribe(outOfOrderEvents.Add); var outevents = prog.ToEnumerable().ToList(); Assert.IsTrue(outevents.IsOrdered(t => t.SyncTime)); @@ -4267,7 +4267,7 @@ public void DisorderedStartEdgeTestRowSmallBatchDrop1020TimeDiagnostic() var diagnosticStream = ingress.GetDroppedAdjustedEventsDiagnostic(); var outOfOrderEvents = new List>(); - diagnosticStream.Subscribe(o => outOfOrderEvents.Add(o)); + diagnosticStream.Subscribe(outOfOrderEvents.Add); var outevents = prog.ToEnumerable().ToList(); Assert.IsTrue(outevents.IsOrdered(t => t.SyncTime)); @@ -4355,7 +4355,7 @@ public void DisorderedIntervalTestRowSmallBatchDrop1020TimeDiagnostic() var diagnosticStream = ingress.GetDroppedAdjustedEventsDiagnostic(); var outOfOrderEvents = new List>(); - diagnosticStream.Subscribe(o => outOfOrderEvents.Add(o)); + diagnosticStream.Subscribe(outOfOrderEvents.Add); var outevents = prog.ToEnumerable().ToList(); Assert.IsTrue(outevents.IsOrdered(t => t.SyncTime)); @@ -4463,7 +4463,7 @@ public void DisorderedStartEdgeTestRowSmallBatchThrow105() } catch(Exception) { - Assert.IsTrue(true); // Todo. Verify if the ingress/egress before the exception was correct. + // Todo. Verify if the ingress/egress before the exception was correct. } } @@ -4506,7 +4506,7 @@ public void DisorderedIntervalTestRowSmallBatchThrow105() } catch(Exception) { - Assert.IsTrue(true); // Todo. Verify if the ingress/egress before the exception was correct. + // Todo. Verify if the ingress/egress before the exception was correct. } } } @@ -4551,7 +4551,7 @@ public void DisorderedStartEdgeTestRowSmallBatchThrow105Diagnostic() var diagnosticStream = ingress.GetDroppedAdjustedEventsDiagnostic(); var outOfOrderEvents = new List>(); - diagnosticStream.Subscribe(o => outOfOrderEvents.Add(o)); + diagnosticStream.Subscribe(outOfOrderEvents.Add); var outevents = prog.ToEnumerable().ToList(); Assert.IsTrue(outevents.IsOrdered(t => t.SyncTime)); @@ -4563,7 +4563,7 @@ public void DisorderedStartEdgeTestRowSmallBatchThrow105Diagnostic() } catch(Exception) { - Assert.IsTrue(true); // Todo. Verify if the ingress/egress before the exception was correct. + // Todo. Verify if the ingress/egress before the exception was correct. } } @@ -4598,7 +4598,7 @@ public void DisorderedIntervalTestRowSmallBatchThrow105Diagnostic() var diagnosticStream = ingress.GetDroppedAdjustedEventsDiagnostic(); var outOfOrderEvents = new List>(); - diagnosticStream.Subscribe(o => outOfOrderEvents.Add(o)); + diagnosticStream.Subscribe(outOfOrderEvents.Add); var outevents = prog.ToEnumerable().ToList(); Assert.IsTrue(outevents.IsOrdered(t => t.SyncTime)); @@ -4610,7 +4610,7 @@ public void DisorderedIntervalTestRowSmallBatchThrow105Diagnostic() } catch(Exception) { - Assert.IsTrue(true); // Todo. Verify if the ingress/egress before the exception was correct. + // Todo. Verify if the ingress/egress before the exception was correct. } } } @@ -4755,7 +4755,7 @@ public void DisorderedStartEdgeTestRowSmallBatchThrow1020Diagnostic() var diagnosticStream = ingress.GetDroppedAdjustedEventsDiagnostic(); var outOfOrderEvents = new List>(); - diagnosticStream.Subscribe(o => outOfOrderEvents.Add(o)); + diagnosticStream.Subscribe(outOfOrderEvents.Add); var outevents = prog.ToEnumerable().ToList(); Assert.IsTrue(outevents.IsOrdered(t => t.SyncTime)); @@ -4817,7 +4817,7 @@ public void DisorderedIntervalTestRowSmallBatchThrow1020Diagnostic() var diagnosticStream = ingress.GetDroppedAdjustedEventsDiagnostic(); var outOfOrderEvents = new List>(); - diagnosticStream.Subscribe(o => outOfOrderEvents.Add(o)); + diagnosticStream.Subscribe(outOfOrderEvents.Add); var outevents = prog.ToEnumerable().ToList(); Assert.IsTrue(outevents.IsOrdered(t => t.SyncTime)); @@ -4897,7 +4897,7 @@ public void DisorderedStartEdgeTestRowSmallBatchThrow105Time() } catch(Exception) { - Assert.IsTrue(true); // Todo. Verify if the ingress/egress before the exception was correct. + // Todo. Verify if the ingress/egress before the exception was correct. } } @@ -4940,7 +4940,7 @@ public void DisorderedIntervalTestRowSmallBatchThrow105Time() } catch(Exception) { - Assert.IsTrue(true); // Todo. Verify if the ingress/egress before the exception was correct. + // Todo. Verify if the ingress/egress before the exception was correct. } } } @@ -4985,7 +4985,7 @@ public void DisorderedStartEdgeTestRowSmallBatchThrow105TimeDiagnostic() var diagnosticStream = ingress.GetDroppedAdjustedEventsDiagnostic(); var outOfOrderEvents = new List>(); - diagnosticStream.Subscribe(o => outOfOrderEvents.Add(o)); + diagnosticStream.Subscribe(outOfOrderEvents.Add); var outevents = prog.ToEnumerable().ToList(); Assert.IsTrue(outevents.IsOrdered(t => t.SyncTime)); @@ -4997,7 +4997,7 @@ public void DisorderedStartEdgeTestRowSmallBatchThrow105TimeDiagnostic() } catch(Exception) { - Assert.IsTrue(true); // Todo. Verify if the ingress/egress before the exception was correct. + // Todo. Verify if the ingress/egress before the exception was correct. } } @@ -5032,7 +5032,7 @@ public void DisorderedIntervalTestRowSmallBatchThrow105TimeDiagnostic() var diagnosticStream = ingress.GetDroppedAdjustedEventsDiagnostic(); var outOfOrderEvents = new List>(); - diagnosticStream.Subscribe(o => outOfOrderEvents.Add(o)); + diagnosticStream.Subscribe(outOfOrderEvents.Add); var outevents = prog.ToEnumerable().ToList(); Assert.IsTrue(outevents.IsOrdered(t => t.SyncTime)); @@ -5044,7 +5044,7 @@ public void DisorderedIntervalTestRowSmallBatchThrow105TimeDiagnostic() } catch(Exception) { - Assert.IsTrue(true); // Todo. Verify if the ingress/egress before the exception was correct. + // Todo. Verify if the ingress/egress before the exception was correct. } } } @@ -5255,7 +5255,7 @@ public void DisorderedStartEdgeTestRowSmallBatchThrow1020TimeDiagnostic() var diagnosticStream = ingress.GetDroppedAdjustedEventsDiagnostic(); var outOfOrderEvents = new List>(); - diagnosticStream.Subscribe(o => outOfOrderEvents.Add(o)); + diagnosticStream.Subscribe(outOfOrderEvents.Add); var outevents = prog.ToEnumerable().ToList(); Assert.IsTrue(outevents.IsOrdered(t => t.SyncTime)); @@ -5350,7 +5350,7 @@ public void DisorderedIntervalTestRowSmallBatchThrow1020TimeDiagnostic() var diagnosticStream = ingress.GetDroppedAdjustedEventsDiagnostic(); var outOfOrderEvents = new List>(); - diagnosticStream.Subscribe(o => outOfOrderEvents.Add(o)); + diagnosticStream.Subscribe(outOfOrderEvents.Add); var outevents = prog.ToEnumerable().ToList(); Assert.IsTrue(outevents.IsOrdered(t => t.SyncTime)); @@ -5556,7 +5556,7 @@ public void DisorderedStartEdgeTestRowSmallBatchAdjust105Diagnostic() var diagnosticStream = ingress.GetDroppedAdjustedEventsDiagnostic(); var outOfOrderEvents = new List>(); - diagnosticStream.Subscribe(o => outOfOrderEvents.Add(o)); + diagnosticStream.Subscribe(outOfOrderEvents.Add); var outevents = prog.ToEnumerable().ToList(); Assert.IsTrue(outevents.IsOrdered(t => t.SyncTime)); @@ -5618,7 +5618,7 @@ public void DisorderedIntervalTestRowSmallBatchAdjust105Diagnostic() var diagnosticStream = ingress.GetDroppedAdjustedEventsDiagnostic(); var outOfOrderEvents = new List>(); - diagnosticStream.Subscribe(o => outOfOrderEvents.Add(o)); + diagnosticStream.Subscribe(outOfOrderEvents.Add); var outevents = prog.ToEnumerable().ToList(); Assert.IsTrue(outevents.IsOrdered(t => t.SyncTime)); @@ -5779,7 +5779,7 @@ public void DisorderedStartEdgeTestRowSmallBatchAdjust1020Diagnostic() var diagnosticStream = ingress.GetDroppedAdjustedEventsDiagnostic(); var outOfOrderEvents = new List>(); - diagnosticStream.Subscribe(o => outOfOrderEvents.Add(o)); + diagnosticStream.Subscribe(outOfOrderEvents.Add); var outevents = prog.ToEnumerable().ToList(); Assert.IsTrue(outevents.IsOrdered(t => t.SyncTime)); @@ -5834,7 +5834,7 @@ public void DisorderedIntervalTestRowSmallBatchAdjust1020Diagnostic() var diagnosticStream = ingress.GetDroppedAdjustedEventsDiagnostic(); var outOfOrderEvents = new List>(); - diagnosticStream.Subscribe(o => outOfOrderEvents.Add(o)); + diagnosticStream.Subscribe(outOfOrderEvents.Add); var outevents = prog.ToEnumerable().ToList(); Assert.IsTrue(outevents.IsOrdered(t => t.SyncTime)); @@ -6068,7 +6068,7 @@ public void DisorderedStartEdgeTestRowSmallBatchAdjust105TimeDiagnostic() var diagnosticStream = ingress.GetDroppedAdjustedEventsDiagnostic(); var outOfOrderEvents = new List>(); - diagnosticStream.Subscribe(o => outOfOrderEvents.Add(o)); + diagnosticStream.Subscribe(outOfOrderEvents.Add); var outevents = prog.ToEnumerable().ToList(); Assert.IsTrue(outevents.IsOrdered(t => t.SyncTime)); @@ -6163,7 +6163,7 @@ public void DisorderedIntervalTestRowSmallBatchAdjust105TimeDiagnostic() var diagnosticStream = ingress.GetDroppedAdjustedEventsDiagnostic(); var outOfOrderEvents = new List>(); - diagnosticStream.Subscribe(o => outOfOrderEvents.Add(o)); + diagnosticStream.Subscribe(outOfOrderEvents.Add); var outevents = prog.ToEnumerable().ToList(); Assert.IsTrue(outevents.IsOrdered(t => t.SyncTime)); @@ -6423,7 +6423,7 @@ public void DisorderedStartEdgeTestRowSmallBatchAdjust1020TimeDiagnostic() var diagnosticStream = ingress.GetDroppedAdjustedEventsDiagnostic(); var outOfOrderEvents = new List>(); - diagnosticStream.Subscribe(o => outOfOrderEvents.Add(o)); + diagnosticStream.Subscribe(outOfOrderEvents.Add); var outevents = prog.ToEnumerable().ToList(); Assert.IsTrue(outevents.IsOrdered(t => t.SyncTime)); @@ -6511,7 +6511,7 @@ public void DisorderedIntervalTestRowSmallBatchAdjust1020TimeDiagnostic() var diagnosticStream = ingress.GetDroppedAdjustedEventsDiagnostic(); var outOfOrderEvents = new List>(); - diagnosticStream.Subscribe(o => outOfOrderEvents.Add(o)); + diagnosticStream.Subscribe(outOfOrderEvents.Add); var outevents = prog.ToEnumerable().ToList(); Assert.IsTrue(outevents.IsOrdered(t => t.SyncTime)); @@ -6705,7 +6705,7 @@ public void DisorderedStartEdgeTestColumnarDrop105Diagnostic() var diagnosticStream = ingress.GetDroppedAdjustedEventsDiagnostic(); var outOfOrderEvents = new List>(); - diagnosticStream.Subscribe(o => outOfOrderEvents.Add(o)); + diagnosticStream.Subscribe(outOfOrderEvents.Add); var outevents = prog.ToEnumerable().ToList(); Assert.IsTrue(outevents.IsOrdered(t => t.SyncTime)); @@ -6766,7 +6766,7 @@ public void DisorderedIntervalTestColumnarDrop105Diagnostic() var diagnosticStream = ingress.GetDroppedAdjustedEventsDiagnostic(); var outOfOrderEvents = new List>(); - diagnosticStream.Subscribe(o => outOfOrderEvents.Add(o)); + diagnosticStream.Subscribe(outOfOrderEvents.Add); var outevents = prog.ToEnumerable().ToList(); Assert.IsTrue(outevents.IsOrdered(t => t.SyncTime)); @@ -6921,7 +6921,7 @@ public void DisorderedStartEdgeTestColumnarDrop1020Diagnostic() var diagnosticStream = ingress.GetDroppedAdjustedEventsDiagnostic(); var outOfOrderEvents = new List>(); - diagnosticStream.Subscribe(o => outOfOrderEvents.Add(o)); + diagnosticStream.Subscribe(outOfOrderEvents.Add); var outevents = prog.ToEnumerable().ToList(); Assert.IsTrue(outevents.IsOrdered(t => t.SyncTime)); @@ -6976,7 +6976,7 @@ public void DisorderedIntervalTestColumnarDrop1020Diagnostic() var diagnosticStream = ingress.GetDroppedAdjustedEventsDiagnostic(); var outOfOrderEvents = new List>(); - diagnosticStream.Subscribe(o => outOfOrderEvents.Add(o)); + diagnosticStream.Subscribe(outOfOrderEvents.Add); var outevents = prog.ToEnumerable().ToList(); Assert.IsTrue(outevents.IsOrdered(t => t.SyncTime)); @@ -7203,7 +7203,7 @@ public void DisorderedStartEdgeTestColumnarDrop105TimeDiagnostic() var diagnosticStream = ingress.GetDroppedAdjustedEventsDiagnostic(); var outOfOrderEvents = new List>(); - diagnosticStream.Subscribe(o => outOfOrderEvents.Add(o)); + diagnosticStream.Subscribe(outOfOrderEvents.Add); var outevents = prog.ToEnumerable().ToList(); Assert.IsTrue(outevents.IsOrdered(t => t.SyncTime)); @@ -7297,7 +7297,7 @@ public void DisorderedIntervalTestColumnarDrop105TimeDiagnostic() var diagnosticStream = ingress.GetDroppedAdjustedEventsDiagnostic(); var outOfOrderEvents = new List>(); - diagnosticStream.Subscribe(o => outOfOrderEvents.Add(o)); + diagnosticStream.Subscribe(outOfOrderEvents.Add); var outevents = prog.ToEnumerable().ToList(); Assert.IsTrue(outevents.IsOrdered(t => t.SyncTime)); @@ -7551,7 +7551,7 @@ public void DisorderedStartEdgeTestColumnarDrop1020TimeDiagnostic() var diagnosticStream = ingress.GetDroppedAdjustedEventsDiagnostic(); var outOfOrderEvents = new List>(); - diagnosticStream.Subscribe(o => outOfOrderEvents.Add(o)); + diagnosticStream.Subscribe(outOfOrderEvents.Add); var outevents = prog.ToEnumerable().ToList(); Assert.IsTrue(outevents.IsOrdered(t => t.SyncTime)); @@ -7639,7 +7639,7 @@ public void DisorderedIntervalTestColumnarDrop1020TimeDiagnostic() var diagnosticStream = ingress.GetDroppedAdjustedEventsDiagnostic(); var outOfOrderEvents = new List>(); - diagnosticStream.Subscribe(o => outOfOrderEvents.Add(o)); + diagnosticStream.Subscribe(outOfOrderEvents.Add); var outevents = prog.ToEnumerable().ToList(); Assert.IsTrue(outevents.IsOrdered(t => t.SyncTime)); @@ -7746,7 +7746,7 @@ public void DisorderedStartEdgeTestColumnarThrow105() } catch(Exception) { - Assert.IsTrue(true); // Todo. Verify if the ingress/egress before the exception was correct. + // Todo. Verify if the ingress/egress before the exception was correct. } } @@ -7789,7 +7789,7 @@ public void DisorderedIntervalTestColumnarThrow105() } catch(Exception) { - Assert.IsTrue(true); // Todo. Verify if the ingress/egress before the exception was correct. + // Todo. Verify if the ingress/egress before the exception was correct. } } } @@ -7833,7 +7833,7 @@ public void DisorderedStartEdgeTestColumnarThrow105Diagnostic() var diagnosticStream = ingress.GetDroppedAdjustedEventsDiagnostic(); var outOfOrderEvents = new List>(); - diagnosticStream.Subscribe(o => outOfOrderEvents.Add(o)); + diagnosticStream.Subscribe(outOfOrderEvents.Add); var outevents = prog.ToEnumerable().ToList(); Assert.IsTrue(outevents.IsOrdered(t => t.SyncTime)); @@ -7845,7 +7845,7 @@ public void DisorderedStartEdgeTestColumnarThrow105Diagnostic() } catch(Exception) { - Assert.IsTrue(true); // Todo. Verify if the ingress/egress before the exception was correct. + // Todo. Verify if the ingress/egress before the exception was correct. } } @@ -7880,7 +7880,7 @@ public void DisorderedIntervalTestColumnarThrow105Diagnostic() var diagnosticStream = ingress.GetDroppedAdjustedEventsDiagnostic(); var outOfOrderEvents = new List>(); - diagnosticStream.Subscribe(o => outOfOrderEvents.Add(o)); + diagnosticStream.Subscribe(outOfOrderEvents.Add); var outevents = prog.ToEnumerable().ToList(); Assert.IsTrue(outevents.IsOrdered(t => t.SyncTime)); @@ -7892,7 +7892,7 @@ public void DisorderedIntervalTestColumnarThrow105Diagnostic() } catch(Exception) { - Assert.IsTrue(true); // Todo. Verify if the ingress/egress before the exception was correct. + // Todo. Verify if the ingress/egress before the exception was correct. } } } @@ -8035,7 +8035,7 @@ public void DisorderedStartEdgeTestColumnarThrow1020Diagnostic() var diagnosticStream = ingress.GetDroppedAdjustedEventsDiagnostic(); var outOfOrderEvents = new List>(); - diagnosticStream.Subscribe(o => outOfOrderEvents.Add(o)); + diagnosticStream.Subscribe(outOfOrderEvents.Add); var outevents = prog.ToEnumerable().ToList(); Assert.IsTrue(outevents.IsOrdered(t => t.SyncTime)); @@ -8097,7 +8097,7 @@ public void DisorderedIntervalTestColumnarThrow1020Diagnostic() var diagnosticStream = ingress.GetDroppedAdjustedEventsDiagnostic(); var outOfOrderEvents = new List>(); - diagnosticStream.Subscribe(o => outOfOrderEvents.Add(o)); + diagnosticStream.Subscribe(outOfOrderEvents.Add); var outevents = prog.ToEnumerable().ToList(); Assert.IsTrue(outevents.IsOrdered(t => t.SyncTime)); @@ -8176,7 +8176,7 @@ public void DisorderedStartEdgeTestColumnarThrow105Time() } catch(Exception) { - Assert.IsTrue(true); // Todo. Verify if the ingress/egress before the exception was correct. + // Todo. Verify if the ingress/egress before the exception was correct. } } @@ -8219,7 +8219,7 @@ public void DisorderedIntervalTestColumnarThrow105Time() } catch(Exception) { - Assert.IsTrue(true); // Todo. Verify if the ingress/egress before the exception was correct. + // Todo. Verify if the ingress/egress before the exception was correct. } } } @@ -8263,7 +8263,7 @@ public void DisorderedStartEdgeTestColumnarThrow105TimeDiagnostic() var diagnosticStream = ingress.GetDroppedAdjustedEventsDiagnostic(); var outOfOrderEvents = new List>(); - diagnosticStream.Subscribe(o => outOfOrderEvents.Add(o)); + diagnosticStream.Subscribe(outOfOrderEvents.Add); var outevents = prog.ToEnumerable().ToList(); Assert.IsTrue(outevents.IsOrdered(t => t.SyncTime)); @@ -8275,7 +8275,7 @@ public void DisorderedStartEdgeTestColumnarThrow105TimeDiagnostic() } catch(Exception) { - Assert.IsTrue(true); // Todo. Verify if the ingress/egress before the exception was correct. + // Todo. Verify if the ingress/egress before the exception was correct. } } @@ -8310,7 +8310,7 @@ public void DisorderedIntervalTestColumnarThrow105TimeDiagnostic() var diagnosticStream = ingress.GetDroppedAdjustedEventsDiagnostic(); var outOfOrderEvents = new List>(); - diagnosticStream.Subscribe(o => outOfOrderEvents.Add(o)); + diagnosticStream.Subscribe(outOfOrderEvents.Add); var outevents = prog.ToEnumerable().ToList(); Assert.IsTrue(outevents.IsOrdered(t => t.SyncTime)); @@ -8322,7 +8322,7 @@ public void DisorderedIntervalTestColumnarThrow105TimeDiagnostic() } catch(Exception) { - Assert.IsTrue(true); // Todo. Verify if the ingress/egress before the exception was correct. + // Todo. Verify if the ingress/egress before the exception was correct. } } } @@ -8531,7 +8531,7 @@ public void DisorderedStartEdgeTestColumnarThrow1020TimeDiagnostic() var diagnosticStream = ingress.GetDroppedAdjustedEventsDiagnostic(); var outOfOrderEvents = new List>(); - diagnosticStream.Subscribe(o => outOfOrderEvents.Add(o)); + diagnosticStream.Subscribe(outOfOrderEvents.Add); var outevents = prog.ToEnumerable().ToList(); Assert.IsTrue(outevents.IsOrdered(t => t.SyncTime)); @@ -8626,7 +8626,7 @@ public void DisorderedIntervalTestColumnarThrow1020TimeDiagnostic() var diagnosticStream = ingress.GetDroppedAdjustedEventsDiagnostic(); var outOfOrderEvents = new List>(); - diagnosticStream.Subscribe(o => outOfOrderEvents.Add(o)); + diagnosticStream.Subscribe(outOfOrderEvents.Add); var outevents = prog.ToEnumerable().ToList(); Assert.IsTrue(outevents.IsOrdered(t => t.SyncTime)); @@ -8830,7 +8830,7 @@ public void DisorderedStartEdgeTestColumnarAdjust105Diagnostic() var diagnosticStream = ingress.GetDroppedAdjustedEventsDiagnostic(); var outOfOrderEvents = new List>(); - diagnosticStream.Subscribe(o => outOfOrderEvents.Add(o)); + diagnosticStream.Subscribe(outOfOrderEvents.Add); var outevents = prog.ToEnumerable().ToList(); Assert.IsTrue(outevents.IsOrdered(t => t.SyncTime)); @@ -8892,7 +8892,7 @@ public void DisorderedIntervalTestColumnarAdjust105Diagnostic() var diagnosticStream = ingress.GetDroppedAdjustedEventsDiagnostic(); var outOfOrderEvents = new List>(); - diagnosticStream.Subscribe(o => outOfOrderEvents.Add(o)); + diagnosticStream.Subscribe(outOfOrderEvents.Add); var outevents = prog.ToEnumerable().ToList(); Assert.IsTrue(outevents.IsOrdered(t => t.SyncTime)); @@ -9051,7 +9051,7 @@ public void DisorderedStartEdgeTestColumnarAdjust1020Diagnostic() var diagnosticStream = ingress.GetDroppedAdjustedEventsDiagnostic(); var outOfOrderEvents = new List>(); - diagnosticStream.Subscribe(o => outOfOrderEvents.Add(o)); + diagnosticStream.Subscribe(outOfOrderEvents.Add); var outevents = prog.ToEnumerable().ToList(); Assert.IsTrue(outevents.IsOrdered(t => t.SyncTime)); @@ -9106,7 +9106,7 @@ public void DisorderedIntervalTestColumnarAdjust1020Diagnostic() var diagnosticStream = ingress.GetDroppedAdjustedEventsDiagnostic(); var outOfOrderEvents = new List>(); - diagnosticStream.Subscribe(o => outOfOrderEvents.Add(o)); + diagnosticStream.Subscribe(outOfOrderEvents.Add); var outevents = prog.ToEnumerable().ToList(); Assert.IsTrue(outevents.IsOrdered(t => t.SyncTime)); @@ -9338,7 +9338,7 @@ public void DisorderedStartEdgeTestColumnarAdjust105TimeDiagnostic() var diagnosticStream = ingress.GetDroppedAdjustedEventsDiagnostic(); var outOfOrderEvents = new List>(); - diagnosticStream.Subscribe(o => outOfOrderEvents.Add(o)); + diagnosticStream.Subscribe(outOfOrderEvents.Add); var outevents = prog.ToEnumerable().ToList(); Assert.IsTrue(outevents.IsOrdered(t => t.SyncTime)); @@ -9433,7 +9433,7 @@ public void DisorderedIntervalTestColumnarAdjust105TimeDiagnostic() var diagnosticStream = ingress.GetDroppedAdjustedEventsDiagnostic(); var outOfOrderEvents = new List>(); - diagnosticStream.Subscribe(o => outOfOrderEvents.Add(o)); + diagnosticStream.Subscribe(outOfOrderEvents.Add); var outevents = prog.ToEnumerable().ToList(); Assert.IsTrue(outevents.IsOrdered(t => t.SyncTime)); @@ -9691,7 +9691,7 @@ public void DisorderedStartEdgeTestColumnarAdjust1020TimeDiagnostic() var diagnosticStream = ingress.GetDroppedAdjustedEventsDiagnostic(); var outOfOrderEvents = new List>(); - diagnosticStream.Subscribe(o => outOfOrderEvents.Add(o)); + diagnosticStream.Subscribe(outOfOrderEvents.Add); var outevents = prog.ToEnumerable().ToList(); Assert.IsTrue(outevents.IsOrdered(t => t.SyncTime)); @@ -9779,7 +9779,7 @@ public void DisorderedIntervalTestColumnarAdjust1020TimeDiagnostic() var diagnosticStream = ingress.GetDroppedAdjustedEventsDiagnostic(); var outOfOrderEvents = new List>(); - diagnosticStream.Subscribe(o => outOfOrderEvents.Add(o)); + diagnosticStream.Subscribe(outOfOrderEvents.Add); var outevents = prog.ToEnumerable().ToList(); Assert.IsTrue(outevents.IsOrdered(t => t.SyncTime)); @@ -9975,7 +9975,7 @@ public void DisorderedStartEdgeTestColumnarSmallBatchDrop105Diagnostic() var diagnosticStream = ingress.GetDroppedAdjustedEventsDiagnostic(); var outOfOrderEvents = new List>(); - diagnosticStream.Subscribe(o => outOfOrderEvents.Add(o)); + diagnosticStream.Subscribe(outOfOrderEvents.Add); var outevents = prog.ToEnumerable().ToList(); Assert.IsTrue(outevents.IsOrdered(t => t.SyncTime)); @@ -10036,7 +10036,7 @@ public void DisorderedIntervalTestColumnarSmallBatchDrop105Diagnostic() var diagnosticStream = ingress.GetDroppedAdjustedEventsDiagnostic(); var outOfOrderEvents = new List>(); - diagnosticStream.Subscribe(o => outOfOrderEvents.Add(o)); + diagnosticStream.Subscribe(outOfOrderEvents.Add); var outevents = prog.ToEnumerable().ToList(); Assert.IsTrue(outevents.IsOrdered(t => t.SyncTime)); @@ -10193,7 +10193,7 @@ public void DisorderedStartEdgeTestColumnarSmallBatchDrop1020Diagnostic() var diagnosticStream = ingress.GetDroppedAdjustedEventsDiagnostic(); var outOfOrderEvents = new List>(); - diagnosticStream.Subscribe(o => outOfOrderEvents.Add(o)); + diagnosticStream.Subscribe(outOfOrderEvents.Add); var outevents = prog.ToEnumerable().ToList(); Assert.IsTrue(outevents.IsOrdered(t => t.SyncTime)); @@ -10248,7 +10248,7 @@ public void DisorderedIntervalTestColumnarSmallBatchDrop1020Diagnostic() var diagnosticStream = ingress.GetDroppedAdjustedEventsDiagnostic(); var outOfOrderEvents = new List>(); - diagnosticStream.Subscribe(o => outOfOrderEvents.Add(o)); + diagnosticStream.Subscribe(outOfOrderEvents.Add); var outevents = prog.ToEnumerable().ToList(); Assert.IsTrue(outevents.IsOrdered(t => t.SyncTime)); @@ -10477,7 +10477,7 @@ public void DisorderedStartEdgeTestColumnarSmallBatchDrop105TimeDiagnostic() var diagnosticStream = ingress.GetDroppedAdjustedEventsDiagnostic(); var outOfOrderEvents = new List>(); - diagnosticStream.Subscribe(o => outOfOrderEvents.Add(o)); + diagnosticStream.Subscribe(outOfOrderEvents.Add); var outevents = prog.ToEnumerable().ToList(); Assert.IsTrue(outevents.IsOrdered(t => t.SyncTime)); @@ -10571,7 +10571,7 @@ public void DisorderedIntervalTestColumnarSmallBatchDrop105TimeDiagnostic() var diagnosticStream = ingress.GetDroppedAdjustedEventsDiagnostic(); var outOfOrderEvents = new List>(); - diagnosticStream.Subscribe(o => outOfOrderEvents.Add(o)); + diagnosticStream.Subscribe(outOfOrderEvents.Add); var outevents = prog.ToEnumerable().ToList(); Assert.IsTrue(outevents.IsOrdered(t => t.SyncTime)); @@ -10827,7 +10827,7 @@ public void DisorderedStartEdgeTestColumnarSmallBatchDrop1020TimeDiagnostic() var diagnosticStream = ingress.GetDroppedAdjustedEventsDiagnostic(); var outOfOrderEvents = new List>(); - diagnosticStream.Subscribe(o => outOfOrderEvents.Add(o)); + diagnosticStream.Subscribe(outOfOrderEvents.Add); var outevents = prog.ToEnumerable().ToList(); Assert.IsTrue(outevents.IsOrdered(t => t.SyncTime)); @@ -10915,7 +10915,7 @@ public void DisorderedIntervalTestColumnarSmallBatchDrop1020TimeDiagnostic() var diagnosticStream = ingress.GetDroppedAdjustedEventsDiagnostic(); var outOfOrderEvents = new List>(); - diagnosticStream.Subscribe(o => outOfOrderEvents.Add(o)); + diagnosticStream.Subscribe(outOfOrderEvents.Add); var outevents = prog.ToEnumerable().ToList(); Assert.IsTrue(outevents.IsOrdered(t => t.SyncTime)); @@ -11023,7 +11023,7 @@ public void DisorderedStartEdgeTestColumnarSmallBatchThrow105() } catch(Exception) { - Assert.IsTrue(true); // Todo. Verify if the ingress/egress before the exception was correct. + // Todo. Verify if the ingress/egress before the exception was correct. } } @@ -11066,7 +11066,7 @@ public void DisorderedIntervalTestColumnarSmallBatchThrow105() } catch(Exception) { - Assert.IsTrue(true); // Todo. Verify if the ingress/egress before the exception was correct. + // Todo. Verify if the ingress/egress before the exception was correct. } } } @@ -11111,7 +11111,7 @@ public void DisorderedStartEdgeTestColumnarSmallBatchThrow105Diagnostic() var diagnosticStream = ingress.GetDroppedAdjustedEventsDiagnostic(); var outOfOrderEvents = new List>(); - diagnosticStream.Subscribe(o => outOfOrderEvents.Add(o)); + diagnosticStream.Subscribe(outOfOrderEvents.Add); var outevents = prog.ToEnumerable().ToList(); Assert.IsTrue(outevents.IsOrdered(t => t.SyncTime)); @@ -11123,7 +11123,7 @@ public void DisorderedStartEdgeTestColumnarSmallBatchThrow105Diagnostic() } catch(Exception) { - Assert.IsTrue(true); // Todo. Verify if the ingress/egress before the exception was correct. + // Todo. Verify if the ingress/egress before the exception was correct. } } @@ -11158,7 +11158,7 @@ public void DisorderedIntervalTestColumnarSmallBatchThrow105Diagnostic() var diagnosticStream = ingress.GetDroppedAdjustedEventsDiagnostic(); var outOfOrderEvents = new List>(); - diagnosticStream.Subscribe(o => outOfOrderEvents.Add(o)); + diagnosticStream.Subscribe(outOfOrderEvents.Add); var outevents = prog.ToEnumerable().ToList(); Assert.IsTrue(outevents.IsOrdered(t => t.SyncTime)); @@ -11170,7 +11170,7 @@ public void DisorderedIntervalTestColumnarSmallBatchThrow105Diagnostic() } catch(Exception) { - Assert.IsTrue(true); // Todo. Verify if the ingress/egress before the exception was correct. + // Todo. Verify if the ingress/egress before the exception was correct. } } } @@ -11315,7 +11315,7 @@ public void DisorderedStartEdgeTestColumnarSmallBatchThrow1020Diagnostic() var diagnosticStream = ingress.GetDroppedAdjustedEventsDiagnostic(); var outOfOrderEvents = new List>(); - diagnosticStream.Subscribe(o => outOfOrderEvents.Add(o)); + diagnosticStream.Subscribe(outOfOrderEvents.Add); var outevents = prog.ToEnumerable().ToList(); Assert.IsTrue(outevents.IsOrdered(t => t.SyncTime)); @@ -11377,7 +11377,7 @@ public void DisorderedIntervalTestColumnarSmallBatchThrow1020Diagnostic() var diagnosticStream = ingress.GetDroppedAdjustedEventsDiagnostic(); var outOfOrderEvents = new List>(); - diagnosticStream.Subscribe(o => outOfOrderEvents.Add(o)); + diagnosticStream.Subscribe(outOfOrderEvents.Add); var outevents = prog.ToEnumerable().ToList(); Assert.IsTrue(outevents.IsOrdered(t => t.SyncTime)); @@ -11457,7 +11457,7 @@ public void DisorderedStartEdgeTestColumnarSmallBatchThrow105Time() } catch(Exception) { - Assert.IsTrue(true); // Todo. Verify if the ingress/egress before the exception was correct. + // Todo. Verify if the ingress/egress before the exception was correct. } } @@ -11500,7 +11500,7 @@ public void DisorderedIntervalTestColumnarSmallBatchThrow105Time() } catch(Exception) { - Assert.IsTrue(true); // Todo. Verify if the ingress/egress before the exception was correct. + // Todo. Verify if the ingress/egress before the exception was correct. } } } @@ -11545,7 +11545,7 @@ public void DisorderedStartEdgeTestColumnarSmallBatchThrow105TimeDiagnostic() var diagnosticStream = ingress.GetDroppedAdjustedEventsDiagnostic(); var outOfOrderEvents = new List>(); - diagnosticStream.Subscribe(o => outOfOrderEvents.Add(o)); + diagnosticStream.Subscribe(outOfOrderEvents.Add); var outevents = prog.ToEnumerable().ToList(); Assert.IsTrue(outevents.IsOrdered(t => t.SyncTime)); @@ -11557,7 +11557,7 @@ public void DisorderedStartEdgeTestColumnarSmallBatchThrow105TimeDiagnostic() } catch(Exception) { - Assert.IsTrue(true); // Todo. Verify if the ingress/egress before the exception was correct. + // Todo. Verify if the ingress/egress before the exception was correct. } } @@ -11592,7 +11592,7 @@ public void DisorderedIntervalTestColumnarSmallBatchThrow105TimeDiagnostic() var diagnosticStream = ingress.GetDroppedAdjustedEventsDiagnostic(); var outOfOrderEvents = new List>(); - diagnosticStream.Subscribe(o => outOfOrderEvents.Add(o)); + diagnosticStream.Subscribe(outOfOrderEvents.Add); var outevents = prog.ToEnumerable().ToList(); Assert.IsTrue(outevents.IsOrdered(t => t.SyncTime)); @@ -11604,7 +11604,7 @@ public void DisorderedIntervalTestColumnarSmallBatchThrow105TimeDiagnostic() } catch(Exception) { - Assert.IsTrue(true); // Todo. Verify if the ingress/egress before the exception was correct. + // Todo. Verify if the ingress/egress before the exception was correct. } } } @@ -11815,7 +11815,7 @@ public void DisorderedStartEdgeTestColumnarSmallBatchThrow1020TimeDiagnostic() var diagnosticStream = ingress.GetDroppedAdjustedEventsDiagnostic(); var outOfOrderEvents = new List>(); - diagnosticStream.Subscribe(o => outOfOrderEvents.Add(o)); + diagnosticStream.Subscribe(outOfOrderEvents.Add); var outevents = prog.ToEnumerable().ToList(); Assert.IsTrue(outevents.IsOrdered(t => t.SyncTime)); @@ -11910,7 +11910,7 @@ public void DisorderedIntervalTestColumnarSmallBatchThrow1020TimeDiagnostic() var diagnosticStream = ingress.GetDroppedAdjustedEventsDiagnostic(); var outOfOrderEvents = new List>(); - diagnosticStream.Subscribe(o => outOfOrderEvents.Add(o)); + diagnosticStream.Subscribe(outOfOrderEvents.Add); var outevents = prog.ToEnumerable().ToList(); Assert.IsTrue(outevents.IsOrdered(t => t.SyncTime)); @@ -12116,7 +12116,7 @@ public void DisorderedStartEdgeTestColumnarSmallBatchAdjust105Diagnostic() var diagnosticStream = ingress.GetDroppedAdjustedEventsDiagnostic(); var outOfOrderEvents = new List>(); - diagnosticStream.Subscribe(o => outOfOrderEvents.Add(o)); + diagnosticStream.Subscribe(outOfOrderEvents.Add); var outevents = prog.ToEnumerable().ToList(); Assert.IsTrue(outevents.IsOrdered(t => t.SyncTime)); @@ -12178,7 +12178,7 @@ public void DisorderedIntervalTestColumnarSmallBatchAdjust105Diagnostic() var diagnosticStream = ingress.GetDroppedAdjustedEventsDiagnostic(); var outOfOrderEvents = new List>(); - diagnosticStream.Subscribe(o => outOfOrderEvents.Add(o)); + diagnosticStream.Subscribe(outOfOrderEvents.Add); var outevents = prog.ToEnumerable().ToList(); Assert.IsTrue(outevents.IsOrdered(t => t.SyncTime)); @@ -12339,7 +12339,7 @@ public void DisorderedStartEdgeTestColumnarSmallBatchAdjust1020Diagnostic() var diagnosticStream = ingress.GetDroppedAdjustedEventsDiagnostic(); var outOfOrderEvents = new List>(); - diagnosticStream.Subscribe(o => outOfOrderEvents.Add(o)); + diagnosticStream.Subscribe(outOfOrderEvents.Add); var outevents = prog.ToEnumerable().ToList(); Assert.IsTrue(outevents.IsOrdered(t => t.SyncTime)); @@ -12394,7 +12394,7 @@ public void DisorderedIntervalTestColumnarSmallBatchAdjust1020Diagnostic() var diagnosticStream = ingress.GetDroppedAdjustedEventsDiagnostic(); var outOfOrderEvents = new List>(); - diagnosticStream.Subscribe(o => outOfOrderEvents.Add(o)); + diagnosticStream.Subscribe(outOfOrderEvents.Add); var outevents = prog.ToEnumerable().ToList(); Assert.IsTrue(outevents.IsOrdered(t => t.SyncTime)); @@ -12628,7 +12628,7 @@ public void DisorderedStartEdgeTestColumnarSmallBatchAdjust105TimeDiagnostic() var diagnosticStream = ingress.GetDroppedAdjustedEventsDiagnostic(); var outOfOrderEvents = new List>(); - diagnosticStream.Subscribe(o => outOfOrderEvents.Add(o)); + diagnosticStream.Subscribe(outOfOrderEvents.Add); var outevents = prog.ToEnumerable().ToList(); Assert.IsTrue(outevents.IsOrdered(t => t.SyncTime)); @@ -12723,7 +12723,7 @@ public void DisorderedIntervalTestColumnarSmallBatchAdjust105TimeDiagnostic() var diagnosticStream = ingress.GetDroppedAdjustedEventsDiagnostic(); var outOfOrderEvents = new List>(); - diagnosticStream.Subscribe(o => outOfOrderEvents.Add(o)); + diagnosticStream.Subscribe(outOfOrderEvents.Add); var outevents = prog.ToEnumerable().ToList(); Assert.IsTrue(outevents.IsOrdered(t => t.SyncTime)); @@ -12983,7 +12983,7 @@ public void DisorderedStartEdgeTestColumnarSmallBatchAdjust1020TimeDiagnostic() var diagnosticStream = ingress.GetDroppedAdjustedEventsDiagnostic(); var outOfOrderEvents = new List>(); - diagnosticStream.Subscribe(o => outOfOrderEvents.Add(o)); + diagnosticStream.Subscribe(outOfOrderEvents.Add); var outevents = prog.ToEnumerable().ToList(); Assert.IsTrue(outevents.IsOrdered(t => t.SyncTime)); @@ -13071,7 +13071,7 @@ public void DisorderedIntervalTestColumnarSmallBatchAdjust1020TimeDiagnostic() var diagnosticStream = ingress.GetDroppedAdjustedEventsDiagnostic(); var outOfOrderEvents = new List>(); - diagnosticStream.Subscribe(o => outOfOrderEvents.Add(o)); + diagnosticStream.Subscribe(outOfOrderEvents.Add); var outevents = prog.ToEnumerable().ToList(); Assert.IsTrue(outevents.IsOrdered(t => t.SyncTime)); diff --git a/Sources/Test/SimpleTesting/IngressEgress/FlushPolicyTestMatrixBase.cs b/Sources/Test/SimpleTesting/IngressEgress/FlushPolicyTestMatrixBase.cs index e0af14413..b5fbbc5d6 100644 --- a/Sources/Test/SimpleTesting/IngressEgress/FlushPolicyTestMatrixBase.cs +++ b/Sources/Test/SimpleTesting/IngressEgress/FlushPolicyTestMatrixBase.cs @@ -12,7 +12,7 @@ namespace SimpleTesting.Flush { - public class FlushTestBase : TestWithConfigSettingsAndMemoryLeakDetection + public abstract class FlushTestBase : TestWithConfigSettingsAndMemoryLeakDetection { private const int IntervalLength = 5; private const int BatchSize = 10; // TODO: this will be identical for FlushPolicy.None and FlushOnBatchBoundary without some filter operator @@ -45,7 +45,7 @@ public void FilterTest() query = query.Where(this.FilterExpression); query = query.ClipEventDuration(IntervalLength); - var filtered = qc.RegisterOutput(query).ForEachAsync(o => OnEgress(o)); + var filtered = qc.RegisterOutput(query).ForEachAsync(OnEgress); var process = qc.Restore(); for (int i = 0; i < IngressEventCount; i++) @@ -55,7 +55,7 @@ public void FilterTest() OnIngress(inputSubject, StreamEvent.CreatePunctuation(i)); // Make sure we don't have any pending events we expected to be egressed at this point - Assert.IsTrue(this.expectedOutput.Count == 0); + Assert.IsEmpty(this.expectedOutput); } OnCompleted(inputSubject); @@ -115,7 +115,7 @@ private void MoveFilteredBatchBatchToOutput() private void OnEgress(StreamEvent egressEvent) { - Assert.IsTrue(this.expectedOutput.Count > 0); + Assert.IsNotEmpty(this.expectedOutput); var expectedEvent = this.expectedOutput.Dequeue(); Assert.IsTrue(expectedEvent.Equals(egressEvent)); diff --git a/Sources/Test/SimpleTesting/IngressEgress/IngressAndEgressTests.cs b/Sources/Test/SimpleTesting/IngressEgress/IngressAndEgressTests.cs index 17c35bc6b..10ef8af6c 100644 --- a/Sources/Test/SimpleTesting/IngressEgress/IngressAndEgressTests.cs +++ b/Sources/Test/SimpleTesting/IngressEgress/IngressAndEgressTests.cs @@ -28,7 +28,7 @@ public void Level1InLevel1OutTrivialRow() var input = Enumerable.Range(0, 1000).ToList(); var subject = new Subject(); var prog = subject.ToAtemporalStreamable(TimelinePolicy.Sequence(100)).ToEnumerable(); - input.ForEach(o => subject.OnNext(o)); + input.ForEach(subject.OnNext); subject.OnCompleted(); while (!prog.Completed) { } var output = prog.OrderBy(o => o); @@ -43,8 +43,8 @@ public void Level1InLevel3OutTrivialRow() var subject = new Subject(); var output = new List>(); - var outputAwait = subject.ToAtemporalStreamable(TimelinePolicy.Sequence(100)).ToStreamEventObservable().Where(o => o.IsData).ForEachAsync(o => output.Add(o)); - input.ForEach(o => subject.OnNext(o)); + var outputAwait = subject.ToAtemporalStreamable(TimelinePolicy.Sequence(100)).ToStreamEventObservable().Where(o => o.IsData).ForEachAsync(output.Add); + input.ForEach(subject.OnNext); subject.OnCompleted(); outputAwait.Wait(); @@ -999,7 +999,7 @@ public void Level1InLevel1OutTrivialRowSmallBatch() var input = Enumerable.Range(0, 1000).ToList(); var subject = new Subject(); var prog = subject.ToAtemporalStreamable(TimelinePolicy.Sequence(100)).ToEnumerable(); - input.ForEach(o => subject.OnNext(o)); + input.ForEach(subject.OnNext); subject.OnCompleted(); while (!prog.Completed) { } var output = prog.OrderBy(o => o); @@ -1014,8 +1014,8 @@ public void Level1InLevel3OutTrivialRowSmallBatch() var subject = new Subject(); var output = new List>(); - var outputAwait = subject.ToAtemporalStreamable(TimelinePolicy.Sequence(100)).ToStreamEventObservable().Where(o => o.IsData).ForEachAsync(o => output.Add(o)); - input.ForEach(o => subject.OnNext(o)); + var outputAwait = subject.ToAtemporalStreamable(TimelinePolicy.Sequence(100)).ToStreamEventObservable().Where(o => o.IsData).ForEachAsync(output.Add); + input.ForEach(subject.OnNext); subject.OnCompleted(); outputAwait.Wait(); @@ -1988,7 +1988,7 @@ public void Level1InLevel1OutTrivialColumnar() var input = Enumerable.Range(0, 1000).ToList(); var subject = new Subject(); var prog = subject.ToAtemporalStreamable(TimelinePolicy.Sequence(100)).ToEnumerable(); - input.ForEach(o => subject.OnNext(o)); + input.ForEach(subject.OnNext); subject.OnCompleted(); while (!prog.Completed) { } var output = prog.OrderBy(o => o); @@ -2003,8 +2003,8 @@ public void Level1InLevel3OutTrivialColumnar() var subject = new Subject(); var output = new List>(); - var outputAwait = subject.ToAtemporalStreamable(TimelinePolicy.Sequence(100)).ToStreamEventObservable().Where(o => o.IsData).ForEachAsync(o => output.Add(o)); - input.ForEach(o => subject.OnNext(o)); + var outputAwait = subject.ToAtemporalStreamable(TimelinePolicy.Sequence(100)).ToStreamEventObservable().Where(o => o.IsData).ForEachAsync(output.Add); + input.ForEach(subject.OnNext); subject.OnCompleted(); outputAwait.Wait(); @@ -2959,7 +2959,7 @@ public void Level1InLevel1OutTrivialColumnarSmallBatch() var input = Enumerable.Range(0, 1000).ToList(); var subject = new Subject(); var prog = subject.ToAtemporalStreamable(TimelinePolicy.Sequence(100)).ToEnumerable(); - input.ForEach(o => subject.OnNext(o)); + input.ForEach(subject.OnNext); subject.OnCompleted(); while (!prog.Completed) { } var output = prog.OrderBy(o => o); @@ -2974,8 +2974,8 @@ public void Level1InLevel3OutTrivialColumnarSmallBatch() var subject = new Subject(); var output = new List>(); - var outputAwait = subject.ToAtemporalStreamable(TimelinePolicy.Sequence(100)).ToStreamEventObservable().Where(o => o.IsData).ForEachAsync(o => output.Add(o)); - input.ForEach(o => subject.OnNext(o)); + var outputAwait = subject.ToAtemporalStreamable(TimelinePolicy.Sequence(100)).ToStreamEventObservable().Where(o => o.IsData).ForEachAsync(output.Add); + input.ForEach(subject.OnNext); subject.OnCompleted(); outputAwait.Wait(); diff --git a/Sources/Test/SimpleTesting/Macros/LeftOuterJoinTests.cs b/Sources/Test/SimpleTesting/Macros/LeftOuterJoinTests.cs index 6b778f07d..5133559ec 100644 --- a/Sources/Test/SimpleTesting/Macros/LeftOuterJoinTests.cs +++ b/Sources/Test/SimpleTesting/Macros/LeftOuterJoinTests.cs @@ -86,7 +86,7 @@ public void LOJ1Row() (l, r) => new MyData3 { field1 = l.field1, field2 = l.field2, field3 = r.field3, field4 = r.field4 }); var result = container.RegisterOutput(query, ReshapingPolicy.CoalesceEndEdges).Where(e => e.IsData); - var resultAsync = result.ForEachAsync(o => output.Add(o)); + var resultAsync = result.ForEachAsync(output.Add); container.Restore(null); // start the query Assert.IsTrue(output.ToArray().SequenceEqual(expected)); @@ -148,7 +148,7 @@ public void LOJ1RowSmallBatch() (l, r) => new MyData3 { field1 = l.field1, field2 = l.field2, field3 = r.field3, field4 = r.field4 }); var result = container.RegisterOutput(query, ReshapingPolicy.CoalesceEndEdges).Where(e => e.IsData); - var resultAsync = result.ForEachAsync(o => output.Add(o)); + var resultAsync = result.ForEachAsync(output.Add); container.Restore(null); // start the query Assert.IsTrue(output.ToArray().SequenceEqual(expected)); @@ -209,7 +209,7 @@ public void LOJ1Columnar() (l, r) => new MyData3 { field1 = l.field1, field2 = l.field2, field3 = r.field3, field4 = r.field4 }); var result = container.RegisterOutput(query, ReshapingPolicy.CoalesceEndEdges).Where(e => e.IsData); - var resultAsync = result.ForEachAsync(o => output.Add(o)); + var resultAsync = result.ForEachAsync(output.Add); container.Restore(null); // start the query Assert.IsTrue(output.ToArray().SequenceEqual(expected)); @@ -271,7 +271,7 @@ public void LOJ1ColumnarSmallBatch() (l, r) => new MyData3 { field1 = l.field1, field2 = l.field2, field3 = r.field3, field4 = r.field4 }); var result = container.RegisterOutput(query, ReshapingPolicy.CoalesceEndEdges).Where(e => e.IsData); - var resultAsync = result.ForEachAsync(o => output.Add(o)); + var resultAsync = result.ForEachAsync(output.Add); container.Restore(null); // start the query Assert.IsTrue(output.ToArray().SequenceEqual(expected)); diff --git a/Sources/Test/SimpleTesting/MultiStringTests.cs b/Sources/Test/SimpleTesting/MultiStringTests.cs index 4477d88ec..e6d3b6618 100644 --- a/Sources/Test/SimpleTesting/MultiStringTests.cs +++ b/Sources/Test/SimpleTesting/MultiStringTests.cs @@ -609,11 +609,11 @@ public void MultiStringRegex1() { if ((result.col[i >> 6] & (1L << (i & 0x3f))) == 0) { - Assert.IsTrue(input[i].Contains(pattern)); + Assert.Contains(pattern, input[i]); } else { - Assert.IsFalse(input[i].Contains(pattern)); + Assert.DoesNotContain(pattern, input[i]); } } inBV.ReturnClear(); diff --git a/Sources/Test/SimpleTesting/Partitioned/PartitionedIngressAndEgressTestMatrixBases.cs b/Sources/Test/SimpleTesting/Partitioned/PartitionedIngressAndEgressTestMatrixBases.cs index f84057087..dd6913f43 100644 --- a/Sources/Test/SimpleTesting/Partitioned/PartitionedIngressAndEgressTestMatrixBases.cs +++ b/Sources/Test/SimpleTesting/Partitioned/PartitionedIngressAndEgressTestMatrixBases.cs @@ -11,7 +11,7 @@ namespace SimpleTesting.PartitionedIngressAndEgress { - public class TriPartitionedOrderedTestsBase : TestWithConfigSettingsAndMemoryLeakDetection + public abstract class TriPartitionedOrderedTestsBase : TestWithConfigSettingsAndMemoryLeakDetection { internal TriPartitionedOrderedTestsBase( ConfigModifier config, @@ -86,8 +86,8 @@ private void ValidateOutput(IList input, IList>(); - ingress.GetDroppedAdjustedEventsDiagnostic().Subscribe(o => outOfOrderEvents.Add(o)); + ingress.GetDroppedAdjustedEventsDiagnostic().Subscribe(outOfOrderEvents.Add); var output = new List>(); - var egress = qc.RegisterOutput(ingress).ForEachAsync(o => output.Add(o)); + var egress = qc.RegisterOutput(ingress).ForEachAsync(output.Add); var process = qc.Restore(); process.Flush(); egress.Wait(); diff --git a/Sources/Test/SimpleTesting/Partitioned/PartitionedStreamTests.cs b/Sources/Test/SimpleTesting/Partitioned/PartitionedStreamTests.cs index af8f600b7..1baddac3d 100644 --- a/Sources/Test/SimpleTesting/Partitioned/PartitionedStreamTests.cs +++ b/Sources/Test/SimpleTesting/Partitioned/PartitionedStreamTests.cs @@ -706,7 +706,7 @@ public void SelectManyWithFlush() j.OnNext(x); p.Flush(); - Assert.IsTrue(res.Count > data.Length, "Flush should push all events out."); + Assert.IsGreaterThan(data.Length, res.Count, "Flush should push all events out."); j.OnCompleted(); } @@ -748,7 +748,7 @@ public void AlterLifeTimeWithFlush() { } - Assert.IsTrue(res.Count > 0, "There should be some results."); + Assert.IsNotEmpty(res, "There should be some results."); } [TestMethod, TestCategory("Gated")] @@ -801,7 +801,7 @@ public void AlterLifeTimeWithFlushDoubles() { } - Assert.IsTrue(res.Count > 0, "There should be some results."); + Assert.IsNotEmpty(res, "There should be some results."); } [TestMethod, TestCategory("Gated")] @@ -813,7 +813,7 @@ public void PartitionedStitch() var input = qc.RegisterInput(subject); var output = new List>(); - var egress = qc.RegisterOutput(input.Stitch()).ForEachAsync(o => output.Add(o)); + var egress = qc.RegisterOutput(input.Stitch()).ForEachAsync(output.Add); var process = qc.Restore(); var payload = new[] { "c1payload", "c2payload" }; diff --git a/Sources/Test/SimpleTesting/Program.cs b/Sources/Test/SimpleTesting/Program.cs index 9ee2e4665..ca33fd94f 100644 --- a/Sources/Test/SimpleTesting/Program.cs +++ b/Sources/Test/SimpleTesting/Program.cs @@ -101,16 +101,16 @@ private static void Alpha() var s = x3.ExpressionToCSharp(); } - public static void Main(string[] args) + public static void Main() { Alpha(); var meths = typeof(int).GetMethods(); var x = new { A = 3, B = 'a' }; var y = EqualsExprForAnonymousType(x.GetType()); var z = TestEquality(Enumerable.Range(0, 5), i => new { X = i, Y = (char)('a' + i), }); - z = TestEquality(new int[] { 3, 3, 3 }, i => new { Z = i, A = (char)('a' + i), W = "abc", }); - var ii = TestHash(new int[] { 3, 3, 3 }, i => new { Z = i, A = (char)('a' + i), W = "abc", }); - ii = TestComparer(new int[] { 3, 3, 3 }, i => new { Z = i, A = (char)('a' + i), W = "abc" }); + z = TestEquality([3, 3, 3], i => new { Z = i, A = (char)('a' + i), W = "abc", }); + var ii = TestHash([3, 3, 3], i => new { Z = i, A = (char)('a' + i), W = "abc", }); + ii = TestComparer([3, 3, 3], i => new { Z = i, A = (char)('a' + i), W = "abc" }); NativeMethods.AffinitizeThread(0); Config.ForceRowBasedExecution = true; diff --git a/Sources/Test/SimpleTesting/Serializer/SerializabilityTypeScan.cs b/Sources/Test/SimpleTesting/Serializer/SerializabilityTypeScan.cs index 1af3eaaed..92a410745 100644 --- a/Sources/Test/SimpleTesting/Serializer/SerializabilityTypeScan.cs +++ b/Sources/Test/SimpleTesting/Serializer/SerializabilityTypeScan.cs @@ -174,7 +174,7 @@ private static string DescribeGeneric(string name, IEnumerable args) { if (name.Contains('`')) name = name.Substring(0, name.LastIndexOf('`')); - return name + "<" + string.Join(", ", args.Select(a => DescribeType(a))) + ">"; + return name + "<" + string.Join(", ", args.Select(DescribeType)) + ">"; } private static string DescribeType(Type type) diff --git a/Sources/Test/SimpleTesting/Serializer/SurrogateTests.cs b/Sources/Test/SimpleTesting/Serializer/SurrogateTests.cs index 975e98e97..463c5ab74 100644 --- a/Sources/Test/SimpleTesting/Serializer/SurrogateTests.cs +++ b/Sources/Test/SimpleTesting/Serializer/SurrogateTests.cs @@ -87,7 +87,7 @@ public void SurrogateTest() var input = new Subject>(); var ingress = qc.RegisterInput(input); - var egress = qc.RegisterOutput(ingress).ForEachAsync(o => output1.Add(o)); + var egress = qc.RegisterOutput(ingress).ForEachAsync(output1.Add); var process = qc.Restore(); input.OnNext(StreamEvent.CreatePoint(1, (IMyInterface)new MyType(1))); @@ -103,12 +103,12 @@ public void SurrogateTest() var qc2 = new QueryContainer(new MySurrogate()); var ingress2 = qc2.RegisterInput(input2); - var egress2 = qc2.RegisterOutput(ingress2).ForEachAsync(o => output2.Add(o)); + var egress2 = qc2.RegisterOutput(ingress2).ForEachAsync(output2.Add); var process2 = qc2.Restore(stream); input2.OnCompleted(); - Assert.AreEqual(2, output2.Count); + Assert.HasCount(2, output2); Assert.AreEqual(1, output2[0].Payload.GetValue()); Assert.AreEqual(StreamEvent.InfinitySyncTime, output2[1].SyncTime); } diff --git a/Sources/Test/SimpleTesting/SimpleTesting.csproj b/Sources/Test/SimpleTesting/SimpleTesting.csproj index f1b901102..a41af72f3 100644 --- a/Sources/Test/SimpleTesting/SimpleTesting.csproj +++ b/Sources/Test/SimpleTesting/SimpleTesting.csproj @@ -1,17 +1,16 @@  - net472;netcoreapp3.1 + net10.0 AnyCPU - - - - - - + + + + +