Merge pull request #91 from microsoft/EnableSomeStyleCopRulesForBraces

Enabling StyleCop Rules SA1500, SA1511, SA1519
This commit is contained in:
James Terwilliger 2019-05-17 17:45:55 -07:00 коммит произвёл GitHub
Родитель 207593f9e1 95f645e11e
Коммит 670c46488e
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
63 изменённых файлов: 2422 добавлений и 1248 удалений

Просмотреть файл

@ -3,7 +3,8 @@
<#@ import namespace="System.Text" #>
<#@ import namespace="System.Collections.Generic" #>
<#
var averageTypesToGenerate = new[] {
var averageTypesToGenerate = new[]
{
new { InputTypeFriendlyName = "SByte", TypeName = "sbyte", SumTypeName = "long", ReturnTypeName = "double" },
new { InputTypeFriendlyName = "Short", TypeName = "short", SumTypeName = "long", ReturnTypeName = "double" },
new { InputTypeFriendlyName = "Int", TypeName = "int", SumTypeName = "long", ReturnTypeName = "double" },
@ -19,7 +20,8 @@ var averageTypesToGenerate = new[] {
new { InputTypeFriendlyName = "Complex", TypeName = "Complex", SumTypeName = "Complex", ReturnTypeName = "Complex" }
};
var sumTypesToGenerate = new[] {
var sumTypesToGenerate = new[]
{
new { InputTypeFriendlyName = "SByte", TypeName = "sbyte" },
new { InputTypeFriendlyName = "Byte", TypeName = "byte" },
new { InputTypeFriendlyName = "Short", TypeName = "short" },

Просмотреть файл

@ -25,10 +25,13 @@ namespace Microsoft.StreamProcessing.Aggregates
public Expression<Func<MinMaxState<T>>> InitialState()
=> () => new MinMaxState<T> { currentTimestamp = InvalidSyncTime };
public Expression<Func<MinMaxState<T>, long, T, MinMaxState<T>>> Accumulate()
=> (state, timestamp, input) => new MinMaxState<T> {
currentTimestamp = timestamp,
currentValue = (state.currentTimestamp == InvalidSyncTime || this.comparer(input, state.currentValue) > 0) ? input : state.currentValue };
public Expression<Func<MinMaxState<T>, long, T, MinMaxState<T>>> Accumulate() =>
(state, timestamp, input) =>
new MinMaxState<T>
{
currentTimestamp = timestamp,
currentValue = (state.currentTimestamp == InvalidSyncTime || this.comparer(input, state.currentValue) > 0) ? input : state.currentValue
};
public Expression<Func<MinMaxState<T>, long, T, MinMaxState<T>>> Deaccumulate()
=> (state, timestamp, input) => state; // never invoked, hence not implemented

Просмотреть файл

@ -177,10 +177,10 @@ namespace Microsoft.StreamProcessing
public void Checkpoint(Stream stream) { }
public void Dispose() => throw new NotImplementedException();
public void OnCompleted() => observer.OnCompleted();
public void OnCompleted() => this.observer.OnCompleted();
public void OnError(Exception error) => throw error;
public void OnFlush() => observer.OnNext(new QueuedMessage<StreamMessage<TKey, TPayload>> { Kind = MessageKind.Flush });
public void OnNext(StreamMessage<TKey, TPayload> value) => observer.OnNext(new QueuedMessage<StreamMessage<TKey, TPayload>> { Kind = MessageKind.DataBatch, Message = value });
public void OnFlush() => this.observer.OnNext(new QueuedMessage<StreamMessage<TKey, TPayload>> { Kind = MessageKind.Flush });
public void OnNext(StreamMessage<TKey, TPayload> value) => this.observer.OnNext(new QueuedMessage<StreamMessage<TKey, TPayload>> { Kind = MessageKind.DataBatch, Message = value });
public void ProduceQueryPlan(PlanNode previous) { }
public void Reset() { }
public void Restore(Stream stream) { }

Просмотреть файл

@ -255,8 +255,9 @@ namespace Microsoft.StreamProcessing
public IEnumerator<T> GetEnumerator()
{
foreach (var buffer in this.buffers)
foreach (var item in buffer.Iterate())
yield return item;
{
foreach (var item in buffer.Iterate()) yield return item;
}
}
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() => GetEnumerator();

Просмотреть файл

@ -95,7 +95,8 @@ namespace Microsoft.StreamProcessing.Internal.Collections
index++;
if (index == this.Size) index = 0;
} while (true);
}
while (true);
}
/// <summary>
@ -119,7 +120,8 @@ namespace Microsoft.StreamProcessing.Internal.Collections
index++;
if (index == this.Size) index = 0;
} while (true);
}
while (true);
}
/// <summary>

Просмотреть файл

@ -118,7 +118,8 @@ namespace Microsoft.StreamProcessing.Internal.Collections
index++;
if (index == this.Size)
index = 0;
} while (true);
}
while (true);
}
/// <summary>

Просмотреть файл

@ -87,7 +87,8 @@ namespace Microsoft.StreamProcessing.Internal.Collections
internal static class HashHelpers
{
public static readonly int[] primes = new int[] {
public static readonly int[] primes = new int[]
{
3, 7, 11, 0x11, 0x17, 0x1d, 0x25, 0x2f, 0x3b, 0x47, 0x59, 0x6b, 0x83, 0xa3, 0xc5, 0xef,
0x125, 0x161, 0x1af, 0x209, 0x277, 0x2f9, 0x397, 0x44f, 0x52f, 0x63d, 0x78b, 0x91d, 0xaf1, 0xd2b, 0xfd1, 0x12fd,
0x16cf, 0x1b65, 0x20e3, 0x2777, 0x2f6f, 0x38ff, 0x446f, 0x521f, 0x628d, 0x7655, 0x8e01, 0xaa6b, 0xcc89, 0xf583, 0x126a7, 0x1619b,

Просмотреть файл

@ -248,8 +248,9 @@ namespace Microsoft.StreamProcessing.Internal.Collections
public IEnumerator<T> GetEnumerator()
{
foreach (var buffer in this.buffers)
foreach (var item in buffer.Iterate())
yield return item;
{
foreach (var item in buffer.Iterate()) yield return item;
}
}
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() => GetEnumerator();

Просмотреть файл

@ -41,9 +41,11 @@ namespace Microsoft.StreamProcessing
if (!Config.ForceRowBasedExecution && this.source.Properties.IsColumnar && typeof(TPayload).CanRepresentAsColumnar() && CanGenerateColumnar())
pipe = GetPipe(observer);
else
{
pipe = new StreamEventEgressPipe<TPayload>(
observer,
this.container);
observer,
this.container);
}
if (this.container != null) this.container.RegisterEgressPipe(this.identifier, pipe);
return this.source.Subscribe(pipe);
}
@ -114,10 +116,12 @@ namespace Microsoft.StreamProcessing
if (!Config.ForceRowBasedExecution && this.source.Properties.IsColumnar && typeof(TPayload).CanRepresentAsColumnar() && CanGenerateColumnar())
pipe = GetPipe(observer);
else
{
pipe = new StartEdgeEgressPipe<TPayload, TResult>(
this.constructor,
observer,
this.container);
this.constructor,
observer,
this.container);
}
if (this.container != null) this.container.RegisterEgressPipe(this.identifier, pipe);
return this.source.Subscribe(pipe);
}
@ -180,10 +184,12 @@ namespace Microsoft.StreamProcessing
if (!Config.ForceRowBasedExecution && this.source.Properties.IsColumnar && typeof(TPayload).CanRepresentAsColumnar() && CanGenerateColumnar())
pipe = GetPipe(observer);
else
{
pipe = new IntervalEgressPipe<TPayload, TResult>(
this.constructor,
observer,
this.container);
this.constructor,
observer,
this.container);
}
if (this.container != null) this.container.RegisterEgressPipe(this.identifier, pipe);
return this.source.Subscribe(pipe);
}
@ -243,9 +249,11 @@ namespace Microsoft.StreamProcessing
if (!Config.ForceRowBasedExecution && this.source.Properties.IsColumnar && typeof(TPayload).CanRepresentAsColumnar() && CanGenerateColumnar())
pipe = GetPipe(observer);
else
{
pipe = new PartitionedStreamEventEgressPipe<TKey, TPayload>(
observer,
this.container);
observer,
this.container);
}
if (this.container != null) this.container.RegisterEgressPipe(this.identifier, pipe);
return this.source.Subscribe(pipe);
}
@ -316,10 +324,12 @@ namespace Microsoft.StreamProcessing
if (!Config.ForceRowBasedExecution && this.source.Properties.IsColumnar && typeof(TPayload).CanRepresentAsColumnar() && CanGenerateColumnar())
pipe = GetPipe(observer);
else
{
pipe = new PartitionedStartEdgeEgressPipe<TKey, TPayload, TResult>(
this.constructor,
observer,
this.container);
this.constructor,
observer,
this.container);
}
if (this.container != null) this.container.RegisterEgressPipe(this.identifier, pipe);
return this.source.Subscribe(pipe);
}
@ -382,10 +392,12 @@ namespace Microsoft.StreamProcessing
if (!Config.ForceRowBasedExecution && this.source.Properties.IsColumnar && typeof(TPayload).CanRepresentAsColumnar() && CanGenerateColumnar())
pipe = GetPipe(observer);
else
{
pipe = new PartitionedIntervalEgressPipe<TKey, TPayload, TResult>(
this.constructor,
observer,
this.container);
this.constructor,
observer,
this.container);
}
if (this.container != null) this.container.RegisterEgressPipe(this.identifier, pipe);
return this.source.Subscribe(pipe);
}

Просмотреть файл

@ -78,13 +78,15 @@ foreach (string ingressType in new string[] { "StreamEvent", "StartEdge", "Inter
if (!Config.ForceRowBasedExecution && this.source.Properties.IsColumnar && typeof(TPayload).CanRepresentAsColumnar() && CanGenerateColumnar())
pipe = GetPipe(observer);
else
{
pipe = new <#= partitionString #><#= ingressType #>EgressPipe<<#= genericArguments #><#= argumentSuffix #>>(
<# if (ingressType == "StartEdge" || ingressType == "Interval")
{ #>
this.constructor,
this.constructor,
<# } #>
observer,
this.container);
observer,
this.container);
}
if (this.container != null) this.container.RegisterEgressPipe(this.identifier, pipe);
return this.source.Subscribe(pipe);
}

Просмотреть файл

@ -99,12 +99,15 @@ namespace Microsoft.StreamProcessing
{
var template = new TemporalEgressTemplate(typeof(Empty), typeof(TPayload), typeof(TResult), string.Empty, "StartEdge", startEdgeObservable.source.Properties.IsColumnar);
if (startEdgeObservable.constructor != null)
template.startEdgeFunction = (x, y) => startEdgeObservable.constructor.Body.ExpressionToCSharpStringWithParameterSubstitution(
new Dictionary<ParameterExpression, string>
{
{ startEdgeObservable.constructor.Parameters[0], x },
{ startEdgeObservable.constructor.Parameters[1], y },
});
{
template.startEdgeFunction = (x, y) =>
startEdgeObservable.constructor.Body.ExpressionToCSharpStringWithParameterSubstitution(
new Dictionary<ParameterExpression, string>
{
{ startEdgeObservable.constructor.Parameters[0], x },
{ startEdgeObservable.constructor.Parameters[1], y },
});
}
var keyType = typeof(Empty);
var expandedCode = template.TransformText();
@ -133,13 +136,16 @@ namespace Microsoft.StreamProcessing
{
var template = new TemporalEgressTemplate(typeof(Empty), typeof(TPayload), typeof(TResult), string.Empty, "Interval", intervalObservable.source.Properties.IsColumnar);
if (intervalObservable.constructor != null)
template.intervalFunction = (x, y, z) => intervalObservable.constructor.Body.ExpressionToCSharpStringWithParameterSubstitution(
new Dictionary<ParameterExpression, string>
{
{ intervalObservable.constructor.Parameters[0], x },
{ intervalObservable.constructor.Parameters[1], y },
{ intervalObservable.constructor.Parameters[2], z },
});
{
template.intervalFunction = (x, y, z) =>
intervalObservable.constructor.Body.ExpressionToCSharpStringWithParameterSubstitution(
new Dictionary<ParameterExpression, string>
{
{ intervalObservable.constructor.Parameters[0], x },
{ intervalObservable.constructor.Parameters[1], y },
{ intervalObservable.constructor.Parameters[2], z },
});
}
var keyType = typeof(Empty);
var expandedCode = template.TransformText();
@ -196,13 +202,16 @@ namespace Microsoft.StreamProcessing
{
var template = new TemporalEgressTemplate(typeof(TKey), typeof(TPayload), typeof(TResult), "Partitioned", "StartEdge", partitionedStartEdgeObservable.source.Properties.IsColumnar);
if (partitionedStartEdgeObservable.constructor != null)
template.startEdgeFunction = (x, y) => partitionedStartEdgeObservable.constructor.Body.ExpressionToCSharpStringWithParameterSubstitution(
new Dictionary<ParameterExpression, string>
{
{ partitionedStartEdgeObservable.constructor.Parameters[0], "colkey[i].Key" },
{ partitionedStartEdgeObservable.constructor.Parameters[0], x },
{ partitionedStartEdgeObservable.constructor.Parameters[1], y },
});
{
template.startEdgeFunction = (x, y) =>
partitionedStartEdgeObservable.constructor.Body.ExpressionToCSharpStringWithParameterSubstitution(
new Dictionary<ParameterExpression, string>
{
{ partitionedStartEdgeObservable.constructor.Parameters[0], "colkey[i].Key" },
{ partitionedStartEdgeObservable.constructor.Parameters[0], x },
{ partitionedStartEdgeObservable.constructor.Parameters[1], y },
});
}
var keyType = typeof(PartitionKey<>).MakeGenericType(typeof(TKey));
var expandedCode = template.TransformText();
@ -231,14 +240,17 @@ namespace Microsoft.StreamProcessing
{
var template = new TemporalEgressTemplate(typeof(TKey), typeof(TPayload), typeof(TResult), "Partitioned", "Interval", partitionedIntervalObservable.source.Properties.IsColumnar);
if (partitionedIntervalObservable.constructor != null)
template.intervalFunction = (x, y, z) => partitionedIntervalObservable.constructor.Body.ExpressionToCSharpStringWithParameterSubstitution(
new Dictionary<ParameterExpression, string>
{
{ partitionedIntervalObservable.constructor.Parameters[0], "colkey[i].Key" },
{ partitionedIntervalObservable.constructor.Parameters[0], x },
{ partitionedIntervalObservable.constructor.Parameters[1], y },
{ partitionedIntervalObservable.constructor.Parameters[2], z },
});
{
template.intervalFunction = (x, y, z) =>
partitionedIntervalObservable.constructor.Body.ExpressionToCSharpStringWithParameterSubstitution(
new Dictionary<ParameterExpression, string>
{
{ partitionedIntervalObservable.constructor.Parameters[0], "colkey[i].Key" },
{ partitionedIntervalObservable.constructor.Parameters[0], x },
{ partitionedIntervalObservable.constructor.Parameters[1], y },
{ partitionedIntervalObservable.constructor.Parameters[2], z },
});
}
var keyType = typeof(PartitionKey<>).MakeGenericType(typeof(TKey));
var expandedCode = template.TransformText();

Просмотреть файл

@ -114,12 +114,15 @@ namespace Microsoft.StreamProcessing
{
var template = new TemporalArrayEgressTemplate(typeof(Empty), typeof(TPayload), typeof(TResult), string.Empty, "StartEdge", startEdgeObservable.source.Properties.IsColumnar);
if (startEdgeObservable.constructor != null)
template.startEdgeFunction = (x, y) => startEdgeObservable.constructor.Body.ExpressionToCSharpStringWithParameterSubstitution(
new Dictionary<ParameterExpression, string>
{
{ startEdgeObservable.constructor.Parameters[0], x },
{ startEdgeObservable.constructor.Parameters[1], y },
});
{
template.startEdgeFunction = (x, y) =>
startEdgeObservable.constructor.Body.ExpressionToCSharpStringWithParameterSubstitution(
new Dictionary<ParameterExpression, string>
{
{ startEdgeObservable.constructor.Parameters[0], x },
{ startEdgeObservable.constructor.Parameters[1], y },
});
}
var keyType = typeof(Empty);
var expandedCode = template.TransformText();
@ -159,13 +162,16 @@ namespace Microsoft.StreamProcessing
{
var template = new TemporalArrayEgressTemplate(typeof(Empty), typeof(TPayload), typeof(TResult), string.Empty, "Interval", intervalObservable.source.Properties.IsColumnar);
if (intervalObservable.constructor != null)
template.intervalFunction = (x, y, z) => intervalObservable.constructor.Body.ExpressionToCSharpStringWithParameterSubstitution(
new Dictionary<ParameterExpression, string>
{
{ intervalObservable.constructor.Parameters[0], x },
{ intervalObservable.constructor.Parameters[1], y },
{ intervalObservable.constructor.Parameters[2], z },
});
{
template.intervalFunction = (x, y, z) =>
intervalObservable.constructor.Body.ExpressionToCSharpStringWithParameterSubstitution(
new Dictionary<ParameterExpression, string>
{
{ intervalObservable.constructor.Parameters[0], x },
{ intervalObservable.constructor.Parameters[1], y },
{ intervalObservable.constructor.Parameters[2], z },
});
}
var keyType = typeof(Empty);
var expandedCode = template.TransformText();
@ -244,13 +250,16 @@ namespace Microsoft.StreamProcessing
{
var template = new TemporalArrayEgressTemplate(typeof(TKey), typeof(TPayload), typeof(TResult), "Partitioned", "StartEdge", partitionedStartEdgeObservable.source.Properties.IsColumnar);
if (partitionedStartEdgeObservable.constructor != null)
template.startEdgeFunction = (x, y) => partitionedStartEdgeObservable.constructor.Body.ExpressionToCSharpStringWithParameterSubstitution(
new Dictionary<ParameterExpression, string>
{
{ partitionedStartEdgeObservable.constructor.Parameters[0], "colkey[i].Key" },
{ partitionedStartEdgeObservable.constructor.Parameters[0], x },
{ partitionedStartEdgeObservable.constructor.Parameters[1], y },
});
{
template.startEdgeFunction = (x, y) =>
partitionedStartEdgeObservable.constructor.Body.ExpressionToCSharpStringWithParameterSubstitution(
new Dictionary<ParameterExpression, string>
{
{ partitionedStartEdgeObservable.constructor.Parameters[0], "colkey[i].Key" },
{ partitionedStartEdgeObservable.constructor.Parameters[0], x },
{ partitionedStartEdgeObservable.constructor.Parameters[1], y },
});
}
var keyType = typeof(PartitionKey<>).MakeGenericType(typeof(TKey));
var expandedCode = template.TransformText();
@ -290,14 +299,17 @@ namespace Microsoft.StreamProcessing
{
var template = new TemporalArrayEgressTemplate(typeof(TKey), typeof(TPayload), typeof(TResult), "Partitioned", "Interval", partitionedIntervalObservable.source.Properties.IsColumnar);
if (partitionedIntervalObservable.constructor != null)
template.intervalFunction = (x, y, z) => partitionedIntervalObservable.constructor.Body.ExpressionToCSharpStringWithParameterSubstitution(
new Dictionary<ParameterExpression, string>
{
{ partitionedIntervalObservable.constructor.Parameters[0], "colkey[i].Key" },
{ partitionedIntervalObservable.constructor.Parameters[0], x },
{ partitionedIntervalObservable.constructor.Parameters[1], y },
{ partitionedIntervalObservable.constructor.Parameters[2], z },
});
{
template.intervalFunction = (x, y, z) =>
partitionedIntervalObservable.constructor.Body.ExpressionToCSharpStringWithParameterSubstitution(
new Dictionary<ParameterExpression, string>
{
{ partitionedIntervalObservable.constructor.Parameters[0], "colkey[i].Key" },
{ partitionedIntervalObservable.constructor.Parameters[0], x },
{ partitionedIntervalObservable.constructor.Parameters[1], y },
{ partitionedIntervalObservable.constructor.Parameters[2], z },
});
}
var keyType = typeof(PartitionKey<>).MakeGenericType(typeof(TKey));
var expandedCode = template.TransformText();

Просмотреть файл

@ -38,11 +38,14 @@ namespace Microsoft.StreamProcessing
{
if (this.expressions.Count == 0)
{
this.expressions.Add(new ExpressionProfile {
category = ExpressionCategory.Select,
inputType = typeof(TPayload),
outputType = typeof(TResult),
expression = selector });
this.expressions.Add(
new ExpressionProfile
{
category = ExpressionCategory.Select,
inputType = typeof(TPayload),
outputType = typeof(TResult),
expression = selector
});
return this;
}
var prev = this.expressions[this.expressions.Count - 1];
@ -76,12 +79,15 @@ namespace Microsoft.StreamProcessing
{
if (this.expressions.Count == 0)
{
this.expressions.Add(new ExpressionProfile {
category = ExpressionCategory.Select,
hasStartEdge = true,
inputType = typeof(TPayload),
outputType = typeof(TResult),
expression = selector });
this.expressions.Add(
new ExpressionProfile
{
category = ExpressionCategory.Select,
hasStartEdge = true,
inputType = typeof(TPayload),
outputType = typeof(TResult),
expression = selector
});
return this;
}
var prev = this.expressions[this.expressions.Count - 1];
@ -120,13 +126,16 @@ namespace Microsoft.StreamProcessing
{
if (this.expressions.Count == 0)
{
this.expressions.Add(new ExpressionProfile {
category = ExpressionCategory.Select,
hasKey = true,
keyType = typeof(TKey),
inputType = typeof(TPayload),
outputType = typeof(TResult),
expression = selector });
this.expressions.Add(
new ExpressionProfile
{
category = ExpressionCategory.Select,
hasKey = true,
keyType = typeof(TKey),
inputType = typeof(TPayload),
outputType = typeof(TResult),
expression = selector
});
return this;
}
var prev = this.expressions[this.expressions.Count - 1];
@ -494,13 +503,16 @@ namespace Microsoft.StreamProcessing
public override string ToString()
{
string output = string.Empty;
foreach (var item in this.expressions) output = output
foreach (var item in this.expressions)
{
output = output
+ "Category:" + item.category.ToString() + ":"
+ "KeyType:" + (item.keyType?.ToString() ?? "null") + ":"
+ "OutputType:" + (item.outputType?.ToString() ?? "null") + ":"
+ "UsesKey:" + item.hasKey.ToString() + ":"
+ "UsesStartEdge:" + item.hasStartEdge.ToString() + ":"
+ "Expression:" + item.expression.ExpressionToCSharp() + Environment.NewLine;
}
if (this.durationAdjustment != null) output = output + "Duration:" + this.durationAdjustment + Environment.NewLine;
return output;
}
@ -610,7 +622,9 @@ namespace Microsoft.StreamProcessing
}
}
if (this.durationAdjustment != null) currentStatement = Expression.Block(Expression.IfThen(
if (this.durationAdjustment != null)
{
currentStatement = Expression.Block(Expression.IfThen(
Expression.GreaterThan(otherParam, syncParam),
Expression.Block(
Expression.Assign(
@ -618,12 +632,14 @@ namespace Microsoft.StreamProcessing
this.durationAdjustment.ExpressionEquals(Expression.Constant(StreamEvent.InfinitySyncTime))
? this.durationAdjustment
: Expression.Add(syncParam, this.durationAdjustment)), currentStatement)));
if (canBePunctuation) currentStatement = Expression.Block(Expression.IfThenElse(
Expression.Equal(otherParam, Expression.Constant(long.MinValue)),
ParameterSubstituter.Replace(action.Parameters[2], Expression.Constant(default(TResult), typeof(TResult)), action.Body),
currentStatement));
}
if (canBePunctuation)
{
currentStatement = Expression.Block(Expression.IfThenElse(
Expression.Equal(otherParam, Expression.Constant(long.MinValue)),
ParameterSubstituter.Replace(action.Parameters[2], Expression.Constant(default(TResult), typeof(TResult)), action.Body),
currentStatement));
}
return Expression.Lambda<Action<long, long, TPayload, TKey>>(currentStatement, syncParam, otherParam, parameter, keyParam);
}

Просмотреть файл

@ -41,8 +41,12 @@ namespace Microsoft.StreamProcessing
int n = value.Count + value.Offset;
// Sanity check
if (n > value.Array.Length) throw new IngressException(
$"Invalid array segment. Offset: {value.Offset} Count: {value.Count} Length: {value.Array.Length}");
if (n > value.Array.Length)
{
throw new IngressException(
$"Invalid array segment. Offset: {value.Offset} Count: {value.Count} Length: {value.Array.Length}");
}
int offset = value.Offset;
while (offset < n)
@ -104,8 +108,12 @@ namespace Microsoft.StreamProcessing
int n = value.Count + value.Offset;
// Sanity check
if (n > value.Array.Length) throw new IngressException(
$"Invalid array segment. Offset: {value.Offset} Count: {value.Count} Length: {value.Array.Length}");
if (n > value.Array.Length)
{
throw new IngressException(
$"Invalid array segment. Offset: {value.Offset} Count: {value.Count} Length: {value.Array.Length}");
}
int offset = value.Offset;
while (offset < n)

Просмотреть файл

@ -64,8 +64,12 @@ namespace Microsoft.StreamProcessing
int n = value.Count + value.Offset;
// Sanity check
if (n > value.Array.Length) throw new IngressException(
$"Invalid array segment. Offset: {value.Offset} Count: {value.Count} Length: {value.Array.Length}");
if (n > value.Array.Length)
{
throw new IngressException(
$"Invalid array segment. Offset: {value.Offset} Count: {value.Count} Length: {value.Array.Length}");
}
int offset = value.Offset;
while (offset < n)

Просмотреть файл

@ -280,11 +280,12 @@ namespace Microsoft.StreamProcessing.Internal
[EditorBrowsable(EditorBrowsableState.Never)]
public void Dispose()
{
foreach (var f in this.Fibers)
f.Dispose();
foreach (var f in this.Fibers) f.Dispose();
for (int i = 0; i < this.MergeSource.Length; i++)
if (this.MergeSource[i] != null)
this.MergeSource[i].Dispose();
{
if (this.MergeSource[i] != null) this.MergeSource[i].Dispose();
}
this.ecbPool.Dispose();
}
}
@ -686,11 +687,13 @@ namespace Microsoft.StreamProcessing.Internal
[EditorBrowsable(EditorBrowsableState.Never)]
public void Dispose()
{
foreach (var f in this.Fibers)
f.Dispose();
foreach (var f in this.Fibers) f.Dispose();
for (int i = 0; i < this.MergeSource.Length; i++)
if (this.MergeSource[i] != null)
this.MergeSource[i].Dispose();
{
if (this.MergeSource[i] != null) this.MergeSource[i].Dispose();
}
this.ecbPool.Dispose();
}
}

Просмотреть файл

@ -145,10 +145,12 @@ namespace Microsoft.StreamProcessing
int n = value.Count + value.Offset;
// Sanity check
if (n > value.Array.Length) throw new IngressException(
$"Invalid array segment. Offset: {value.Offset} Count: {value.Count} Length: {value.Array.Length}");
if (n > value.Array.Length)
{
throw new IngressException(
$"Invalid array segment. Offset: {value.Offset} Count: {value.Count} Length: {value.Array.Length}");
}
int offset = value.Offset;
while (offset < n)
{
var full = this.currentBatch.Add(
@ -229,10 +231,12 @@ namespace Microsoft.StreamProcessing
int n = value.Count + value.Offset;
// Sanity check
if (n > value.Array.Length) throw new IngressException(
$"Invalid array segment. Offset: {value.Offset} Count: {value.Count} Length: {value.Array.Length}");
if (n > value.Array.Length)
{
throw new IngressException(
$"Invalid array segment. Offset: {value.Offset} Count: {value.Count} Length: {value.Array.Length}");
}
int offset = value.Offset;
while (offset < n)
{
var full = this.currentBatch.Add(
@ -296,10 +300,12 @@ namespace Microsoft.StreamProcessing
int n = value.Count + value.Offset;
// Sanity check
if (n > value.Array.Length) throw new IngressException(
$"Invalid array segment. Offset: {value.Offset} Count: {value.Count} Length: {value.Array.Length}");
if (n > value.Array.Length)
{
throw new IngressException(
$"Invalid array segment. Offset: {value.Offset} Count: {value.Count} Length: {value.Array.Length}");
}
int offset = value.Offset;
while (offset < n)
{
var full = this.currentBatch.Add(
@ -379,8 +385,11 @@ namespace Microsoft.StreamProcessing
int n = value.Count + value.Offset;
// Sanity check
if (n > value.Array.Length) throw new IngressException(
$"Invalid array segment. Offset: {value.Offset} Count: {value.Count} Length: {value.Array.Length}");
if (n > value.Array.Length)
{
throw new IngressException(
$"Invalid array segment. Offset: {value.Offset} Count: {value.Count} Length: {value.Array.Length}");
}
int offset = value.Offset;
while (offset < n)

Просмотреть файл

@ -92,9 +92,12 @@ namespace Microsoft.StreamProcessing
? GetUngroupedDAfaPipe(emptyObserver) as IStreamObserver<TKey, TPayload>
: new CompiledUngroupedDAfaPipe<TPayload, TRegister, TAccumulator>(downcast, observer as IStreamObserver<Empty, TRegister>, this.afa, this.MaxDuration) as IStreamObserver<TKey, TPayload>;
}
else return this.Source.Properties.IsColumnar
? GetUngroupedAFAPipe(emptyObserver) as IStreamObserver<TKey, TPayload>
: new CompiledUngroupedAfaPipe<TPayload, TRegister, TAccumulator>(downcast, observer as IStreamObserver<Empty, TRegister>, this.afa, this.MaxDuration) as IStreamObserver<TKey, TPayload>;
else
{
return this.Source.Properties.IsColumnar
? GetUngroupedAFAPipe(emptyObserver) as IStreamObserver<TKey, TPayload>
: new CompiledUngroupedAfaPipe<TPayload, TRegister, TAccumulator>(downcast, observer as IStreamObserver<Empty, TRegister>, this.afa, this.MaxDuration) as IStreamObserver<TKey, TPayload>;
}
}
else
{

Просмотреть файл

@ -165,7 +165,7 @@ namespace Microsoft.StreamProcessing
toState = to,
Initialize = mearc.Initialize != null
? mearc.Initialize.Compile()
: defaultAccumulator == default
: this.defaultAccumulator == default
? (ts, reg) => default // To avoid a closure
: (Func<long, TRegister, TAccumulator>)((ts, reg) => this.defaultAccumulator),
Accumulate = mearc.Accumulate != null ? mearc.Accumulate.Compile() : (ts, ev, reg, acc) => acc,
@ -176,9 +176,12 @@ namespace Microsoft.StreamProcessing
arcType = mearc.ArcType
};
for (int i = 0; i < this.numStartStates; i++)
{
if (from == this.startStates[i])
{
this.multiEventStateMap[from][multiEventCount].fromStartState = true;
}
}
multiEventCount++;
break;
case ArcType.ListElement:

Просмотреть файл

@ -410,8 +410,9 @@ namespace Microsoft.StreamProcessing
result.AddArc(from, to, kvp2.Value);
if (nextPattern.finalStates.Contains(kvp2.Key))
if (!result.finalStates.Contains(to))
result.finalStates.Add(to);
{
if (!result.finalStates.Contains(to)) result.finalStates.Add(to);
}
}
}
}

Просмотреть файл

@ -71,17 +71,26 @@ namespace Microsoft.StreamProcessing
{
var iter = FastDictionary<TPartitionKey, long>.IteratorStart;
while (this.lastSync.Iterate(ref iter))
if (this.lastSync.entries[iter].value < vsync[i])
this.lastSync.entries[iter].value = Math.Max(vsync[i], this.lastSync.entries[iter].value);
{
if (this.lastSync.entries[iter].value < vsync[i])
{
this.lastSync.entries[iter].value = Math.Max(vsync[i], this.lastSync.entries[iter].value);
}
}
}
else if (vother[i] == PartitionedStreamEvent.PunctuationOtherTime)
{
partition = batch.key.col[i].Key;
if (this.startTimeSelector != null) vsync[i] = this.startTimeSelectorCompiled(partition, vsync[i]);
if (this.lastSync.Lookup(partition, out index))
{
this.lastSync.entries[index].value = Math.Max(vsync[i], this.lastSync.entries[index].value);
}
else
{
this.lastSync.Insert(ref index, partition, vsync[i]);
}
}
continue;
}

Просмотреть файл

@ -134,8 +134,11 @@ namespace Microsoft.StreamProcessing
this.leftQueue.Insert(pKey, new Queue<LEntry>());
this.rightQueue.Insert(pKey, new Queue<REntry>());
if (!this.partitionData.Lookup(pKey, out int index)) this.partitionData.Insert(
ref index, pKey, new PartitionEntry { endPointHeap = this.endpointGenerator(), key = pKey });
if (!this.partitionData.Lookup(pKey, out int index))
{
this.partitionData.Insert(
ref index, pKey, new PartitionEntry { endPointHeap = this.endpointGenerator(), key = pKey });
}
}
protected override void ProcessBothBatches(StreamMessage<TKey, TLeft> leftBatch, StreamMessage<TKey, TRight> rightBatch, out bool leftBatchDone, out bool rightBatchDone, out bool leftBatchFree, out bool rightBatchFree)

Просмотреть файл

@ -133,8 +133,11 @@ namespace Microsoft.StreamProcessing
this.leftQueue.Insert(pKey, new Queue<LEntry>());
this.rightQueue.Insert(pKey, new Queue<REntry>());
if (!this.partitionData.Lookup(pKey, out int index)) this.partitionData.Insert(
ref index, pKey, new PartitionEntry { endPointHeap = this.endpointGenerator(), key = pKey });
if (!this.partitionData.Lookup(pKey, out int index))
{
this.partitionData.Insert(
ref index, pKey, new PartitionEntry { endPointHeap = this.endpointGenerator(), key = pKey });
}
}
protected override void ProcessBothBatches(StreamMessage<CompoundGroupKey<PartitionKey<TPartitionKey>, TGroupKey>, TLeft> leftBatch, StreamMessage<CompoundGroupKey<PartitionKey<TPartitionKey>, TGroupKey>, TRight> rightBatch, out bool leftBatchDone, out bool rightBatchDone, out bool leftBatchFree, out bool rightBatchFree)

Просмотреть файл

@ -131,10 +131,13 @@ namespace Microsoft.StreamProcessing
this.leftQueue.Insert(pKey, new Queue<LEntry>());
this.rightQueue.Insert(pKey, new Queue<REntry>());
if (!this.partitionData.Lookup(pKey, out int index)) this.partitionData.Insert(
ref index,
pKey,
new PartitionEntry { endPointHeap = this.endpointGenerator(), key = pKey, hash = hash });
if (!this.partitionData.Lookup(pKey, out int index))
{
this.partitionData.Insert(
ref index,
pKey,
new PartitionEntry { endPointHeap = this.endpointGenerator(), key = pKey, hash = hash });
}
}
protected override void ProcessBothBatches(StreamMessage<PartitionKey<TPartitionKey>, TLeft> leftBatch, StreamMessage<PartitionKey<TPartitionKey>, TRight> rightBatch, out bool leftBatchDone, out bool rightBatchDone, out bool leftBatchFree, out bool rightBatchFree)

Просмотреть файл

@ -78,19 +78,24 @@ namespace Microsoft.StreamProcessing
{
// Simple case: key type is a simple partition key
if (typeof(TKey).GetGenericTypeDefinition() == typeof(PartitionKey<>))
{
return typeof(PartitionedEquiJoinPipeSimple<,,,>).MakeGenericType(
typeof(TLeft),
typeof(TRight),
typeof(TResult),
typeof(TKey).GetPartitionType());
}
// Middle case: type is one level of grouping, e.g., TKey = CompoundGroupKey<PartitionKey<TP>, TG>
if (typeof(TKey).GenericTypeArguments[0].GetGenericTypeDefinition() == typeof(PartitionKey<>))
{
return typeof(PartitionedEquiJoinPipeCompound<,,,,>).MakeGenericType(
typeof(TKey).GenericTypeArguments[1],
typeof(TLeft),
typeof(TRight),
typeof(TResult),
typeof(TKey).GetPartitionType());
}
// Generic case
return typeof(PartitionedEquiJoinPipe<,,,,>).MakeGenericType(
typeof(TKey),
@ -104,19 +109,25 @@ namespace Microsoft.StreamProcessing
{
// Simple case: key type is a simple partition key
if (typeof(TKey).GetGenericTypeDefinition() == typeof(PartitionKey<>))
{
return typeof(PartitionedFixedIntervalEquiJoinPipeSimple<,,,>).MakeGenericType(
typeof(TLeft),
typeof(TRight),
typeof(TResult),
typeof(TKey).GetPartitionType());
}
// Middle case: type is one level of grouping, e.g., TKey = CompoundGroupKey<PartitionKey<TP>, TG>
if (typeof(TKey).GenericTypeArguments[0].GetGenericTypeDefinition() == typeof(PartitionKey<>))
{
return typeof(PartitionedFixedIntervalEquiJoinPipeCompound<,,,,>).MakeGenericType(
typeof(TKey).GenericTypeArguments[1],
typeof(TLeft),
typeof(TRight),
typeof(TResult),
typeof(TKey).GetPartitionType());
}
// Generic case
return typeof(PartitionedFixedIntervalEquiJoinPipe<,,,,>).MakeGenericType(
typeof(TKey),

Просмотреть файл

@ -99,13 +99,17 @@ namespace Microsoft.StreamProcessing
{
UpdateTime(this.nextLeftTime);
if (leftBatch.vother.col[leftBatch.iter] == StreamEvent.PunctuationOtherTime)
{
AddPunctuationToBatch(this.nextLeftTime);
}
else
{
ProcessLeftEvent(
this.nextLeftTime,
ref leftBatch.key.col[leftBatch.iter],
leftBatch[leftBatch.iter],
leftBatch.hash.col[leftBatch.iter]);
}
leftBatch.iter++;
@ -122,13 +126,17 @@ namespace Microsoft.StreamProcessing
{
UpdateTime(this.nextRightTime);
if (rightBatch.vother.col[rightBatch.iter] == StreamEvent.PunctuationOtherTime)
{
AddPunctuationToBatch(this.nextRightTime);
}
else
{
ProcessRightEvent(
this.nextRightTime,
ref rightBatch.key.col[rightBatch.iter],
rightBatch[rightBatch.iter],
rightBatch.hash.col[rightBatch.iter]);
}
rightBatch.iter++;
@ -167,13 +175,17 @@ namespace Microsoft.StreamProcessing
UpdateTime(this.nextLeftTime);
if (batch.vother.col[batch.iter] == StreamEvent.PunctuationOtherTime)
{
AddPunctuationToBatch(this.nextLeftTime);
}
else
{
ProcessLeftEvent(
this.nextLeftTime,
ref batch.key.col[batch.iter],
batch[batch.iter],
batch.hash.col[batch.iter]);
}
batch.iter++;
}
@ -202,13 +214,17 @@ namespace Microsoft.StreamProcessing
UpdateTime(this.nextRightTime);
if (batch.vother.col[batch.iter] == StreamEvent.PunctuationOtherTime)
{
AddPunctuationToBatch(this.nextRightTime);
}
else
{
ProcessRightEvent(
this.nextRightTime,
ref batch.key.col[batch.iter],
batch[batch.iter],
batch.hash.col[batch.iter]);
}
batch.iter++;
}
@ -311,8 +327,8 @@ namespace Microsoft.StreamProcessing
var rin = this.rightIntervalMap.Values[index];
if (this.keyComparerEquals(key, rin.Key))
{
long leftEnd = currentTime + leftDuration;
long rightEnd = rin.Start + rightDuration;
long leftEnd = currentTime + this.leftDuration;
long rightEnd = rin.Start + this.rightDuration;
AddToBatch(
currentTime,
leftEnd < rightEnd ? leftEnd : rightEnd,
@ -334,8 +350,8 @@ namespace Microsoft.StreamProcessing
var lin = this.leftIntervalMap.Values[index];
if (this.keyComparerEquals(key, lin.Key))
{
long rightEnd = currentTime + rightDuration;
long leftEnd = lin.Start + leftDuration;
long rightEnd = currentTime + this.rightDuration;
long leftEnd = lin.Start + this.leftDuration;
AddToBatch(
currentTime,
rightEnd < leftEnd ? rightEnd : leftEnd,

Просмотреть файл

@ -87,8 +87,11 @@ namespace Microsoft.StreamProcessing
this.leftQueue.Insert(pKey, new Queue<LEntry>());
this.rightQueue.Insert(pKey, new Queue<REntry>());
if (!this.partitionData.Lookup(pKey, out int index)) this.partitionData.Insert(
ref index, pKey, new PartitionEntry { key = pKey });
if (!this.partitionData.Lookup(pKey, out int index))
{
this.partitionData.Insert(
ref index, pKey, new PartitionEntry { key = pKey });
}
}
protected override void ProcessBothBatches(StreamMessage<TKey, TLeft> leftBatch, StreamMessage<TKey, TRight> rightBatch, out bool leftBatchDone, out bool rightBatchDone, out bool leftBatchFree, out bool rightBatchFree)
@ -457,8 +460,8 @@ namespace Microsoft.StreamProcessing
{
if (this.keyComparerEquals(key, partition.rightIntervalMap.Values[index].Key))
{
long leftEnd = currentTime + leftDuration;
long rightEnd = partition.rightIntervalMap.Values[index].Start + rightDuration;
long leftEnd = currentTime + this.leftDuration;
long rightEnd = partition.rightIntervalMap.Values[index].Start + this.rightDuration;
AddToBatch(
currentTime,
leftEnd < rightEnd ? leftEnd : rightEnd,
@ -479,8 +482,8 @@ namespace Microsoft.StreamProcessing
{
if (this.keyComparerEquals(key, partition.leftIntervalMap.Values[index].Key))
{
long rightEnd = currentTime + rightDuration;
long leftEnd = partition.leftIntervalMap.Values[index].Start + rightDuration;
long rightEnd = currentTime + this.rightDuration;
long leftEnd = partition.leftIntervalMap.Values[index].Start + this.rightDuration;
AddToBatch(
currentTime,
rightEnd < leftEnd ? rightEnd : leftEnd,

Просмотреть файл

@ -86,8 +86,11 @@ namespace Microsoft.StreamProcessing
this.leftQueue.Insert(pKey, new Queue<LEntry>());
this.rightQueue.Insert(pKey, new Queue<REntry>());
if (!this.partitionData.Lookup(pKey, out int index)) this.partitionData.Insert(
ref index, pKey, new PartitionEntry { key = pKey });
if (!this.partitionData.Lookup(pKey, out int index))
{
this.partitionData.Insert(
ref index, pKey, new PartitionEntry { key = pKey });
}
}
protected override void ProcessBothBatches(StreamMessage<CompoundGroupKey<PartitionKey<TPartitionKey>, TGroupKey>, TLeft> leftBatch, StreamMessage<CompoundGroupKey<PartitionKey<TPartitionKey>, TGroupKey>, TRight> rightBatch, out bool leftBatchDone, out bool rightBatchDone, out bool leftBatchFree, out bool rightBatchFree)
@ -461,8 +464,8 @@ namespace Microsoft.StreamProcessing
{
if (this.keyComparerEquals(key, partition.rightIntervalMap.Values[index].Key))
{
long leftEnd = currentTime + leftDuration;
long rightEnd = partition.rightIntervalMap.Values[index].Start + rightDuration;
long leftEnd = currentTime + this.leftDuration;
long rightEnd = partition.rightIntervalMap.Values[index].Start + this.rightDuration;
AddToBatch(
currentTime,
leftEnd < rightEnd ? leftEnd : rightEnd,
@ -484,8 +487,8 @@ namespace Microsoft.StreamProcessing
{
if (this.keyComparerEquals(key, partition.leftIntervalMap.Values[index].Key))
{
long rightEnd = currentTime + rightDuration;
long leftEnd = partition.leftIntervalMap.Values[index].Start + leftDuration;
long rightEnd = currentTime + this.rightDuration;
long leftEnd = partition.leftIntervalMap.Values[index].Start + this.leftDuration;
AddToBatch(
currentTime,
rightEnd < leftEnd ? rightEnd : leftEnd,

Просмотреть файл

@ -84,10 +84,13 @@ namespace Microsoft.StreamProcessing
this.leftQueue.Insert(pKey, new Queue<LEntry>());
this.rightQueue.Insert(pKey, new Queue<REntry>());
if (!this.partitionData.Lookup(pKey, out int index)) this.partitionData.Insert(
ref index,
pKey,
new PartitionEntry { key = pKey, hash = hash });
if (!this.partitionData.Lookup(pKey, out int index))
{
this.partitionData.Insert(
ref index,
pKey,
new PartitionEntry { key = pKey, hash = hash });
}
}
protected override void ProcessBothBatches(StreamMessage<PartitionKey<TPartitionKey>, TLeft> leftBatch, StreamMessage<PartitionKey<TPartitionKey>, TRight> rightBatch, out bool leftBatchDone, out bool rightBatchDone, out bool leftBatchFree, out bool rightBatchFree)
@ -435,8 +438,8 @@ namespace Microsoft.StreamProcessing
var intervals = partition.rightIntervalMap.Find(partition.hash);
while (intervals.Next(out var index))
{
long leftEnd = currentTime + leftDuration;
long rightEnd = partition.rightIntervalMap.Values[index].Start + rightDuration;
long leftEnd = currentTime + this.leftDuration;
long rightEnd = partition.rightIntervalMap.Values[index].Start + this.rightDuration;
AddToBatch(
currentTime,
leftEnd < rightEnd ? leftEnd : rightEnd,
@ -453,8 +456,8 @@ namespace Microsoft.StreamProcessing
var intervals = partition.leftIntervalMap.Find(partition.hash);
while (intervals.Next(out var index))
{
long rightEnd = currentTime + rightDuration;
long leftEnd = partition.leftIntervalMap.Values[index].Start + leftDuration;
long rightEnd = currentTime + this.rightDuration;
long leftEnd = partition.leftIntervalMap.Values[index].Start + this.leftDuration;
AddToBatch(
currentTime,
rightEnd < leftEnd ? rightEnd : leftEnd,

Просмотреть файл

@ -252,10 +252,14 @@ namespace Microsoft.StreamProcessing
int iter = FastDictionary<TKey, long>.IteratorStart;
var temp = new List<Tuple<TKey, long, TPartitionKey>>();
while (this.lastDataTimeDictionary.Iterate(ref iter))
{
if (this.stateDictionary.entries[iter].value.Any())
{
temp.Add(Tuple.Create(
this.lastDataTimeDictionary.entries[iter].key,
Math.Min(this.lastDataTimeDictionary.entries[iter].value + this.sessionTimeout, this.windowEndTimeDictionary.entries[iter].value), this.getPartitionKey(this.lastDataTimeDictionary.entries[iter].key)));
}
}
foreach (var item in temp.OrderBy(o => o.Item2))
{
if (!this.orderedKeysDictionary.TryGetValue(item.Item3, out var orderedKeys))

Просмотреть файл

@ -222,10 +222,14 @@ namespace Microsoft.StreamProcessing
int iter = FastDictionary<TKey, long>.IteratorStart;
var temp = new List<Tuple<TKey, long>>();
while (this.lastDataTimeDictionary.Iterate(ref iter))
{
if (this.stateDictionary.entries[iter].value.Any())
{
temp.Add(Tuple.Create(
this.windowEndTimeDictionary.entries[iter].key,
Math.Min(this.lastDataTimeDictionary.entries[iter].value + this.sessionTimeout, this.windowEndTimeDictionary.entries[iter].value)));
}
}
foreach (var item in temp.OrderBy(o => o.Item2)) this.orderedKeys.AddLast(new LinkedListNode<TKey>(item.Item1));
base.UpdatePointers();
}

Просмотреть файл

@ -413,9 +413,9 @@ namespace Microsoft.StreamProcessing
{
var iterator = FastDictionary2<TPayload, ActiveEvent>.IteratorStart;
while (closed.Value.Iterate(ref iterator))
foreach (var v in closed.Value.entries[iterator].value)
Emit(v);
{
foreach (var v in closed.Value.entries[iterator].value) Emit(v);
}
closed.Value.Initialize();
this.ClosedEvents.entries[this.ClosedEventsIndex].value.Remove(closed.Key);

Просмотреть файл

@ -365,9 +365,9 @@ namespace Microsoft.StreamProcessing
{
var iterator = FastDictionary2<TPayload, ActiveEvent>.IteratorStart;
while (closed.Value.Iterate(ref iterator))
foreach (var v in closed.Value.entries[iterator].value)
Emit(v);
{
foreach (var v in closed.Value.entries[iterator].value) Emit(v);
}
closed.Value.Initialize();
this.ClosedEvents.Remove(closed.Key);

Просмотреть файл

@ -174,7 +174,8 @@ namespace Microsoft.StreamProcessing
protected override Expression VisitBinary(BinaryExpression node)
{
string left_result;
switch (node.NodeType) {
switch (node.NodeType)
{
case ExpressionType.OrElse:
this.inPlace = false;
Visit(node.Left);

Просмотреть файл

@ -556,23 +556,29 @@ namespace Microsoft.StreamProcessing
var newEqualityComparerSelectorMap = new Dictionary<Expression, object>();
var newPayloadEqualityComparer = EqualityComparerExpression<TResult>.Default;
if (hasStartEdge) foreach (var kvp in this.EqualityComparerSelectorMap)
if (hasStartEdge)
{
if (kvp.Key.ExpressionEquals(selector))
foreach (var kvp in this.EqualityComparerSelectorMap)
{
newPayloadEqualityComparer = kvp.Value as IEqualityComparerExpression<TResult>;
if (kvp.Key.ExpressionEquals(selector))
{
newPayloadEqualityComparer = kvp.Value as IEqualityComparerExpression<TResult>;
}
}
}
var newSortSelectorMap = new Dictionary<Expression, Guid?>();
IComparerExpression<TResult> newPayloadComparer = null;
if (hasStartEdge) foreach (var kvp in this.SortSelectorMap)
if (hasStartEdge)
{
if (kvp.Key.ExpressionEquals(selector))
foreach (var kvp in this.SortSelectorMap)
{
newPayloadComparer = ComparerExpression<TResult>.Default;
Expression<Func<TResult, TResult>> fullSelector = (x => x);
newSortSelectorMap.Add(fullSelector, kvp.Value);
if (kvp.Key.ExpressionEquals(selector))
{
newPayloadComparer = ComparerExpression<TResult>.Default;
Expression<Func<TResult, TResult>> fullSelector = (x => x);
newSortSelectorMap.Add(fullSelector, kvp.Value);
}
}
}
@ -924,10 +930,14 @@ namespace Microsoft.StreamProcessing
this.constantHopOffset = properties.ConstantHopOffset;
}
if (properties.IsIntervalFree) {
this.IntervalFreeValidator = IntervalFreeValidation; }
if (properties.IsSyncTimeSimultaneityFree) {
this.SyncTimeSimultaneityFreeValidator = SyncTimeSimulteneityFreeValidation; }
if (properties.IsIntervalFree)
{
this.IntervalFreeValidator = IntervalFreeValidation;
}
if (properties.IsSyncTimeSimultaneityFree)
{
this.SyncTimeSimultaneityFreeValidator = SyncTimeSimulteneityFreeValidation;
}
if (typeof(TKey).GetPartitionType() != null)
{
@ -974,9 +984,12 @@ namespace Microsoft.StreamProcessing
private void SimpleValidation(long sync, TKey key)
{
if (this.lastSeenTimestamp > sync) throw new InvalidOperationException(
"The operator AlterLifetime produced output out of sync-time order on an input event. The current internal sync time is " + this.lastSeenTimestamp.ToString(CultureInfo.InvariantCulture)
+ ". The event's sync time is " + sync.ToString(CultureInfo.InvariantCulture) + ".");
if (this.lastSeenTimestamp > sync)
{
throw new InvalidOperationException(
"The operator AlterLifetime produced output out of sync-time order on an input event. The current internal sync time is " + this.lastSeenTimestamp.ToString(CultureInfo.InvariantCulture)
+ ". The event's sync time is " + sync.ToString(CultureInfo.InvariantCulture) + ".");
}
this.lastSeenTimestamp = sync;
}
@ -985,10 +998,13 @@ namespace Microsoft.StreamProcessing
object partitionKey = this.getPartitionKey(key);
if (this.lastSeenTimestampPartitioned.TryGetValue(partitionKey, out long current))
{
if (current > sync) throw new InvalidOperationException(
"The operator AlterLifetime produced output out of sync-time order on an input event. The current internal sync time is " + current.ToString(CultureInfo.InvariantCulture)
+ ". The event's sync time is " + sync.ToString(CultureInfo.InvariantCulture)
+ ". The event's partition key is " + current.ToString(CultureInfo.InvariantCulture) + ".");
if (current > sync)
{
throw new InvalidOperationException(
"The operator AlterLifetime produced output out of sync-time order on an input event. The current internal sync time is " + current.ToString(CultureInfo.InvariantCulture)
+ ". The event's sync time is " + sync.ToString(CultureInfo.InvariantCulture)
+ ". The event's partition key is " + current.ToString(CultureInfo.InvariantCulture) + ".");
}
this.lastSeenTimestampPartitioned[partitionKey] = sync;
}
else
@ -997,26 +1013,34 @@ namespace Microsoft.StreamProcessing
private void ConstantDurationValidation(long sync, long other)
{
if (other < sync) throw new StreamProcessingException(string.Format(
CultureInfo.InvariantCulture,
"Expected only start and interval events, but encountered an end edge event at time {0}.",
sync.ToString(CultureInfo.InvariantCulture)));
if (other < sync)
{
throw new StreamProcessingException(string.Format(
CultureInfo.InvariantCulture,
"Expected only start and interval events, but encountered an end edge event at time {0}.",
sync.ToString(CultureInfo.InvariantCulture)));
}
if (!this.constantDuration.HasValue) this.constantDuration = sync - other;
if (this.constantDuration.Value == StreamEvent.InfinitySyncTime)
{
if (other != StreamEvent.InfinitySyncTime) throw new StreamProcessingException(string.Format(
if (other != StreamEvent.InfinitySyncTime)
{
throw new StreamProcessingException(string.Format(
CultureInfo.InvariantCulture,
"Expected only start edges, found an interval of length {0} at time {1}.",
(other - sync).ToString(CultureInfo.InvariantCulture),
sync.ToString(CultureInfo.InvariantCulture)));
}
}
else if (other - sync != this.constantDuration.Value)
{
throw new StreamProcessingException(string.Format(
CultureInfo.InvariantCulture,
"Expected only start edges, found an interval of length {0} at time {1}.",
"Expected only intervals of time {0}, found an interval of length {1} at time {2}.", this.constantDuration.Value.ToString(CultureInfo.InvariantCulture),
(other - sync).ToString(CultureInfo.InvariantCulture),
sync.ToString(CultureInfo.InvariantCulture)));
}
else if (other - sync != this.constantDuration.Value) throw new StreamProcessingException(string.Format(
CultureInfo.InvariantCulture,
"Expected only intervals of time {0}, found an interval of length {1} at time {2}.", this.constantDuration.Value.ToString(CultureInfo.InvariantCulture),
(other - sync).ToString(CultureInfo.InvariantCulture),
sync.ToString(CultureInfo.InvariantCulture)));
}
private void ConstantHopValidation(long sync, long other)
@ -1031,22 +1055,30 @@ namespace Microsoft.StreamProcessing
}
else
{
if ((sync - this.constantHopOffset.Value) % this.constantHopLength.Value != 0) throw new StreamProcessingException(string.Format(
CultureInfo.InvariantCulture,
"The sync time {0} does not correspond to the given hopping window properties of length {1} and offset {2}.",
sync.ToString(CultureInfo.InvariantCulture), this.constantHopLength.Value.ToString(CultureInfo.InvariantCulture), this.constantHopOffset.Value.ToString(CultureInfo.InvariantCulture)));
if ((sync - this.constantHopOffset.Value) % this.constantHopLength.Value != 0)
{
throw new StreamProcessingException(string.Format(
CultureInfo.InvariantCulture,
"The sync time {0} does not correspond to the given hopping window properties of length {1} and offset {2}.",
sync.ToString(CultureInfo.InvariantCulture), this.constantHopLength.Value.ToString(CultureInfo.InvariantCulture), this.constantHopOffset.Value.ToString(CultureInfo.InvariantCulture)));
}
}
}
private void SyncTimeSimulteneityFreeValidation(long sync, long other, TKey key)
{
if (!this.lastSyncTimeForSimultaneous.ContainsKey(key))
{
this.lastSyncTimeForSimultaneous.Add(key, sync);
else if (this.lastSyncTimeForSimultaneous[key] == sync) throw new StreamProcessingException(string.Format(
CultureInfo.InvariantCulture,
"Was not expecting to see events happening simultaneously, but found simultaneous events at time {0} for key {1}.",
sync.ToString(CultureInfo.InvariantCulture),
key.ToString()));
}
else if (this.lastSyncTimeForSimultaneous[key] == sync)
{
throw new StreamProcessingException(string.Format(
CultureInfo.InvariantCulture,
"Was not expecting to see events happening simultaneously, but found simultaneous events at time {0} for key {1}.",
sync.ToString(CultureInfo.InvariantCulture),
key.ToString()));
}
}
public override void ProduceQueryPlan(PlanNode previous) => throw new NotImplementedException();

Просмотреть файл

@ -285,10 +285,12 @@ namespace Microsoft.StreamProcessing
Expression<Func<long, TRegister, TAccumulator>> initializeTemplate = (ts, reg) => CallInliner.Call(accumulatorInitialization);
var userInitializeFunction = initializeTemplate.InlineCalls();
var accumulatorLocalForInitialize = Expression.Parameter(typeof(TAccumulator), "acc");
var initializeBody = new List<Expression>() {
var initializeBody = new List<Expression>()
{
Expression.Assign(accumulatorLocalForInitialize, userInitializeFunction.Body),
Expression.Assign(Expression.MakeMemberAccess(accumulatorLocalForInitialize, memberInfo), Expression.Constant(initialValueForBooleanField, typeof(bool))),
accumulatorLocalForInitialize };
accumulatorLocalForInitialize
};
var initializeFunction = (Expression<Func<long, TRegister, TAccumulator>>)Expression.Lambda(
Expression.Block(new[] { accumulatorLocalForInitialize }, initializeBody),
Expression.Parameter(typeof(long), "ts"), Expression.Parameter(typeof(TRegister), "reg"));

Просмотреть файл

@ -109,7 +109,8 @@ namespace Microsoft.StreamProcessing
Invariant.IsNotNull(merger, nameof(merger));
Expression<Func<TOutput1, TOutput2, StructTuple<TOutput1, TOutput2>>> aggregateMerger =
(output1, output2) => new StructTuple<TOutput1, TOutput2> {
(output1, output2) => new StructTuple<TOutput1, TOutput2>
{
Item1 = output1,
Item2 = output2
};
@ -169,7 +170,8 @@ namespace Microsoft.StreamProcessing
Invariant.IsNotNull(merger, nameof(merger));
Expression<Func<TOutput1, TOutput2, StructTuple<TOutput1, TOutput2>>> aggregateMerger =
(output1, output2) => new StructTuple<TOutput1, TOutput2> {
(output1, output2) => new StructTuple<TOutput1, TOutput2>
{
Item1 = output1,
Item2 = output2
};
@ -218,7 +220,8 @@ namespace Microsoft.StreamProcessing
Invariant.IsNotNull(merger, nameof(merger));
Expression<Func<TOutput1, TOutput2, TOutput3, StructTuple<TOutput1, TOutput2, TOutput3>>> aggregateMerger =
(output1, output2, output3) => new StructTuple<TOutput1, TOutput2, TOutput3> {
(output1, output2, output3) => new StructTuple<TOutput1, TOutput2, TOutput3>
{
Item1 = output1,
Item2 = output2,
Item3 = output3
@ -286,7 +289,8 @@ namespace Microsoft.StreamProcessing
Invariant.IsNotNull(merger, nameof(merger));
Expression<Func<TOutput1, TOutput2, TOutput3, StructTuple<TOutput1, TOutput2, TOutput3>>> aggregateMerger =
(output1, output2, output3) => new StructTuple<TOutput1, TOutput2, TOutput3> {
(output1, output2, output3) => new StructTuple<TOutput1, TOutput2, TOutput3>
{
Item1 = output1,
Item2 = output2,
Item3 = output3
@ -341,7 +345,8 @@ namespace Microsoft.StreamProcessing
Invariant.IsNotNull(merger, nameof(merger));
Expression<Func<TOutput1, TOutput2, TOutput3, TOutput4, StructTuple<TOutput1, TOutput2, TOutput3, TOutput4>>> aggregateMerger =
(output1, output2, output3, output4) => new StructTuple<TOutput1, TOutput2, TOutput3, TOutput4> {
(output1, output2, output3, output4) => new StructTuple<TOutput1, TOutput2, TOutput3, TOutput4>
{
Item1 = output1,
Item2 = output2,
Item3 = output3,
@ -417,7 +422,8 @@ namespace Microsoft.StreamProcessing
Invariant.IsNotNull(merger, nameof(merger));
Expression<Func<TOutput1, TOutput2, TOutput3, TOutput4, StructTuple<TOutput1, TOutput2, TOutput3, TOutput4>>> aggregateMerger =
(output1, output2, output3, output4) => new StructTuple<TOutput1, TOutput2, TOutput3, TOutput4> {
(output1, output2, output3, output4) => new StructTuple<TOutput1, TOutput2, TOutput3, TOutput4>
{
Item1 = output1,
Item2 = output2,
Item3 = output3,
@ -478,7 +484,8 @@ namespace Microsoft.StreamProcessing
Invariant.IsNotNull(merger, nameof(merger));
Expression<Func<TOutput1, TOutput2, TOutput3, TOutput4, TOutput5, StructTuple<TOutput1, TOutput2, TOutput3, TOutput4, TOutput5>>> aggregateMerger =
(output1, output2, output3, output4, output5) => new StructTuple<TOutput1, TOutput2, TOutput3, TOutput4, TOutput5> {
(output1, output2, output3, output4, output5) => new StructTuple<TOutput1, TOutput2, TOutput3, TOutput4, TOutput5>
{
Item1 = output1,
Item2 = output2,
Item3 = output3,
@ -562,7 +569,8 @@ namespace Microsoft.StreamProcessing
Invariant.IsNotNull(merger, nameof(merger));
Expression<Func<TOutput1, TOutput2, TOutput3, TOutput4, TOutput5, StructTuple<TOutput1, TOutput2, TOutput3, TOutput4, TOutput5>>> aggregateMerger =
(output1, output2, output3, output4, output5) => new StructTuple<TOutput1, TOutput2, TOutput3, TOutput4, TOutput5> {
(output1, output2, output3, output4, output5) => new StructTuple<TOutput1, TOutput2, TOutput3, TOutput4, TOutput5>
{
Item1 = output1,
Item2 = output2,
Item3 = output3,
@ -629,7 +637,8 @@ namespace Microsoft.StreamProcessing
Invariant.IsNotNull(merger, nameof(merger));
Expression<Func<TOutput1, TOutput2, TOutput3, TOutput4, TOutput5, TOutput6, StructTuple<TOutput1, TOutput2, TOutput3, TOutput4, TOutput5, TOutput6>>> aggregateMerger =
(output1, output2, output3, output4, output5, output6) => new StructTuple<TOutput1, TOutput2, TOutput3, TOutput4, TOutput5, TOutput6> {
(output1, output2, output3, output4, output5, output6) => new StructTuple<TOutput1, TOutput2, TOutput3, TOutput4, TOutput5, TOutput6>
{
Item1 = output1,
Item2 = output2,
Item3 = output3,
@ -721,7 +730,8 @@ namespace Microsoft.StreamProcessing
Invariant.IsNotNull(merger, nameof(merger));
Expression<Func<TOutput1, TOutput2, TOutput3, TOutput4, TOutput5, TOutput6, StructTuple<TOutput1, TOutput2, TOutput3, TOutput4, TOutput5, TOutput6>>> aggregateMerger =
(output1, output2, output3, output4, output5, output6) => new StructTuple<TOutput1, TOutput2, TOutput3, TOutput4, TOutput5, TOutput6> {
(output1, output2, output3, output4, output5, output6) => new StructTuple<TOutput1, TOutput2, TOutput3, TOutput4, TOutput5, TOutput6>
{
Item1 = output1,
Item2 = output2,
Item3 = output3,
@ -794,7 +804,8 @@ namespace Microsoft.StreamProcessing
Invariant.IsNotNull(merger, nameof(merger));
Expression<Func<TOutput1, TOutput2, TOutput3, TOutput4, TOutput5, TOutput6, TOutput7, StructTuple<TOutput1, TOutput2, TOutput3, TOutput4, TOutput5, TOutput6, TOutput7>>> aggregateMerger =
(output1, output2, output3, output4, output5, output6, output7) => new StructTuple<TOutput1, TOutput2, TOutput3, TOutput4, TOutput5, TOutput6, TOutput7> {
(output1, output2, output3, output4, output5, output6, output7) => new StructTuple<TOutput1, TOutput2, TOutput3, TOutput4, TOutput5, TOutput6, TOutput7>
{
Item1 = output1,
Item2 = output2,
Item3 = output3,
@ -894,7 +905,8 @@ namespace Microsoft.StreamProcessing
Invariant.IsNotNull(merger, nameof(merger));
Expression<Func<TOutput1, TOutput2, TOutput3, TOutput4, TOutput5, TOutput6, TOutput7, StructTuple<TOutput1, TOutput2, TOutput3, TOutput4, TOutput5, TOutput6, TOutput7>>> aggregateMerger =
(output1, output2, output3, output4, output5, output6, output7) => new StructTuple<TOutput1, TOutput2, TOutput3, TOutput4, TOutput5, TOutput6, TOutput7> {
(output1, output2, output3, output4, output5, output6, output7) => new StructTuple<TOutput1, TOutput2, TOutput3, TOutput4, TOutput5, TOutput6, TOutput7>
{
Item1 = output1,
Item2 = output2,
Item3 = output3,
@ -973,7 +985,8 @@ namespace Microsoft.StreamProcessing
Invariant.IsNotNull(merger, nameof(merger));
Expression<Func<TOutput1, TOutput2, TOutput3, TOutput4, TOutput5, TOutput6, TOutput7, TOutput8, StructTuple<TOutput1, TOutput2, TOutput3, TOutput4, TOutput5, TOutput6, TOutput7, TOutput8>>> aggregateMerger =
(output1, output2, output3, output4, output5, output6, output7, output8) => new StructTuple<TOutput1, TOutput2, TOutput3, TOutput4, TOutput5, TOutput6, TOutput7, TOutput8> {
(output1, output2, output3, output4, output5, output6, output7, output8) => new StructTuple<TOutput1, TOutput2, TOutput3, TOutput4, TOutput5, TOutput6, TOutput7, TOutput8>
{
Item1 = output1,
Item2 = output2,
Item3 = output3,
@ -1081,7 +1094,8 @@ namespace Microsoft.StreamProcessing
Invariant.IsNotNull(merger, nameof(merger));
Expression<Func<TOutput1, TOutput2, TOutput3, TOutput4, TOutput5, TOutput6, TOutput7, TOutput8, StructTuple<TOutput1, TOutput2, TOutput3, TOutput4, TOutput5, TOutput6, TOutput7, TOutput8>>> aggregateMerger =
(output1, output2, output3, output4, output5, output6, output7, output8) => new StructTuple<TOutput1, TOutput2, TOutput3, TOutput4, TOutput5, TOutput6, TOutput7, TOutput8> {
(output1, output2, output3, output4, output5, output6, output7, output8) => new StructTuple<TOutput1, TOutput2, TOutput3, TOutput4, TOutput5, TOutput6, TOutput7, TOutput8>
{
Item1 = output1,
Item2 = output2,
Item3 = output3,
@ -1166,7 +1180,8 @@ namespace Microsoft.StreamProcessing
Invariant.IsNotNull(merger, nameof(merger));
Expression<Func<TOutput1, TOutput2, TOutput3, TOutput4, TOutput5, TOutput6, TOutput7, TOutput8, TOutput9, StructTuple<TOutput1, TOutput2, TOutput3, TOutput4, TOutput5, TOutput6, TOutput7, TOutput8, TOutput9>>> aggregateMerger =
(output1, output2, output3, output4, output5, output6, output7, output8, output9) => new StructTuple<TOutput1, TOutput2, TOutput3, TOutput4, TOutput5, TOutput6, TOutput7, TOutput8, TOutput9> {
(output1, output2, output3, output4, output5, output6, output7, output8, output9) => new StructTuple<TOutput1, TOutput2, TOutput3, TOutput4, TOutput5, TOutput6, TOutput7, TOutput8, TOutput9>
{
Item1 = output1,
Item2 = output2,
Item3 = output3,
@ -1282,7 +1297,8 @@ namespace Microsoft.StreamProcessing
Invariant.IsNotNull(merger, nameof(merger));
Expression<Func<TOutput1, TOutput2, TOutput3, TOutput4, TOutput5, TOutput6, TOutput7, TOutput8, TOutput9, StructTuple<TOutput1, TOutput2, TOutput3, TOutput4, TOutput5, TOutput6, TOutput7, TOutput8, TOutput9>>> aggregateMerger =
(output1, output2, output3, output4, output5, output6, output7, output8, output9) => new StructTuple<TOutput1, TOutput2, TOutput3, TOutput4, TOutput5, TOutput6, TOutput7, TOutput8, TOutput9> {
(output1, output2, output3, output4, output5, output6, output7, output8, output9) => new StructTuple<TOutput1, TOutput2, TOutput3, TOutput4, TOutput5, TOutput6, TOutput7, TOutput8, TOutput9>
{
Item1 = output1,
Item2 = output2,
Item3 = output3,
@ -1373,7 +1389,8 @@ namespace Microsoft.StreamProcessing
Invariant.IsNotNull(merger, nameof(merger));
Expression<Func<TOutput1, TOutput2, TOutput3, TOutput4, TOutput5, TOutput6, TOutput7, TOutput8, TOutput9, TOutput10, StructTuple<TOutput1, TOutput2, TOutput3, TOutput4, TOutput5, TOutput6, TOutput7, TOutput8, TOutput9, TOutput10>>> aggregateMerger =
(output1, output2, output3, output4, output5, output6, output7, output8, output9, output10) => new StructTuple<TOutput1, TOutput2, TOutput3, TOutput4, TOutput5, TOutput6, TOutput7, TOutput8, TOutput9, TOutput10> {
(output1, output2, output3, output4, output5, output6, output7, output8, output9, output10) => new StructTuple<TOutput1, TOutput2, TOutput3, TOutput4, TOutput5, TOutput6, TOutput7, TOutput8, TOutput9, TOutput10>
{
Item1 = output1,
Item2 = output2,
Item3 = output3,
@ -1497,7 +1514,8 @@ namespace Microsoft.StreamProcessing
Invariant.IsNotNull(merger, nameof(merger));
Expression<Func<TOutput1, TOutput2, TOutput3, TOutput4, TOutput5, TOutput6, TOutput7, TOutput8, TOutput9, TOutput10, StructTuple<TOutput1, TOutput2, TOutput3, TOutput4, TOutput5, TOutput6, TOutput7, TOutput8, TOutput9, TOutput10>>> aggregateMerger =
(output1, output2, output3, output4, output5, output6, output7, output8, output9, output10) => new StructTuple<TOutput1, TOutput2, TOutput3, TOutput4, TOutput5, TOutput6, TOutput7, TOutput8, TOutput9, TOutput10> {
(output1, output2, output3, output4, output5, output6, output7, output8, output9, output10) => new StructTuple<TOutput1, TOutput2, TOutput3, TOutput4, TOutput5, TOutput6, TOutput7, TOutput8, TOutput9, TOutput10>
{
Item1 = output1,
Item2 = output2,
Item3 = output3,
@ -1594,7 +1612,8 @@ namespace Microsoft.StreamProcessing
Invariant.IsNotNull(merger, nameof(merger));
Expression<Func<TOutput1, TOutput2, TOutput3, TOutput4, TOutput5, TOutput6, TOutput7, TOutput8, TOutput9, TOutput10, TOutput11, StructTuple<TOutput1, TOutput2, TOutput3, TOutput4, TOutput5, TOutput6, TOutput7, TOutput8, TOutput9, TOutput10, TOutput11>>> aggregateMerger =
(output1, output2, output3, output4, output5, output6, output7, output8, output9, output10, output11) => new StructTuple<TOutput1, TOutput2, TOutput3, TOutput4, TOutput5, TOutput6, TOutput7, TOutput8, TOutput9, TOutput10, TOutput11> {
(output1, output2, output3, output4, output5, output6, output7, output8, output9, output10, output11) => new StructTuple<TOutput1, TOutput2, TOutput3, TOutput4, TOutput5, TOutput6, TOutput7, TOutput8, TOutput9, TOutput10, TOutput11>
{
Item1 = output1,
Item2 = output2,
Item3 = output3,
@ -1726,7 +1745,8 @@ namespace Microsoft.StreamProcessing
Invariant.IsNotNull(merger, nameof(merger));
Expression<Func<TOutput1, TOutput2, TOutput3, TOutput4, TOutput5, TOutput6, TOutput7, TOutput8, TOutput9, TOutput10, TOutput11, StructTuple<TOutput1, TOutput2, TOutput3, TOutput4, TOutput5, TOutput6, TOutput7, TOutput8, TOutput9, TOutput10, TOutput11>>> aggregateMerger =
(output1, output2, output3, output4, output5, output6, output7, output8, output9, output10, output11) => new StructTuple<TOutput1, TOutput2, TOutput3, TOutput4, TOutput5, TOutput6, TOutput7, TOutput8, TOutput9, TOutput10, TOutput11> {
(output1, output2, output3, output4, output5, output6, output7, output8, output9, output10, output11) => new StructTuple<TOutput1, TOutput2, TOutput3, TOutput4, TOutput5, TOutput6, TOutput7, TOutput8, TOutput9, TOutput10, TOutput11>
{
Item1 = output1,
Item2 = output2,
Item3 = output3,
@ -1829,7 +1849,8 @@ namespace Microsoft.StreamProcessing
Invariant.IsNotNull(merger, nameof(merger));
Expression<Func<TOutput1, TOutput2, TOutput3, TOutput4, TOutput5, TOutput6, TOutput7, TOutput8, TOutput9, TOutput10, TOutput11, TOutput12, StructTuple<TOutput1, TOutput2, TOutput3, TOutput4, TOutput5, TOutput6, TOutput7, TOutput8, TOutput9, TOutput10, TOutput11, TOutput12>>> aggregateMerger =
(output1, output2, output3, output4, output5, output6, output7, output8, output9, output10, output11, output12) => new StructTuple<TOutput1, TOutput2, TOutput3, TOutput4, TOutput5, TOutput6, TOutput7, TOutput8, TOutput9, TOutput10, TOutput11, TOutput12> {
(output1, output2, output3, output4, output5, output6, output7, output8, output9, output10, output11, output12) => new StructTuple<TOutput1, TOutput2, TOutput3, TOutput4, TOutput5, TOutput6, TOutput7, TOutput8, TOutput9, TOutput10, TOutput11, TOutput12>
{
Item1 = output1,
Item2 = output2,
Item3 = output3,
@ -1969,7 +1990,8 @@ namespace Microsoft.StreamProcessing
Invariant.IsNotNull(merger, nameof(merger));
Expression<Func<TOutput1, TOutput2, TOutput3, TOutput4, TOutput5, TOutput6, TOutput7, TOutput8, TOutput9, TOutput10, TOutput11, TOutput12, StructTuple<TOutput1, TOutput2, TOutput3, TOutput4, TOutput5, TOutput6, TOutput7, TOutput8, TOutput9, TOutput10, TOutput11, TOutput12>>> aggregateMerger =
(output1, output2, output3, output4, output5, output6, output7, output8, output9, output10, output11, output12) => new StructTuple<TOutput1, TOutput2, TOutput3, TOutput4, TOutput5, TOutput6, TOutput7, TOutput8, TOutput9, TOutput10, TOutput11, TOutput12> {
(output1, output2, output3, output4, output5, output6, output7, output8, output9, output10, output11, output12) => new StructTuple<TOutput1, TOutput2, TOutput3, TOutput4, TOutput5, TOutput6, TOutput7, TOutput8, TOutput9, TOutput10, TOutput11, TOutput12>
{
Item1 = output1,
Item2 = output2,
Item3 = output3,
@ -2078,7 +2100,8 @@ namespace Microsoft.StreamProcessing
Invariant.IsNotNull(merger, nameof(merger));
Expression<Func<TOutput1, TOutput2, TOutput3, TOutput4, TOutput5, TOutput6, TOutput7, TOutput8, TOutput9, TOutput10, TOutput11, TOutput12, TOutput13, StructTuple<TOutput1, TOutput2, TOutput3, TOutput4, TOutput5, TOutput6, TOutput7, TOutput8, TOutput9, TOutput10, TOutput11, TOutput12, TOutput13>>> aggregateMerger =
(output1, output2, output3, output4, output5, output6, output7, output8, output9, output10, output11, output12, output13) => new StructTuple<TOutput1, TOutput2, TOutput3, TOutput4, TOutput5, TOutput6, TOutput7, TOutput8, TOutput9, TOutput10, TOutput11, TOutput12, TOutput13> {
(output1, output2, output3, output4, output5, output6, output7, output8, output9, output10, output11, output12, output13) => new StructTuple<TOutput1, TOutput2, TOutput3, TOutput4, TOutput5, TOutput6, TOutput7, TOutput8, TOutput9, TOutput10, TOutput11, TOutput12, TOutput13>
{
Item1 = output1,
Item2 = output2,
Item3 = output3,
@ -2226,7 +2249,8 @@ namespace Microsoft.StreamProcessing
Invariant.IsNotNull(merger, nameof(merger));
Expression<Func<TOutput1, TOutput2, TOutput3, TOutput4, TOutput5, TOutput6, TOutput7, TOutput8, TOutput9, TOutput10, TOutput11, TOutput12, TOutput13, StructTuple<TOutput1, TOutput2, TOutput3, TOutput4, TOutput5, TOutput6, TOutput7, TOutput8, TOutput9, TOutput10, TOutput11, TOutput12, TOutput13>>> aggregateMerger =
(output1, output2, output3, output4, output5, output6, output7, output8, output9, output10, output11, output12, output13) => new StructTuple<TOutput1, TOutput2, TOutput3, TOutput4, TOutput5, TOutput6, TOutput7, TOutput8, TOutput9, TOutput10, TOutput11, TOutput12, TOutput13> {
(output1, output2, output3, output4, output5, output6, output7, output8, output9, output10, output11, output12, output13) => new StructTuple<TOutput1, TOutput2, TOutput3, TOutput4, TOutput5, TOutput6, TOutput7, TOutput8, TOutput9, TOutput10, TOutput11, TOutput12, TOutput13>
{
Item1 = output1,
Item2 = output2,
Item3 = output3,
@ -2341,7 +2365,8 @@ namespace Microsoft.StreamProcessing
Invariant.IsNotNull(merger, nameof(merger));
Expression<Func<TOutput1, TOutput2, TOutput3, TOutput4, TOutput5, TOutput6, TOutput7, TOutput8, TOutput9, TOutput10, TOutput11, TOutput12, TOutput13, TOutput14, StructTuple<TOutput1, TOutput2, TOutput3, TOutput4, TOutput5, TOutput6, TOutput7, TOutput8, TOutput9, TOutput10, TOutput11, TOutput12, TOutput13, TOutput14>>> aggregateMerger =
(output1, output2, output3, output4, output5, output6, output7, output8, output9, output10, output11, output12, output13, output14) => new StructTuple<TOutput1, TOutput2, TOutput3, TOutput4, TOutput5, TOutput6, TOutput7, TOutput8, TOutput9, TOutput10, TOutput11, TOutput12, TOutput13, TOutput14> {
(output1, output2, output3, output4, output5, output6, output7, output8, output9, output10, output11, output12, output13, output14) => new StructTuple<TOutput1, TOutput2, TOutput3, TOutput4, TOutput5, TOutput6, TOutput7, TOutput8, TOutput9, TOutput10, TOutput11, TOutput12, TOutput13, TOutput14>
{
Item1 = output1,
Item2 = output2,
Item3 = output3,
@ -2497,7 +2522,8 @@ namespace Microsoft.StreamProcessing
Invariant.IsNotNull(merger, nameof(merger));
Expression<Func<TOutput1, TOutput2, TOutput3, TOutput4, TOutput5, TOutput6, TOutput7, TOutput8, TOutput9, TOutput10, TOutput11, TOutput12, TOutput13, TOutput14, StructTuple<TOutput1, TOutput2, TOutput3, TOutput4, TOutput5, TOutput6, TOutput7, TOutput8, TOutput9, TOutput10, TOutput11, TOutput12, TOutput13, TOutput14>>> aggregateMerger =
(output1, output2, output3, output4, output5, output6, output7, output8, output9, output10, output11, output12, output13, output14) => new StructTuple<TOutput1, TOutput2, TOutput3, TOutput4, TOutput5, TOutput6, TOutput7, TOutput8, TOutput9, TOutput10, TOutput11, TOutput12, TOutput13, TOutput14> {
(output1, output2, output3, output4, output5, output6, output7, output8, output9, output10, output11, output12, output13, output14) => new StructTuple<TOutput1, TOutput2, TOutput3, TOutput4, TOutput5, TOutput6, TOutput7, TOutput8, TOutput9, TOutput10, TOutput11, TOutput12, TOutput13, TOutput14>
{
Item1 = output1,
Item2 = output2,
Item3 = output3,
@ -2618,7 +2644,8 @@ namespace Microsoft.StreamProcessing
Invariant.IsNotNull(merger, nameof(merger));
Expression<Func<TOutput1, TOutput2, TOutput3, TOutput4, TOutput5, TOutput6, TOutput7, TOutput8, TOutput9, TOutput10, TOutput11, TOutput12, TOutput13, TOutput14, TOutput15, StructTuple<TOutput1, TOutput2, TOutput3, TOutput4, TOutput5, TOutput6, TOutput7, TOutput8, TOutput9, TOutput10, TOutput11, TOutput12, TOutput13, TOutput14, TOutput15>>> aggregateMerger =
(output1, output2, output3, output4, output5, output6, output7, output8, output9, output10, output11, output12, output13, output14, output15) => new StructTuple<TOutput1, TOutput2, TOutput3, TOutput4, TOutput5, TOutput6, TOutput7, TOutput8, TOutput9, TOutput10, TOutput11, TOutput12, TOutput13, TOutput14, TOutput15> {
(output1, output2, output3, output4, output5, output6, output7, output8, output9, output10, output11, output12, output13, output14, output15) => new StructTuple<TOutput1, TOutput2, TOutput3, TOutput4, TOutput5, TOutput6, TOutput7, TOutput8, TOutput9, TOutput10, TOutput11, TOutput12, TOutput13, TOutput14, TOutput15>
{
Item1 = output1,
Item2 = output2,
Item3 = output3,
@ -2782,7 +2809,8 @@ namespace Microsoft.StreamProcessing
Invariant.IsNotNull(merger, nameof(merger));
Expression<Func<TOutput1, TOutput2, TOutput3, TOutput4, TOutput5, TOutput6, TOutput7, TOutput8, TOutput9, TOutput10, TOutput11, TOutput12, TOutput13, TOutput14, TOutput15, StructTuple<TOutput1, TOutput2, TOutput3, TOutput4, TOutput5, TOutput6, TOutput7, TOutput8, TOutput9, TOutput10, TOutput11, TOutput12, TOutput13, TOutput14, TOutput15>>> aggregateMerger =
(output1, output2, output3, output4, output5, output6, output7, output8, output9, output10, output11, output12, output13, output14, output15) => new StructTuple<TOutput1, TOutput2, TOutput3, TOutput4, TOutput5, TOutput6, TOutput7, TOutput8, TOutput9, TOutput10, TOutput11, TOutput12, TOutput13, TOutput14, TOutput15> {
(output1, output2, output3, output4, output5, output6, output7, output8, output9, output10, output11, output12, output13, output14, output15) => new StructTuple<TOutput1, TOutput2, TOutput3, TOutput4, TOutput5, TOutput6, TOutput7, TOutput8, TOutput9, TOutput10, TOutput11, TOutput12, TOutput13, TOutput14, TOutput15>
{
Item1 = output1,
Item2 = output2,
Item3 = output3,

Просмотреть файл

@ -113,7 +113,8 @@ namespace Microsoft.StreamProcessing
Invariant.IsNotNull(merger, nameof(merger));
Expression<Func<<#= IterateComma("TOutput$", count) #>, StructTuple<<#= IterateComma("TOutput$", count) #>>>> aggregateMerger =
(<#= IterateComma("output$", count) #>) => new StructTuple<<#= IterateComma("TOutput$", count) #>> {
(<#= IterateComma("output$", count) #>) => new StructTuple<<#= IterateComma("TOutput$", count) #>>
{
<#= IterateCommaLine(" Item$ = output$", count) #>
};
@ -165,7 +166,8 @@ namespace Microsoft.StreamProcessing
Invariant.IsNotNull(merger, nameof(merger));
Expression<Func<<#= IterateComma("TOutput$", count) #>, StructTuple<<#= IterateComma("TOutput$", count) #>>>> aggregateMerger =
(<#= IterateComma("output$", count) #>) => new StructTuple<<#= IterateComma("TOutput$", count) #>> {
(<#= IterateComma("output$", count) #>) => new StructTuple<<#= IterateComma("TOutput$", count) #>>
{
<#= IterateCommaLine(" Item$ = output$", count) #>
};
Expression<Func<GroupSelectorInput<TInnerKey>, StructTuple<<#= IterateComma("TOutput$", count) #>>, TOutput>> reducerTemplate =

Просмотреть файл

@ -75,13 +75,17 @@ namespace Microsoft.StreamProcessing
}
if (windowSize % period == 0)
{
return source.AlterEventLifetime(vs => AdjustStartTime(vs, offset, period), windowSize)
.SetProperty().IsConstantHop(true, period, offset);
}
else
{
return source.AlterEventLifetime(
vs => AdjustStartTime(vs, offset, period),
vs => AdjustStartTime(vs + windowSize, offset, period) - AdjustStartTime(vs, offset, period))
.SetProperty().IsConstantHop(true, period, offset);
}
}
/// <summary>

Просмотреть файл

@ -327,12 +327,14 @@ namespace Microsoft.StreamProcessing
this.isNull.Add(field.Name, (TInput o) => true);
}
var fieldAssignment = new[] {
Expression.Bind(
valueField.Member,
IsNullable(field.PropertyType)
? Expression.PropertyOrField(Expression.PropertyOrField(input, field.Name), "Value")
: Expression.PropertyOrField(input, field.Name)) };
var fieldAssignment = new[]
{
Expression.Bind(
valueField.Member,
IsNullable(field.PropertyType)
? Expression.PropertyOrField(Expression.PropertyOrField(input, field.Name), "Value")
: Expression.PropertyOrField(input, field.Name))
};
var constructor = Expression.MemberInit(newExpression, keyAssignments.Concat(fieldAssignment));
var fieldResult = Expression.Lambda<Func<TInput, string, TResult>>(constructor, input, attribute);
this.fields.Add(field.Name, fieldResult.Compile());
@ -361,12 +363,14 @@ namespace Microsoft.StreamProcessing
this.isNull.Add(field.Name, (TInput o) => true);
}
var fieldAssignment = new[] {
Expression.Bind(
valueField.Member,
IsNullable(field.FieldType)
? Expression.PropertyOrField(Expression.PropertyOrField(input, field.Name), "Value")
: Expression.PropertyOrField(input, field.Name)) };
var fieldAssignment = new[]
{
Expression.Bind(
valueField.Member,
IsNullable(field.FieldType)
? Expression.PropertyOrField(Expression.PropertyOrField(input, field.Name), "Value")
: Expression.PropertyOrField(input, field.Name))
};
var constructor = Expression.MemberInit(newExpression, keyAssignments.Concat(fieldAssignment));
var fieldResult = Expression.Lambda<Func<TInput, string, TResult>>(constructor, input, attribute);
this.fields.Add(field.Name, fieldResult.Compile());

Просмотреть файл

@ -708,9 +708,15 @@ namespace Microsoft.StreamProcessing.Internal.Collections
var largestr = this.col.charArray.contentString;
for (int i = 0; i < this.Count; i++)
{
if ((bv[i >> 6] & (1L << (i & 0x3f))) == 0)
{
if (!(largestr.IndexOf(str, startscol[i] + 2, lengthscol[i], StringComparison.Ordinal) >= 0))
{
rbv[i >> 6] |= (1L << (i & 0x3f));
}
}
}
return result;
}

Просмотреть файл

@ -409,9 +409,9 @@ namespace Microsoft.StreamProcessing
protected override Expression VisitMethodCall(MethodCallExpression node)
{
if (node.Object is ParameterExpression parameter)
if (!this.parameterInformation.ContainsKey(parameter))
this.needsSourceInstance = true;
{
if (!this.parameterInformation.ContainsKey(parameter)) this.needsSourceInstance = true;
}
foreach (var a in node.Arguments)
{
parameter = a as ParameterExpression;

Просмотреть файл

@ -192,9 +192,11 @@ namespace Microsoft.StreamProcessing
MetadataReference trill = MetadataReference.CreateFromFile(typeof(StreamMessage).GetTypeInfo().Assembly.Location);
MetadataReference linq = MetadataReference.CreateFromFile(typeof(Enumerable).GetTypeInfo().Assembly.Location);
MetadataReference contracts = MetadataReference.CreateFromFile(typeof(System.Runtime.Serialization.DataContractAttribute).GetTypeInfo().Assembly.Location);
MetadataReference[] baseReferences = { trill,
MetadataReference[] baseReferences =
{
trill,
#if !DOTNETCORE
mscorlib, linq, contracts, numerics,
mscorlib, linq, contracts, numerics,
#endif
};
@ -511,8 +513,9 @@ namespace System.Runtime.CompilerServices
}
if (!t.GetTypeInfo().Assembly.IsDynamic && t.GetTypeInfo().IsGenericType)
foreach (var gta in t.GenericTypeArguments)
l.AddRange(GenericTypeVariables(gta));
{
foreach (var gta in t.GenericTypeArguments) l.AddRange(GenericTypeVariables(gta));
}
}
return l.Distinct();
}
@ -599,8 +602,12 @@ namespace System.Runtime.CompilerServices
if (!this.Fields.Any())
{
if (t.HasSupportedParameterizedConstructor())
{
foreach (var p in t.GetTypeInfo().GetProperties(BindingFlags.Public | BindingFlags.Instance))
{
d.Add(p.Name, new MyFieldInfo(p/*, prefix*/));
}
}
else
{
this.noFields = true;

Просмотреть файл

@ -9,7 +9,8 @@ using System.Runtime.Serialization;
namespace Microsoft.StreamProcessing.Internal
{
internal static class StructTuple {
internal static class StructTuple
{
public static StructTuple<T1> Create<T1>(T1 item1)
{
return new StructTuple<T1>() { Item1 = item1 };

Просмотреть файл

@ -13,7 +13,8 @@ int maxSize = 16;
namespace Microsoft.StreamProcessing.Internal
{
internal static class StructTuple {
internal static class StructTuple
{
<#
for (int count = 1; count <= maxSize; count++)
{

Просмотреть файл

@ -131,8 +131,9 @@ namespace Microsoft.StreamProcessing
var n = f.Parameters.Count;
var remainingParameters = new List<ParameterExpression>();
for (int i = 0; i < n; i++)
if (i != j)
remainingParameters.Add(f.Parameters[i]);
{
if (i != j) remainingParameters.Add(f.Parameters[i]);
}
return Expression.Lambda(newLambda.Body, remainingParameters);
}

Просмотреть файл

@ -31,8 +31,11 @@ namespace Microsoft.StreamProcessing
{ "%d", "op_Modulus" },
};
foreach (var pair in OperatorNameLookup) KnownSupportedOperators.Add(
pair.Key, new HashSet<Type> { typeof(long), typeof(ulong), typeof(int), typeof(uint), typeof(short), typeof(ushort), typeof(double), typeof(float), typeof(decimal), typeof(byte), typeof(sbyte) });
foreach (var pair in OperatorNameLookup)
{
KnownSupportedOperators.Add(
pair.Key, new HashSet<Type> { typeof(long), typeof(ulong), typeof(int), typeof(uint), typeof(short), typeof(ushort), typeof(double), typeof(float), typeof(decimal), typeof(byte), typeof(sbyte) });
}
}
public static PropertyInfo GetPropertyByName(this Type type, string name)

Просмотреть файл

@ -68,8 +68,11 @@
<Rule Id="SA1406" Action="Warning" /> <!-- Debug.Fail must provide message text -->
<Rule Id="SA1410" Action="Warning" /> <!-- Remove delegate parenthesis when possible -->
<Rule Id="SA1411" Action="Warning" /> <!-- Attribute constructor must not use unnecessary parenthesis -->
<Rule Id="SA1500" Action="Warning" /> <!-- Braces for multi-line statements must not share line -->
<Rule Id="SA1511" Action="Warning" /> <!-- While-do footer must not be preceded by blank line -->
<Rule Id="SA1517" Action="Warning" /> <!-- Code must not contain blank lines at start of file -->
<Rule Id="SA1518" Action="Warning" /> <!-- Use line endings correctly at end of file -->
<Rule Id="SA1519" Action="Warning" /> <!-- Braces must not be omitted from multi-line child statement -->
<!-- Disabled Rules -->
<Rule Id="SA0001" Action="None" /> <!-- All diagnostics of XML documentation comments has been disabled due to the current project configuration -->
@ -122,7 +125,6 @@
<Rule Id="SA1408" Action="None" /> <!-- Conditional expressions must declare precedence -->
<Rule Id="SA1412" Action="None" /> <!-- Store files as UTF-8 -->
<Rule Id="SA1413" Action="None" /> <!-- Use trailing comma in multi-line initializers -->
<Rule Id="SA1500" Action="None" /> <!-- Braces for multi-line statements must not share line -->
<Rule Id="SA1501" Action="None" /> <!-- Statement must not be on a single line -->
<Rule Id="SA1502" Action="None" /> <!-- Element must not be on a single line -->
<Rule Id="SA1503" Action="None" /> <!-- Braces must not be omitted -->
@ -133,13 +135,11 @@
<Rule Id="SA1508" Action="None" /> <!-- Closing braces must not be preceded by blank line -->
<Rule Id="SA1509" Action="None" /> <!-- Opening braces must not be preceded by blank line -->
<Rule Id="SA1510" Action="None" /> <!-- Chained statement blocks must not be preceded by blank line -->
<Rule Id="SA1511" Action="None" /> <!-- While-do footer must not be preceded by blank line -->
<Rule Id="SA1512" Action="None" /> <!-- Single-line comments must not be followed by blank line -->
<Rule Id="SA1513" Action="None" /> <!-- Closing brace must be followed by blank line -->
<Rule Id="SA1514" Action="None" /> <!-- Element documentation header must be preceded by blank line -->
<Rule Id="SA1515" Action="None" /> <!-- Single-line comment must be preceded by blank line -->
<Rule Id="SA1516" Action="None" /> <!-- Elements must be separated by blank line -->
<Rule Id="SA1519" Action="None" /> <!-- Braces must not be omitted from multi-line child statement -->
<Rule Id="SA1520" Action="None" /> <!-- Use braces consistently -->
<Rule Id="SA1600" Action="None" /> <!-- Elements must be documented -->
<Rule Id="SA1601" Action="None" /> <!-- Partial elements must be documented -->

Просмотреть файл

@ -2238,14 +2238,16 @@ namespace SimpleTesting
[TestMethod, TestCategory("Gated")]
public void ToEndEdgeFreeTest5()
{
var input = new StreamEvent<char>[] {
var input = new StreamEvent<char>[]
{
StreamEvent.CreateInterval(1, 2, 'a'),
StreamEvent.CreateInterval(2, 3, 'a'),
StreamEvent.CreateInterval(3, 4, 'b'),
StreamEvent.CreatePunctuation<char>(StreamEvent.InfinitySyncTime),
};
var expectedOutput = new StreamEvent<List<RankedEvent<char>>>[] {
var expectedOutput = new StreamEvent<List<RankedEvent<char>>>[]
{
StreamEvent.CreateInterval(1, 2, new List<RankedEvent<char>> { new RankedEvent<char>(1, 'a') }),
StreamEvent.CreateInterval(2, 3, new List<RankedEvent<char>> { new RankedEvent<char>(1, 'a') }),
StreamEvent.CreateInterval(3, 4, new List<RankedEvent<char>> { new RankedEvent<char>(1, 'b') }),

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -171,7 +171,8 @@ foreach (var diagnostic in new[] {string.Empty, "Diagnostic"})
while (queue.Peek() <= highmark - <#= lag #>)
{
current = queue.Dequeue();
if (current - lastPunc >= 10) {
if (current - lastPunc >= 10)
{
lastPunc = current;
return Tuple.Create(i, current);
}
@ -181,7 +182,8 @@ foreach (var diagnostic in new[] {string.Empty, "Diagnostic"})
while (queue.Count() > 0)
{
current = queue.Dequeue();
if (current - lastPunc >= 10) {
if (current - lastPunc >= 10)
{
lastPunc = current;
expectedPunctuations.Add(StreamEvent.CreatePunctuation<int>(((long)current).SnapToLeftBoundary(10)));
}
@ -198,7 +200,8 @@ foreach (var diagnostic in new[] {string.Empty, "Diagnostic"})
{
PopIndent(); #>
}
catch(Exception) {
catch(Exception)
{
<# if (dataDisorderAmount < lag)
{ #>
Assert.Fail("no exception should be thrown since disorder: <#= dataDisorderAmount #> is always less than lag: <#= lag #>.");
@ -235,7 +238,8 @@ foreach (var diagnostic in new[] {string.Empty, "Diagnostic"})
<# if (disorder == "Throw")
{ #>
try {
try
{
<# PushIndent(" ");
} #>
var ingress = disorderedInputData.ToObservable().ToTemporalStreamable(o => o.start, o => o.end,
@ -335,7 +339,8 @@ foreach (var diagnostic in new[] {string.Empty, "Diagnostic"})
while (queue.Peek() <= highmark - <#= lag #>)
{
current = queue.Dequeue();
if (current - lastPunc >= 10) {
if (current - lastPunc >= 10)
{
lastPunc = current;
return Tuple.Create(i.start, current);
}
@ -345,7 +350,8 @@ foreach (var diagnostic in new[] {string.Empty, "Diagnostic"})
while (queue.Count() > 0)
{
current = queue.Dequeue();
if (current - lastPunc >= 10) {
if (current - lastPunc >= 10)
{
lastPunc = current;
expectedPunctuations.Add(StreamEvent.CreatePunctuation<TestStruct>(((long)current).SnapToLeftBoundary(10)));
}
@ -361,7 +367,8 @@ foreach (var diagnostic in new[] {string.Empty, "Diagnostic"})
{
PopIndent(); #>
}
catch(Exception) {
catch(Exception)
{
<# if (dataDisorderAmount < lag)
{ #>
Assert.Fail("no exception should be thrown since disorder: <#= dataDisorderAmount #> is always less than lag: <#= lag #>.");

Просмотреть файл

@ -47,21 +47,24 @@ namespace SimpleTesting
{
var container = new QueryContainer(null);
var left = new StreamEvent<MyData>[] {
var left = new StreamEvent<MyData>[]
{
StreamEvent.CreatePoint(10, new MyData { field1 = 1, field2 = "A" }),
StreamEvent.CreatePoint(10, new MyData { field1 = 1, field2 = "B" }),
StreamEvent.CreatePoint(10, new MyData { field1 = 2, field2 = "D" }),
StreamEvent.CreatePoint(10, new MyData { field1 = 2, field2 = "E" })
};
var right = new StreamEvent<MyData2>[] {
var right = new StreamEvent<MyData2>[]
{
StreamEvent.CreatePoint(10, new MyData2 { field3 = 1, field4 = "W" }),
StreamEvent.CreatePoint(10, new MyData2 { field3 = 1, field4 = "X" }),
StreamEvent.CreatePoint(10, new MyData2 { field3 = 2, field4 = "Y" })
};
var output = new List<StreamEvent<MyData3>>();
var expected = new StreamEvent<MyData3>[] {
var expected = new StreamEvent<MyData3>[]
{
StreamEvent.CreatePoint(10, new MyData3 { field1 = 2, field2 = "E", field3 = -1, field4 = "null" }),
StreamEvent.CreatePoint(10, new MyData3 { field1 = 1, field2 = "B", field3 = 1, field4 = "W" }),
StreamEvent.CreatePoint(10, new MyData3 { field1 = 1, field2 = "A", field3 = 1, field4 = "W" }),
@ -106,21 +109,24 @@ namespace SimpleTesting
{
var container = new QueryContainer(null);
var left = new StreamEvent<MyData>[] {
var left = new StreamEvent<MyData>[]
{
StreamEvent.CreatePoint(10, new MyData { field1 = 1, field2 = "A" }),
StreamEvent.CreatePoint(10, new MyData { field1 = 1, field2 = "B" }),
StreamEvent.CreatePoint(10, new MyData { field1 = 2, field2 = "D" }),
StreamEvent.CreatePoint(10, new MyData { field1 = 2, field2 = "E" })
};
var right = new StreamEvent<MyData2>[] {
var right = new StreamEvent<MyData2>[]
{
StreamEvent.CreatePoint(10, new MyData2 { field3 = 1, field4 = "W" }),
StreamEvent.CreatePoint(10, new MyData2 { field3 = 1, field4 = "X" }),
StreamEvent.CreatePoint(10, new MyData2 { field3 = 2, field4 = "Y" })
};
var output = new List<StreamEvent<MyData3>>();
var expected = new StreamEvent<MyData3>[] {
var expected = new StreamEvent<MyData3>[]
{
StreamEvent.CreatePoint(10, new MyData3 { field1 = 2, field2 = "E", field3 = -1, field4 = "null" }),
StreamEvent.CreatePoint(10, new MyData3 { field1 = 1, field2 = "B", field3 = 1, field4 = "W" }),
StreamEvent.CreatePoint(10, new MyData3 { field1 = 1, field2 = "A", field3 = 1, field4 = "W" }),
@ -164,21 +170,24 @@ namespace SimpleTesting
{
var container = new QueryContainer(null);
var left = new StreamEvent<MyData>[] {
var left = new StreamEvent<MyData>[]
{
StreamEvent.CreatePoint(10, new MyData { field1 = 1, field2 = "A" }),
StreamEvent.CreatePoint(10, new MyData { field1 = 1, field2 = "B" }),
StreamEvent.CreatePoint(10, new MyData { field1 = 2, field2 = "D" }),
StreamEvent.CreatePoint(10, new MyData { field1 = 2, field2 = "E" })
};
var right = new StreamEvent<MyData2>[] {
var right = new StreamEvent<MyData2>[]
{
StreamEvent.CreatePoint(10, new MyData2 { field3 = 1, field4 = "W" }),
StreamEvent.CreatePoint(10, new MyData2 { field3 = 1, field4 = "X" }),
StreamEvent.CreatePoint(10, new MyData2 { field3 = 2, field4 = "Y" })
};
var output = new List<StreamEvent<MyData3>>();
var expected = new StreamEvent<MyData3>[] {
var expected = new StreamEvent<MyData3>[]
{
StreamEvent.CreatePoint(10, new MyData3 { field1 = 2, field2 = "E", field3 = -1, field4 = "null" }),
StreamEvent.CreatePoint(10, new MyData3 { field1 = 1, field2 = "B", field3 = 1, field4 = "W" }),
StreamEvent.CreatePoint(10, new MyData3 { field1 = 1, field2 = "A", field3 = 1, field4 = "W" }),
@ -223,21 +232,24 @@ namespace SimpleTesting
{
var container = new QueryContainer(null);
var left = new StreamEvent<MyData>[] {
var left = new StreamEvent<MyData>[]
{
StreamEvent.CreatePoint(10, new MyData { field1 = 1, field2 = "A" }),
StreamEvent.CreatePoint(10, new MyData { field1 = 1, field2 = "B" }),
StreamEvent.CreatePoint(10, new MyData { field1 = 2, field2 = "D" }),
StreamEvent.CreatePoint(10, new MyData { field1 = 2, field2 = "E" })
};
var right = new StreamEvent<MyData2>[] {
var right = new StreamEvent<MyData2>[]
{
StreamEvent.CreatePoint(10, new MyData2 { field3 = 1, field4 = "W" }),
StreamEvent.CreatePoint(10, new MyData2 { field3 = 1, field4 = "X" }),
StreamEvent.CreatePoint(10, new MyData2 { field3 = 2, field4 = "Y" })
};
var output = new List<StreamEvent<MyData3>>();
var expected = new StreamEvent<MyData3>[] {
var expected = new StreamEvent<MyData3>[]
{
StreamEvent.CreatePoint(10, new MyData3 { field1 = 2, field2 = "E", field3 = -1, field4 = "null" }),
StreamEvent.CreatePoint(10, new MyData3 { field1 = 1, field2 = "B", field3 = 1, field4 = "W" }),
StreamEvent.CreatePoint(10, new MyData3 { field1 = 1, field2 = "A", field3 = 1, field4 = "W" }),

Просмотреть файл

@ -71,21 +71,24 @@ foreach (var batch in new [] { string.Empty, "SmallBatch" })
{
var container = new QueryContainer(null);
var left = new StreamEvent<MyData>[] {
var left = new StreamEvent<MyData>[]
{
StreamEvent.CreatePoint(10, new MyData { field1 = 1, field2 = "A" }),
StreamEvent.CreatePoint(10, new MyData { field1 = 1, field2 = "B" }),
StreamEvent.CreatePoint(10, new MyData { field1 = 2, field2 = "D" }),
StreamEvent.CreatePoint(10, new MyData { field1 = 2, field2 = "E" })
};
var right = new StreamEvent<MyData2>[] {
var right = new StreamEvent<MyData2>[]
{
StreamEvent.CreatePoint(10, new MyData2 { field3 = 1, field4 = "W" }),
StreamEvent.CreatePoint(10, new MyData2 { field3 = 1, field4 = "X" }),
StreamEvent.CreatePoint(10, new MyData2 { field3 = 2, field4 = "Y" })
};
var output = new List<StreamEvent<MyData3>>();
var expected = new StreamEvent<MyData3>[] {
var expected = new StreamEvent<MyData3>[]
{
StreamEvent.CreatePoint(10, new MyData3 { field1 = 2, field2 = "E", field3 = -1, field4 = "null" }),
StreamEvent.CreatePoint(10, new MyData3 { field1 = 1, field2 = "B", field3 = 1, field4 = "W" }),
StreamEvent.CreatePoint(10, new MyData3 { field1 = 1, field2 = "A", field3 = 1, field4 = "W" }),

Просмотреть файл

@ -716,7 +716,8 @@ namespace SimpleTesting
public void AlterLifeTimeWithFlush()
{
var startDate = new DateTime(100);
var data = new[] {
var data = new[]
{
new { Time = startDate, DeviceId = 4, Value = 4 },
new { Time = startDate, DeviceId = 6, Value = 6 },
new { Time = startDate.AddMinutes(1), DeviceId = 6, Value = 6 },
@ -754,7 +755,8 @@ namespace SimpleTesting
public void AlterLifeTimeWithFlushDoubles()
{
var startDate = new DateTime(100);
var data = new[] {
var data = new[]
{
new { Time = startDate, DeviceId = 4, Value = 4 },
new { Time = startDate, DeviceId = 4, Value = 4 },
new { Time = startDate, DeviceId = 6, Value = 6 },

Просмотреть файл

@ -121,7 +121,8 @@ namespace SimpleTesting
stream.GetProperties(out StreamProperties<Empty, T> properties);
if (!properties.IsStartEdgeOnly)
{
var secondStream = new StreamEvent<T>[] {
var secondStream = new StreamEvent<T>[]
{
StreamEvent.CreateStart(StreamEvent.MaxSyncTime, default(T)),
StreamEvent.CreatePunctuation<T>(StreamEvent.InfinitySyncTime),
}.ToObservable().ToStreamable();
@ -317,13 +318,6 @@ namespace SimpleTesting
public StructWithCtor(int x) => this.f = x;
}
public class ClassWithNoFieldsButWithPublicProperties
{
private int x;
public int X { get => this.x; set => this.x = value; }
}
public abstract class TestWithConfigSettingsAndMemoryLeakDetection
{
private IDisposable confmod = null;

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -24,7 +24,8 @@ namespace SimpleTesting
{
public static class ClassWithNestedType1<T>
{
public class NestedType<U> {
public class NestedType<U>
{
public T x;
public U y;
}
@ -32,7 +33,8 @@ namespace SimpleTesting
public static class ClassWithNestedType2<T, U>
{
public class NestedType {
public class NestedType
{
public T x;
public U y;
}
@ -897,14 +899,16 @@ foreach (var disorderPolicy in (new [] { string.Empty, "Floating" }))
[TestMethod, TestCategory("Gated")]
public void ClipByConstantNoOpIntervals<#= suffix #>()
{
var input = new StreamEvent<char>[] {
var input = new StreamEvent<char>[]
{
StreamEvent.CreateInterval(1, 5, 'a'),
StreamEvent.CreateInterval(2, 6, 'b'),
StreamEvent.CreateInterval(3, 7, 'c'),
StreamEvent.CreateInterval(4, 8, 'd'),
StreamEvent.CreatePunctuation<char>(StreamEvent.InfinitySyncTime),
};
var expectedOutput = new StreamEvent<char>[] {
var expectedOutput = new StreamEvent<char>[]
{
StreamEvent.CreateInterval(1, 5, 'a'),
StreamEvent.CreateInterval(2, 6, 'b'),
StreamEvent.CreateInterval(3, 7, 'c'),
@ -921,7 +925,8 @@ foreach (var disorderPolicy in (new [] { string.Empty, "Floating" }))
[TestMethod, TestCategory("Gated")]
public void ClipByConstantNoOpEdges<#= suffix #>()
{
var input = new StreamEvent<char>[] {
var input = new StreamEvent<char>[]
{
StreamEvent.CreateStart(1, 'a'),
StreamEvent.CreateStart(2, 'b'),
StreamEvent.CreateStart(3, 'c'),
@ -932,7 +937,8 @@ foreach (var disorderPolicy in (new [] { string.Empty, "Floating" }))
StreamEvent.CreateEnd(8, 4, 'd'),
StreamEvent.CreatePunctuation<char>(StreamEvent.InfinitySyncTime),
};
var expectedOutput = new StreamEvent<char>[] {
var expectedOutput = new StreamEvent<char>[]
{
StreamEvent.CreateStart(1, 'a'),
StreamEvent.CreateStart(2, 'b'),
StreamEvent.CreateStart(3, 'c'),
@ -953,14 +959,16 @@ foreach (var disorderPolicy in (new [] { string.Empty, "Floating" }))
[TestMethod, TestCategory("Gated")]
public void ClipByConstantClippedIntervals<#= suffix #>()
{
var input = new StreamEvent<char>[] {
var input = new StreamEvent<char>[]
{
StreamEvent.CreateInterval(1, 15, 'a'),
StreamEvent.CreateInterval(2, 16, 'b'),
StreamEvent.CreateInterval(3, 17, 'c'),
StreamEvent.CreateInterval(4, 18, 'd'),
StreamEvent.CreatePunctuation<char>(StreamEvent.InfinitySyncTime),
};
var expectedOutput = new StreamEvent<char>[] {
var expectedOutput = new StreamEvent<char>[]
{
StreamEvent.CreateInterval(1, 11, 'a'),
StreamEvent.CreateInterval(2, 12, 'b'),
StreamEvent.CreateInterval(3, 13, 'c'),
@ -977,7 +985,8 @@ foreach (var disorderPolicy in (new [] { string.Empty, "Floating" }))
[TestMethod, TestCategory("Gated")]
public void ClipByConstantClippedEdges<#= suffix #>()
{
var input = new StreamEvent<char>[] {
var input = new StreamEvent<char>[]
{
StreamEvent.CreateStart(1, 'a'),
StreamEvent.CreateStart(2, 'b'),
StreamEvent.CreateStart(3, 'c'),
@ -988,7 +997,8 @@ foreach (var disorderPolicy in (new [] { string.Empty, "Floating" }))
StreamEvent.CreateEnd(8, 4, 'd'),
StreamEvent.CreatePunctuation<char>(StreamEvent.InfinitySyncTime),
};
var expectedOutput = new StreamEvent<char>[] {
var expectedOutput = new StreamEvent<char>[]
{
StreamEvent.CreateStart(1, 'a'),
StreamEvent.CreateStart(2, 'b'),
StreamEvent.CreateEnd(3, 1, 'a'),
@ -1010,14 +1020,16 @@ foreach (var disorderPolicy in (new [] { string.Empty, "Floating" }))
[TestMethod, TestCategory("Gated")]
public void DisorderPolicy1<#= suffix #>()
{
var input = new StreamEvent<char>[] {
var input = new StreamEvent<char>[]
{
StreamEvent.CreateStart(9, 'y'),
StreamEvent.CreateStart(5, 'x'),
StreamEvent.CreateEnd(20, 5, 'x'),
StreamEvent.CreateEnd(22, 9, 'y'),
StreamEvent.CreatePunctuation<char>(StreamEvent.InfinitySyncTime),
};
var expectedOutput = new StreamEvent<char>[] {
var expectedOutput = new StreamEvent<char>[]
{
StreamEvent.CreateStart(9, 'y'),
StreamEvent.CreateStart(9, 'x'),
StreamEvent.CreateEnd(20, 9, 'x'),
@ -1032,14 +1044,16 @@ foreach (var disorderPolicy in (new [] { string.Empty, "Floating" }))
[TestMethod, TestCategory("Gated")]
public void DisorderPolicy2<#= suffix #>()
{
var input = new StreamEvent<char>[] {
var input = new StreamEvent<char>[]
{
StreamEvent.CreateStart(9, 'y'),
StreamEvent.CreateStart(5, 'x'),
StreamEvent.CreateEnd(22, 9, 'y'),
StreamEvent.CreateEnd(24, 5, 'x'),
StreamEvent.CreatePunctuation<char>(StreamEvent.InfinitySyncTime),
};
var expectedOutput = new StreamEvent<char>[] {
var expectedOutput = new StreamEvent<char>[]
{
StreamEvent.CreateStart(9, 'y'),
StreamEvent.CreateStart(9, 'x'),
StreamEvent.CreateEnd(22, 9, 'y'),
@ -1054,14 +1068,16 @@ foreach (var disorderPolicy in (new [] { string.Empty, "Floating" }))
[TestMethod, TestCategory("Gated")]
public void DisorderPolicy3<#= suffix #>()
{
var input = new StreamEvent<char>[] {
var input = new StreamEvent<char>[]
{
StreamEvent.CreateStart(9, 'y'),
StreamEvent.CreateStart(5, 'x'),
StreamEvent.CreateEnd(22, 9, 'y'),
StreamEvent.CreateEnd(20, 5, 'x'),
StreamEvent.CreatePunctuation<char>(StreamEvent.InfinitySyncTime),
};
var expectedOutput = new StreamEvent<char>[] {
var expectedOutput = new StreamEvent<char>[]
{
StreamEvent.CreateStart(9, 'y'),
StreamEvent.CreateStart(9, 'x'),
StreamEvent.CreateEnd(22, 9, 'y'),
@ -1077,7 +1093,8 @@ foreach (var disorderPolicy in (new [] { string.Empty, "Floating" }))
[TestMethod, TestCategory("Gated")]
public void DisorderPolicy4<#= suffix #>()
{
var input = new StreamEvent<char>[] {
var input = new StreamEvent<char>[]
{
StreamEvent.CreateStart(5, 'x'),
StreamEvent.CreateStart(9, 'y'),
StreamEvent.CreateStart(5, 'x'),
@ -1093,7 +1110,8 @@ foreach (var disorderPolicy in (new [] { string.Empty, "Floating" }))
StreamEvent.CreateEnd(30, 5, 'x'),
StreamEvent.CreatePunctuation<char>(StreamEvent.InfinitySyncTime),
};
var expectedOutput = new StreamEvent<char>[] {
var expectedOutput = new StreamEvent<char>[]
{
StreamEvent.CreateStart(5, 'x'),
StreamEvent.CreateStart(9, 'y'),
StreamEvent.CreateStart(9, 'x'),
@ -1119,7 +1137,8 @@ foreach (var disorderPolicy in (new [] { string.Empty, "Floating" }))
[TestMethod, TestCategory("Gated")]
public void PunctuationPolicy2<#= suffix #>()
{
var input = new StreamEvent<char>[] {
var input = new StreamEvent<char>[]
{
StreamEvent.CreateStart(1, 'a'),
StreamEvent.CreateStart(2, 'b'),
StreamEvent.CreateStart(4, 'c'),
@ -1131,7 +1150,8 @@ foreach (var disorderPolicy in (new [] { string.Empty, "Floating" }))
StreamEvent.CreatePunctuation<char>(StreamEvent.InfinitySyncTime),
};
var expectedOutput = new StreamEvent<char>[] {
var expectedOutput = new StreamEvent<char>[]
{
StreamEvent.CreateStart(1, 'a'),
<# if (string.IsNullOrEmpty(disorderPolicy)) { #>
StreamEvent.CreatePunctuation<char>(2),
@ -1168,13 +1188,15 @@ foreach (var disorderPolicy in (new [] { string.Empty, "Floating" }))
[TestMethod, TestCategory("Gated")]
public void AlterDurationTest1<#= suffix #>()
{
var input = new StreamEvent<char>[] {
var input = new StreamEvent<char>[]
{
StreamEvent.CreateStart(3, 'x'),
StreamEvent.CreateEnd(5, 3, 'x'),
StreamEvent.CreateStart(7, 'y'),
StreamEvent.CreatePunctuation<char>(StreamEvent.InfinitySyncTime),
};
var expectedOutput = new StreamEvent<char>[] {
var expectedOutput = new StreamEvent<char>[]
{
StreamEvent.CreateInterval(3, 8, 'x'),
StreamEvent.CreateInterval(7, 12, 'y'),
StreamEvent.CreatePunctuation<char>(StreamEvent.InfinitySyncTime),
@ -1187,7 +1209,8 @@ foreach (var disorderPolicy in (new [] { string.Empty, "Floating" }))
[TestMethod, TestCategory("Gated")]
public void PunctuationPolicy3<#= suffix #>()
{ // Simulates the way Stat does ingress (but with 80K batches, not 3...)
var input = new StreamEvent<char>[] {
var input = new StreamEvent<char>[]
{
StreamEvent.CreateStart(StreamEvent.MinSyncTime, 'a'),
StreamEvent.CreateStart(StreamEvent.MinSyncTime, 'b'),
StreamEvent.CreateStart(StreamEvent.MinSyncTime, 'c'),
@ -1199,7 +1222,8 @@ foreach (var disorderPolicy in (new [] { string.Empty, "Floating" }))
StreamEvent.CreateStart(StreamEvent.MinSyncTime + 2, 'i'),
StreamEvent.CreatePunctuation<char>(StreamEvent.InfinitySyncTime),
};
var expectedOutput = new StreamEvent<char>[] {
var expectedOutput = new StreamEvent<char>[]
{
StreamEvent.CreateStart(StreamEvent.MinSyncTime, 'a'),
StreamEvent.CreateStart(StreamEvent.MinSyncTime, 'b'),
StreamEvent.CreateStart(StreamEvent.MinSyncTime, 'c'),
@ -1587,7 +1611,8 @@ foreach (var disorderPolicy in (new [] { string.Empty, "Floating" }))
[TestMethod, TestCategory("Gated")]
public void CountColumnar1<#= suffix #>()
{
var input = new StreamEvent<char>[] {
var input = new StreamEvent<char>[]
{
StreamEvent.CreateStart(StreamEvent.MinSyncTime, 'a'),
StreamEvent.CreateStart(StreamEvent.MinSyncTime, 'b'),
StreamEvent.CreateStart(StreamEvent.MinSyncTime, 'c'),
@ -1599,7 +1624,8 @@ foreach (var disorderPolicy in (new [] { string.Empty, "Floating" }))
StreamEvent.CreateStart(StreamEvent.MinSyncTime + 2, 'i'),
StreamEvent.CreatePunctuation<char>(StreamEvent.InfinitySyncTime),
};
var expected = new StreamEvent<ulong>[] {
var expected = new StreamEvent<ulong>[]
{
StreamEvent.CreateStart<ulong>(StreamEvent.MinSyncTime, 3),
StreamEvent.CreatePunctuation<ulong>(StreamEvent.MinSyncTime + 1),
StreamEvent.CreateEnd<ulong>(StreamEvent.MinSyncTime + 1, StreamEvent.MinSyncTime, 3),
@ -1619,7 +1645,8 @@ foreach (var disorderPolicy in (new [] { string.Empty, "Floating" }))
[TestMethod, TestCategory("Gated")]
public void AverageColumnar1<#= suffix #>() // tests codegen for Snapshot_noecq
{
var input = new StreamEvent<char>[] {
var input = new StreamEvent<char>[]
{
StreamEvent.CreateStart(StreamEvent.MinSyncTime, 'a'), // 97
StreamEvent.CreateStart(StreamEvent.MinSyncTime, 'b'), // 98
StreamEvent.CreateStart(StreamEvent.MinSyncTime, 'c'), // 99 running average = 98
@ -1633,7 +1660,8 @@ foreach (var disorderPolicy in (new [] { string.Empty, "Floating" }))
StreamEvent.CreateStart(StreamEvent.MinSyncTime + 2, 'i'), // 105 running average = 101
StreamEvent.CreatePunctuation<char>(StreamEvent.InfinitySyncTime),
};
var expected = new StreamEvent<double>[] {
var expected = new StreamEvent<double>[]
{
StreamEvent.CreateStart(StreamEvent.MinSyncTime, 98.0),
StreamEvent.CreatePunctuation<double>(StreamEvent.MinSyncTime + 1),
StreamEvent.CreateEnd(StreamEvent.MinSyncTime + 1, StreamEvent.MinSyncTime, 98.0),
@ -1657,7 +1685,8 @@ foreach (var disorderPolicy in (new [] { string.Empty, "Floating" }))
var one = StreamEvent.MinSyncTime + 1;
var two = StreamEvent.MinSyncTime + 2;
var three = StreamEvent.MinSyncTime + 3;
var input = new StreamEvent<char>[] {
var input = new StreamEvent<char>[]
{
StreamEvent.CreateInterval(zero, one, 'a'),
StreamEvent.CreateInterval(zero, one, 'b'),
StreamEvent.CreateInterval(zero, one, 'c'),
@ -1669,7 +1698,8 @@ foreach (var disorderPolicy in (new [] { string.Empty, "Floating" }))
StreamEvent.CreateInterval(two, three, 'i'),
StreamEvent.CreatePunctuation<char>(StreamEvent.InfinitySyncTime),
};
var expected = new StreamEvent<double>[] {
var expected = new StreamEvent<double>[]
{
StreamEvent.CreateInterval(zero, one, 98.0),
StreamEvent.CreatePunctuation<double>(one),
StreamEvent.CreateInterval(one, two, 101.0),
@ -1687,7 +1717,8 @@ foreach (var disorderPolicy in (new [] { string.Empty, "Floating" }))
[TestMethod, TestCategory("Gated")]
public void AverageColumnar3<#= suffix #>() // tests codegen for Snapshot_pq
{
var input = new StreamEvent<char>[] {
var input = new StreamEvent<char>[]
{
StreamEvent.CreateStart(StreamEvent.MinSyncTime, 'a'), // 97
StreamEvent.CreateStart(StreamEvent.MinSyncTime, 'b'), // 98
StreamEvent.CreateStart(StreamEvent.MinSyncTime, 'c'), // 99 running average = 98
@ -1701,7 +1732,8 @@ foreach (var disorderPolicy in (new [] { string.Empty, "Floating" }))
StreamEvent.CreateStart(StreamEvent.MinSyncTime + 2, 'i'), // 105 running average = 101
StreamEvent.CreatePunctuation<char>(StreamEvent.InfinitySyncTime),
};
var expected = new StreamEvent<double>[] {
var expected = new StreamEvent<double>[]
{
StreamEvent.CreateStart(StreamEvent.MinSyncTime, 98.0),
StreamEvent.CreatePunctuation<double>(StreamEvent.MinSyncTime + 1),
StreamEvent.CreateEnd(StreamEvent.MinSyncTime + 1, StreamEvent.MinSyncTime, 98.0),
@ -1773,7 +1805,8 @@ foreach (var disorderPolicy in (new [] { string.Empty, "Floating" }))
[TestMethod, TestCategory("Gated")]
public void ToEndEdgeFreeTest1<#= suffix #>()
{
var input = new StreamEvent<char>[] {
var input = new StreamEvent<char>[]
{
StreamEvent.CreateStart(1, 'a'),
StreamEvent.CreateStart(2, 'b'),
StreamEvent.CreateStart(3, 'c'),
@ -1784,7 +1817,8 @@ foreach (var disorderPolicy in (new [] { string.Empty, "Floating" }))
StreamEvent.CreateEnd(26, 4, 'd'),
StreamEvent.CreatePunctuation<char>(StreamEvent.InfinitySyncTime),
};
var expectedOutput = new StreamEvent<char>[] {
var expectedOutput = new StreamEvent<char>[]
{
StreamEvent.CreateInterval(1, 20, 'a'),
StreamEvent.CreateInterval(2, 22, 'b'),
StreamEvent.CreateInterval(3, 24, 'c'),
@ -1800,7 +1834,8 @@ foreach (var disorderPolicy in (new [] { string.Empty, "Floating" }))
[TestMethod, TestCategory("Gated")]
public void ToEndEdgeFreeTest2<#= suffix #>()
{
var input = new StreamEvent<char>[] {
var input = new StreamEvent<char>[]
{
StreamEvent.CreateStart(1, 'a'),
StreamEvent.CreateStart(2, 'b'),
StreamEvent.CreateStart(3, 'c'),
@ -1810,7 +1845,8 @@ foreach (var disorderPolicy in (new [] { string.Empty, "Floating" }))
StreamEvent.CreateEnd(26, 4, 'd'),
StreamEvent.CreatePunctuation<char>(StreamEvent.InfinitySyncTime),
};
var expectedOutput = new StreamEvent<char>[] {
var expectedOutput = new StreamEvent<char>[]
{
StreamEvent.CreateInterval(1, 20, 'a'),
StreamEvent.CreateStart(2, 'b'),
StreamEvent.CreateInterval(3, 24, 'c'),
@ -1826,7 +1862,8 @@ foreach (var disorderPolicy in (new [] { string.Empty, "Floating" }))
[TestMethod, TestCategory("Gated")]
public void ToEndEdgeFreeTest3<#= suffix #>()
{
var input = new StreamEvent<char>[] {
var input = new StreamEvent<char>[]
{
StreamEvent.CreateInterval(1, 20, 'a'),
StreamEvent.CreateStart(2, 'b'),
StreamEvent.CreateStart(3, 'c'),
@ -1836,7 +1873,8 @@ foreach (var disorderPolicy in (new [] { string.Empty, "Floating" }))
StreamEvent.CreateEnd(26, 3, 'c'),
StreamEvent.CreatePunctuation<char>(StreamEvent.InfinitySyncTime),
};
var expectedOutput = new StreamEvent<char>[] {
var expectedOutput = new StreamEvent<char>[]
{
StreamEvent.CreateInterval(1, 20, 'a'),
StreamEvent.CreateInterval(2, 22, 'b'),
StreamEvent.CreateInterval(3, 26, 'c'),
@ -1852,14 +1890,16 @@ foreach (var disorderPolicy in (new [] { string.Empty, "Floating" }))
[TestMethod, TestCategory("Gated")]
public void BinaryUnionTest1<#= suffix #>()
{
var input1 = new StreamEvent<char>[] {
var input1 = new StreamEvent<char>[]
{
StreamEvent.CreateInterval(2, 20, 'a'),
StreamEvent.CreateStart(4, 'b'),
StreamEvent.CreateStart(6, 'c'),
StreamEvent.CreateStart(8, 'd'),
StreamEvent.CreatePunctuation<char>(StreamEvent.InfinitySyncTime),
};
var input2 = new StreamEvent<char>[] {
var input2 = new StreamEvent<char>[]
{
StreamEvent.CreateInterval(3, 20, 'a'),
StreamEvent.CreateStart(5, 'b'),
StreamEvent.CreateStart(7, 'c'),
@ -1867,7 +1907,8 @@ foreach (var disorderPolicy in (new [] { string.Empty, "Floating" }))
StreamEvent.CreatePunctuation<char>(StreamEvent.InfinitySyncTime),
};
var expectedOutput = new StreamEvent<char>[] {
var expectedOutput = new StreamEvent<char>[]
{
StreamEvent.CreateInterval(2, 20, 'a'),
StreamEvent.CreateInterval(3, 20, 'a'),
StreamEvent.CreateStart(4, 'b'),
@ -1890,14 +1931,16 @@ foreach (var disorderPolicy in (new [] { string.Empty, "Floating" }))
[TestMethod, TestCategory("Gated")]
public void BinaryUnionTest2<#= suffix #>()
{
var input1 = new StreamEvent<char>[] {
var input1 = new StreamEvent<char>[]
{
StreamEvent.CreateInterval(1, 20, 'a'),
StreamEvent.CreateStart(2, 'b'),
StreamEvent.CreateStart(3, 'c'),
StreamEvent.CreateStart(4, 'd'),
StreamEvent.CreatePunctuation<char>(StreamEvent.InfinitySyncTime),
};
var input2 = new StreamEvent<char>[] {
var input2 = new StreamEvent<char>[]
{
StreamEvent.CreateInterval(5, 20, 'a'),
StreamEvent.CreateStart(6, 'b'),
StreamEvent.CreateStart(7, 'c'),
@ -1905,7 +1948,8 @@ foreach (var disorderPolicy in (new [] { string.Empty, "Floating" }))
StreamEvent.CreatePunctuation<char>(StreamEvent.InfinitySyncTime),
};
var expectedOutput = new StreamEvent<char>[] {
var expectedOutput = new StreamEvent<char>[]
{
StreamEvent.CreateInterval(1, 20, 'a'),
StreamEvent.CreateStart(2, 'b'),
StreamEvent.CreateStart(3, 'c'),
@ -1969,7 +2013,8 @@ foreach (var disorderPolicy in (new [] { string.Empty, "Floating" }))
[TestMethod, TestCategory("Gated")]
public void ToEndEdgeFreeTest4<#= suffix #>()
{
var input = new StreamEvent<char>[] {
var input = new StreamEvent<char>[]
{
StreamEvent.CreateStart(1, 'a'),
StreamEvent.CreateEnd(5, 1, 'a'),
StreamEvent.CreateStart(6, 'b'),
@ -1980,7 +2025,8 @@ foreach (var disorderPolicy in (new [] { string.Empty, "Floating" }))
StreamEvent.CreateEnd(20, 16, 'd'),
StreamEvent.CreatePunctuation<char>(StreamEvent.InfinitySyncTime),
};
var expectedOutput = new StreamEvent<char>[] {
var expectedOutput = new StreamEvent<char>[]
{
StreamEvent.CreateInterval(1, 5, 'a'),
StreamEvent.CreateInterval(6, 10, 'b'),
StreamEvent.CreateInterval(11, 15, 'c'),
@ -2000,7 +2046,8 @@ foreach (var disorderPolicy in (new [] { string.Empty, "Floating" }))
var stream = Events().ToEvents(e => e.Vs.Ticks, e => e.Vs.Ticks + threeSecondTicks)
.ToObservable()
.ToStreamable(DisorderPolicy.Adjust(), FlushPolicy.FlushOnPunctuation, PeriodicPunctuationPolicy.None());
var expectedResult = new StreamEvent<ResultEvent>[] {
var expectedResult = new StreamEvent<ResultEvent>[]
{
StreamEvent.CreateStart(633979008010000000, new ResultEvent { Key = 1, Cnt = 1 }),
StreamEvent.CreateEnd(633979008020000000, 633979008010000000, new ResultEvent { Key = 1, Cnt = 1 }),
StreamEvent.CreateStart(633979008020000000, new ResultEvent { Key = 1, Cnt = 2 }),

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -46,14 +46,16 @@ foreach (var batch in new [] { string.Empty, "SmallBatch" })
[TestMethod, TestCategory("Gated")]
public void TumblingSnapshot1<#= suffix #>()
{
var input = new StreamEvent<MyData>[] {
var input = new StreamEvent<MyData>[]
{
StreamEvent.CreatePoint(11, new MyData { field1 = 1, field2 = "A" }),
StreamEvent.CreatePoint(12, new MyData { field1 = 1, field2 = "A" }),
StreamEvent.CreatePoint(21, new MyData { field1 = 2, field2 = "D" }),
StreamEvent.CreatePoint(25, new MyData { field1 = 2, field2 = "D" })
};
var expected = new StreamEvent<MyData>[] {
var expected = new StreamEvent<MyData>[]
{
StreamEvent.CreateInterval(20, 30, new MyData { field1 = 2, field2 = "A" }),
StreamEvent.CreateInterval(30, 40, new MyData { field1 = 4, field2 = "D" })
};
@ -70,14 +72,16 @@ foreach (var batch in new [] { string.Empty, "SmallBatch" })
[TestMethod, TestCategory("Gated")]
public void TumblingSnapshot2<#= suffix #>()
{
var input = new StreamEvent<MyData>[] {
var input = new StreamEvent<MyData>[]
{
StreamEvent.CreatePoint(11, new MyData { field1 = 1, field2 = "A" }),
StreamEvent.CreatePoint(12, new MyData { field1 = 1, field2 = "A" }),
StreamEvent.CreatePoint(21, new MyData { field1 = 2, field2 = "A" }),
StreamEvent.CreatePoint(25, new MyData { field1 = 2, field2 = "D" })
};
var expected = new StreamEvent<MyData>[] {
var expected = new StreamEvent<MyData>[]
{
StreamEvent.CreateInterval(20, 30, new MyData { field1 = 2, field2 = "A" }),
StreamEvent.CreateInterval(30, 40, new MyData { field1 = 2, field2 = "D" }),
StreamEvent.CreateInterval(30, 40, new MyData { field1 = 2, field2 = "A" })
@ -96,14 +100,16 @@ foreach (var batch in new [] { string.Empty, "SmallBatch" })
public void TumblingSnapshot3<#= suffix #>()
{
var input = new StreamEvent<MyData>[] {
var input = new StreamEvent<MyData>[]
{
StreamEvent.CreatePoint(11, new MyData { field1 = 1, field2 = "A" }),
StreamEvent.CreatePoint(12, new MyData { field1 = 1, field2 = "A" }),
StreamEvent.CreatePoint(41, new MyData { field1 = 2, field2 = "A" }),
StreamEvent.CreatePoint(45, new MyData { field1 = 2, field2 = "D" })
};
var expected = new StreamEvent<MyData>[] {
var expected = new StreamEvent<MyData>[]
{
StreamEvent.CreateInterval(20, 30, new MyData { field1 = 2, field2 = "A" }),
StreamEvent.CreateInterval(50, 60, new MyData { field1 = 2, field2 = "D" }),
StreamEvent.CreateInterval(50, 60, new MyData { field1 = 2, field2 = "A" })
@ -121,14 +127,16 @@ foreach (var batch in new [] { string.Empty, "SmallBatch" })
[TestMethod, TestCategory("Gated")]
public void TumblingSnapshot4<#= suffix #>() // like 2, but without grouping
{
var input = new StreamEvent<MyData>[] {
var input = new StreamEvent<MyData>[]
{
StreamEvent.CreatePoint(11, new MyData { field1 = 1, field2 = "A" }),
StreamEvent.CreatePoint(12, new MyData { field1 = 1, field2 = "A" }),
StreamEvent.CreatePoint(21, new MyData { field1 = 2, field2 = "A" }),
StreamEvent.CreatePoint(25, new MyData { field1 = 2, field2 = "D" })
};
var expected = new StreamEvent<int>[] {
var expected = new StreamEvent<int>[]
{
StreamEvent.CreateInterval(20, 30, 2),
StreamEvent.CreateInterval(30, 40, 4),
};
@ -146,14 +154,16 @@ foreach (var batch in new [] { string.Empty, "SmallBatch" })
[TestMethod, TestCategory("Gated")]
public void HoppingSnapshot1<#= suffix #>()
{
var input = new StreamEvent<MyData>[] {
var input = new StreamEvent<MyData>[]
{
StreamEvent.CreatePoint(11, new MyData { field1 = 1, field2 = "A" }),
StreamEvent.CreatePoint(12, new MyData { field1 = 1, field2 = "A" }),
StreamEvent.CreatePoint(21, new MyData { field1 = 2, field2 = "D" }),
StreamEvent.CreatePoint(25, new MyData { field1 = 2, field2 = "D" })
};
var expected = new StreamEvent<MyData>[] {
var expected = new StreamEvent<MyData>[]
{
StreamEvent.CreateInterval(20, 40, new MyData { field1 = 2, field2 = "A" }),
StreamEvent.CreateInterval(30, 50, new MyData { field1 = 4, field2 = "D" })
};
@ -170,14 +180,16 @@ foreach (var batch in new [] { string.Empty, "SmallBatch" })
[TestMethod, TestCategory("Gated")]
public void HoppingSnapshot2<#= suffix #>()
{
var input = new StreamEvent<MyData>[] {
var input = new StreamEvent<MyData>[]
{
StreamEvent.CreatePoint(11, new MyData { field1 = 1, field2 = "A" }),
StreamEvent.CreatePoint(12, new MyData { field1 = 1, field2 = "A" }),
StreamEvent.CreatePoint(21, new MyData { field1 = 2, field2 = "A" }),
StreamEvent.CreatePoint(25, new MyData { field1 = 2, field2 = "D" })
};
var expected = new StreamEvent<MyData>[] {
var expected = new StreamEvent<MyData>[]
{
StreamEvent.CreateInterval(20, 30, new MyData { field1 = 2, field2 = "A" }),
StreamEvent.CreateInterval(30, 50, new MyData { field1 = 2, field2 = "D" }),
StreamEvent.CreateInterval(30, 40, new MyData { field1 = 4, field2 = "A" }),
@ -197,14 +209,16 @@ foreach (var batch in new [] { string.Empty, "SmallBatch" })
public void HoppingSnapshot3<#= suffix #>()
{
var input = new StreamEvent<MyData>[] {
var input = new StreamEvent<MyData>[]
{
StreamEvent.CreatePoint(11, new MyData { field1 = 1, field2 = "A" }),
StreamEvent.CreatePoint(12, new MyData { field1 = 1, field2 = "A" }),
StreamEvent.CreatePoint(41, new MyData { field1 = 2, field2 = "A" }),
StreamEvent.CreatePoint(45, new MyData { field1 = 2, field2 = "D" })
};
var expected = new StreamEvent<MyData>[] {
var expected = new StreamEvent<MyData>[]
{
StreamEvent.CreateInterval(20, 40, new MyData { field1 = 2, field2 = "A" }),
StreamEvent.CreateInterval(50, 70, new MyData { field1 = 2, field2 = "A" }),
StreamEvent.CreateInterval(50, 70, new MyData { field1 = 2, field2 = "D" })
@ -222,14 +236,16 @@ foreach (var batch in new [] { string.Empty, "SmallBatch" })
[TestMethod, TestCategory("Gated")]
public void HoppingSnapshot4<#= suffix #>() // like 2, but without grouping
{
var input = new StreamEvent<MyData>[] {
var input = new StreamEvent<MyData>[]
{
StreamEvent.CreatePoint(11, new MyData { field1 = 1, field2 = "A" }),
StreamEvent.CreatePoint(12, new MyData { field1 = 1, field2 = "A" }),
StreamEvent.CreatePoint(21, new MyData { field1 = 2, field2 = "A" }),
StreamEvent.CreatePoint(25, new MyData { field1 = 2, field2 = "D" })
};
var expected = new StreamEvent<int>[] {
var expected = new StreamEvent<int>[]
{
StreamEvent.CreateInterval(20, 30, 2),
StreamEvent.CreateInterval(30, 40, 6),
StreamEvent.CreateInterval(40, 50, 4),
@ -248,14 +264,16 @@ foreach (var batch in new [] { string.Empty, "SmallBatch" })
[TestMethod, TestCategory("Gated")]
public void SessionSnapshot1<#= suffix #>()
{
var input = new StreamEvent<MyData>[] {
var input = new StreamEvent<MyData>[]
{
StreamEvent.CreatePoint(11, new MyData { field1 = 1, field2 = "A" }),
StreamEvent.CreatePoint(12, new MyData { field1 = 1, field2 = "A" }),
StreamEvent.CreatePoint(21, new MyData { field1 = 2, field2 = "A" }),
StreamEvent.CreatePoint(25, new MyData { field1 = 2, field2 = "D" })
};
var expected = new StreamEvent<int>[] {
var expected = new StreamEvent<int>[]
{
StreamEvent.CreateInterval(11, 12, 1),
StreamEvent.CreateInterval(12, 21, 2),
StreamEvent.CreateInterval(21, 25, 4),
@ -275,14 +293,16 @@ foreach (var batch in new [] { string.Empty, "SmallBatch" })
[TestMethod, TestCategory("Gated")]
public void SessionSnapshot2<#= suffix #>()
{
var input = new StreamEvent<MyData>[] {
var input = new StreamEvent<MyData>[]
{
StreamEvent.CreatePoint(11, new MyData { field1 = 1, field2 = "A" }),
StreamEvent.CreatePoint(12, new MyData { field1 = 1, field2 = "A" }),
StreamEvent.CreatePoint(21, new MyData { field1 = 2, field2 = "A" }),
StreamEvent.CreatePoint(25, new MyData { field1 = 2, field2 = "D" })
};
var expected = new StreamEvent<int>[] {
var expected = new StreamEvent<int>[]
{
StreamEvent.CreateInterval(11, 12, 1),
StreamEvent.CreateInterval(12, 18, 2),
StreamEvent.CreateInterval(21, 25, 2),
@ -302,7 +322,8 @@ foreach (var batch in new [] { string.Empty, "SmallBatch" })
[TestMethod, TestCategory("Gated")]
public void SessionSnapshot3<#= suffix #>()
{
var input = new StreamEvent<MyData>[] {
var input = new StreamEvent<MyData>[]
{
StreamEvent.CreatePoint(11, new MyData { field1 = 1, field2 = "A" }),
StreamEvent.CreatePoint(12, new MyData { field1 = 1, field2 = "A" }),
StreamEvent.CreatePoint(21, new MyData { field1 = 2, field2 = "A" }),
@ -313,7 +334,8 @@ foreach (var batch in new [] { string.Empty, "SmallBatch" })
StreamEvent.CreatePoint(45, new MyData { field1 = 2, field2 = "D" })
};
var expected = new StreamEvent<int>[] {
var expected = new StreamEvent<int>[]
{
StreamEvent.CreateInterval(11, 12, 1),
StreamEvent.CreateInterval(12, 21, 2),
StreamEvent.CreateInterval(21, 25, 4),
@ -337,7 +359,8 @@ foreach (var batch in new [] { string.Empty, "SmallBatch" })
[TestMethod, TestCategory("Gated")]
public void SessionSnapshot4<#= suffix #>()
{
var input = new StreamEvent<MyData>[] {
var input = new StreamEvent<MyData>[]
{
StreamEvent.CreatePoint(11, new MyData { field1 = 1, field2 = "A" }),
StreamEvent.CreatePoint(12, new MyData { field1 = 1, field2 = "A" }),
StreamEvent.CreatePoint(21, new MyData { field1 = 2, field2 = "A" }),
@ -352,7 +375,8 @@ foreach (var batch in new [] { string.Empty, "SmallBatch" })
StreamEvent.CreatePoint(75, new MyData { field1 = 2, field2 = "D" }),
};
var expected = new StreamEvent<int>[] {
var expected = new StreamEvent<int>[]
{
StreamEvent.CreateInterval(11, 12, 1),
StreamEvent.CreateInterval(12, 21, 2),
StreamEvent.CreateInterval(21, 25, 4),
@ -380,7 +404,8 @@ foreach (var batch in new [] { string.Empty, "SmallBatch" })
[TestMethod, TestCategory("Gated")]
public void SessionSnapshot5<#= suffix #>()
{
var input = new StreamEvent<MyData>[] {
var input = new StreamEvent<MyData>[]
{
StreamEvent.CreatePoint(0, new MyData { field1 = 1, field2 = "A" }),
StreamEvent.CreatePoint(5, new MyData { field1 = 2, field2 = "D" }),
StreamEvent.CreatePoint(11, new MyData { field1 = 1, field2 = "A" }),
@ -397,7 +422,8 @@ foreach (var batch in new [] { string.Empty, "SmallBatch" })
StreamEvent.CreatePoint(75, new MyData { field1 = 2, field2 = "D" }),
};
var expected = new StreamEvent<int>[] {
var expected = new StreamEvent<int>[]
{
StreamEvent.CreateInterval(0, 5, 1),
StreamEvent.CreateInterval(5, 11, 3),
StreamEvent.CreateInterval(11, 12, 4),
@ -427,14 +453,16 @@ foreach (var batch in new [] { string.Empty, "SmallBatch" })
[TestMethod, TestCategory("Gated")]
public void SessionSnapshotTrivialGroup1<#= suffix #>()
{
var input = new StreamEvent<MyData>[] {
var input = new StreamEvent<MyData>[]
{
StreamEvent.CreatePoint(11, new MyData { field1 = 1, field2 = "A" }),
StreamEvent.CreatePoint(12, new MyData { field1 = 1, field2 = "A" }),
StreamEvent.CreatePoint(21, new MyData { field1 = 2, field2 = "A" }),
StreamEvent.CreatePoint(25, new MyData { field1 = 2, field2 = "D" })
};
var expected = new StreamEvent<int>[] {
var expected = new StreamEvent<int>[]
{
StreamEvent.CreateInterval(11, 12, 1),
StreamEvent.CreateInterval(12, 21, 2),
StreamEvent.CreateInterval(21, 25, 4),
@ -452,14 +480,16 @@ foreach (var batch in new [] { string.Empty, "SmallBatch" })
[TestMethod, TestCategory("Gated")]
public void SessionSnapshotTrivialGroup2<#= suffix #>()
{
var input = new StreamEvent<MyData>[] {
var input = new StreamEvent<MyData>[]
{
StreamEvent.CreatePoint(11, new MyData { field1 = 1, field2 = "A" }),
StreamEvent.CreatePoint(12, new MyData { field1 = 1, field2 = "A" }),
StreamEvent.CreatePoint(21, new MyData { field1 = 2, field2 = "A" }),
StreamEvent.CreatePoint(25, new MyData { field1 = 2, field2 = "D" })
};
var expected = new StreamEvent<int>[] {
var expected = new StreamEvent<int>[]
{
StreamEvent.CreateInterval(11, 12, 1),
StreamEvent.CreateInterval(12, 18, 2),
StreamEvent.CreateInterval(21, 25, 2),
@ -477,7 +507,8 @@ foreach (var batch in new [] { string.Empty, "SmallBatch" })
[TestMethod, TestCategory("Gated")]
public void SessionSnapshotTrivialGroup3<#= suffix #>()
{
var input = new StreamEvent<MyData>[] {
var input = new StreamEvent<MyData>[]
{
StreamEvent.CreatePoint(11, new MyData { field1 = 1, field2 = "A" }),
StreamEvent.CreatePoint(12, new MyData { field1 = 1, field2 = "A" }),
StreamEvent.CreatePoint(21, new MyData { field1 = 2, field2 = "A" }),
@ -488,7 +519,8 @@ foreach (var batch in new [] { string.Empty, "SmallBatch" })
StreamEvent.CreatePoint(45, new MyData { field1 = 2, field2 = "D" })
};
var expected = new StreamEvent<int>[] {
var expected = new StreamEvent<int>[]
{
StreamEvent.CreateInterval(11, 12, 1),
StreamEvent.CreateInterval(12, 21, 2),
StreamEvent.CreateInterval(21, 25, 4),
@ -510,7 +542,8 @@ foreach (var batch in new [] { string.Empty, "SmallBatch" })
[TestMethod, TestCategory("Gated")]
public void SessionSnapshotTrivialGroup4<#= suffix #>()
{
var input = new StreamEvent<MyData>[] {
var input = new StreamEvent<MyData>[]
{
StreamEvent.CreatePoint(11, new MyData { field1 = 1, field2 = "A" }),
StreamEvent.CreatePoint(12, new MyData { field1 = 1, field2 = "A" }),
StreamEvent.CreatePoint(21, new MyData { field1 = 2, field2 = "A" }),
@ -525,7 +558,8 @@ foreach (var batch in new [] { string.Empty, "SmallBatch" })
StreamEvent.CreatePoint(75, new MyData { field1 = 2, field2 = "D" }),
};
var expected = new StreamEvent<int>[] {
var expected = new StreamEvent<int>[]
{
StreamEvent.CreateInterval(11, 12, 1),
StreamEvent.CreateInterval(12, 21, 2),
StreamEvent.CreateInterval(21, 25, 4),
@ -551,14 +585,16 @@ foreach (var batch in new [] { string.Empty, "SmallBatch" })
[TestMethod, TestCategory("Gated")]
public void SessionSnapshotSimpleGroup1<#= suffix #>()
{
var input = new StreamEvent<MyData>[] {
var input = new StreamEvent<MyData>[]
{
StreamEvent.CreatePoint(11, new MyData { field1 = 1, field2 = "A" }),
StreamEvent.CreatePoint(12, new MyData { field1 = 1, field2 = "A" }),
StreamEvent.CreatePoint(21, new MyData { field1 = 2, field2 = "A" }),
StreamEvent.CreatePoint(25, new MyData { field1 = 2, field2 = "D" })
};
var expected = new StreamEvent<MyData>[] {
var expected = new StreamEvent<MyData>[]
{
StreamEvent.CreateInterval(11, 12, new MyData { field1 = 1, field2 = "A" }),
StreamEvent.CreateInterval(12, 21, new MyData { field1 = 2, field2 = "A" }),
StreamEvent.CreateInterval(21, 71, new MyData { field1 = 4, field2 = "A" }),
@ -576,14 +612,16 @@ foreach (var batch in new [] { string.Empty, "SmallBatch" })
[TestMethod, TestCategory("Gated")]
public void SessionSnapshotSimpleGroup2<#= suffix #>()
{
var input = new StreamEvent<MyData>[] {
var input = new StreamEvent<MyData>[]
{
StreamEvent.CreatePoint(11, new MyData { field1 = 1, field2 = "A" }),
StreamEvent.CreatePoint(12, new MyData { field1 = 1, field2 = "A" }),
StreamEvent.CreatePoint(21, new MyData { field1 = 2, field2 = "A" }),
StreamEvent.CreatePoint(25, new MyData { field1 = 2, field2 = "D" })
};
var expected = new StreamEvent<MyData>[] {
var expected = new StreamEvent<MyData>[]
{
StreamEvent.CreateInterval(11, 12, new MyData { field1 = 1, field2 = "A" }),
StreamEvent.CreateInterval(12, 18, new MyData { field1 = 2, field2 = "A" }),
StreamEvent.CreateInterval(21, 27, new MyData { field1 = 2, field2 = "A" }),
@ -601,7 +639,8 @@ foreach (var batch in new [] { string.Empty, "SmallBatch" })
[TestMethod, TestCategory("Gated")]
public void SessionSnapshotSimpleGroup3<#= suffix #>()
{
var input = new StreamEvent<MyData>[] {
var input = new StreamEvent<MyData>[]
{
StreamEvent.CreatePoint(11, new MyData { field1 = 1, field2 = "A" }),
StreamEvent.CreatePoint(12, new MyData { field1 = 1, field2 = "A" }),
StreamEvent.CreatePoint(21, new MyData { field1 = 2, field2 = "A" }),
@ -612,7 +651,8 @@ foreach (var batch in new [] { string.Empty, "SmallBatch" })
StreamEvent.CreatePoint(45, new MyData { field1 = 2, field2 = "D" })
};
var expected = new StreamEvent<MyData>[] {
var expected = new StreamEvent<MyData>[]
{
StreamEvent.CreateInterval(11, 12, new MyData { field1 = 1, field2 = "A" }),
StreamEvent.CreateInterval(12, 21, new MyData { field1 = 2, field2 = "A" }),
StreamEvent.CreateInterval(21, 31, new MyData { field1 = 4, field2 = "A" }),
@ -634,7 +674,8 @@ foreach (var batch in new [] { string.Empty, "SmallBatch" })
[TestMethod, TestCategory("Gated")]
public void SessionSnapshotSimpleGroup4<#= suffix #>()
{
var input = new StreamEvent<MyData>[] {
var input = new StreamEvent<MyData>[]
{
StreamEvent.CreatePoint(11, new MyData { field1 = 1, field2 = "A" }),
StreamEvent.CreatePoint(12, new MyData { field1 = 1, field2 = "A" }),
StreamEvent.CreatePoint(21, new MyData { field1 = 2, field2 = "A" }),
@ -649,7 +690,8 @@ foreach (var batch in new [] { string.Empty, "SmallBatch" })
StreamEvent.CreatePoint(75, new MyData { field1 = 2, field2 = "D" }),
};
var expected = new StreamEvent<MyData>[] {
var expected = new StreamEvent<MyData>[]
{
StreamEvent.CreateInterval(11, 12, new MyData { field1 = 1, field2 = "A" }),
StreamEvent.CreateInterval(12, 21, new MyData { field1 = 2, field2 = "A" }),
StreamEvent.CreateInterval(21, 31, new MyData { field1 = 4, field2 = "A" }),

Просмотреть файл

@ -110,7 +110,8 @@ namespace SimpleTesting
.Where(e => e.IsData)
.ToEnumerable()
;
var expected = new StreamEvent<Empty>[] {
var expected = new StreamEvent<Empty>[]
{
StreamEvent.CreateInterval(2, 10, Empty.Default),
};
Assert.IsTrue(result.SequenceEqual(expected));
@ -123,11 +124,12 @@ namespace SimpleTesting
pat1.AddListElementArc(1, 1, fence: (ts, events, reg) => !events.Any(p => p.Field2 == 1));
pat1.AddListElementArc(1, 2, fence: (ts, events, reg) => events.Any(p => p.Field2 == 1));
var input = new StreamEvent<AfaPayload>[] {
var input = new StreamEvent<AfaPayload>[]
{
StreamEvent.CreatePoint(100, new AfaPayload { Field1 = "A", Field2 = 0 }),
StreamEvent.CreatePoint(110, new AfaPayload { Field1 = "C", Field2 = 0 }),
StreamEvent.CreatePoint(140, new AfaPayload { Field1 = "B", Field2 = 1 }),
};
};
var result = input
.ToObservable()
.ToStreamable()
@ -138,7 +140,8 @@ namespace SimpleTesting
.Where(e => e.IsData)
.ToEnumerable()
;
var expected = new StreamEvent<Empty>[] {
var expected = new StreamEvent<Empty>[]
{
StreamEvent.CreateInterval(140, 1100, Empty.Default),
};
Assert.IsTrue(result.SequenceEqual(expected));
@ -175,7 +178,8 @@ namespace SimpleTesting
.ToEnumerable()
.ToArray()
;
var expected = new StreamEvent<Empty>[] {
var expected = new StreamEvent<Empty>[]
{
StreamEvent.CreateInterval(2, 10, Empty.Default),
};
Assert.IsTrue(result.SequenceEqual(expected));
@ -200,8 +204,7 @@ namespace SimpleTesting
fence: (ts, acc, reg) => acc);
var result =
new Tuple<int, int>[] {
Tuple.Create(0, 0), Tuple.Create(0, 0), Tuple.Create(1, 1), }
new Tuple<int, int>[] { Tuple.Create(0, 0), Tuple.Create(0, 0), Tuple.Create(1, 1) }
.Select(e => StreamEvent.CreatePoint<long>(e.Item1, e.Item2))
.ToObservable()
.ToStreamable()
@ -213,9 +216,7 @@ namespace SimpleTesting
.ToEnumerable()
;
var x = result.ToArray();
var expected = new StreamEvent<Empty>[] {
StreamEvent.CreateInterval(1, 10, Empty.Default),
};
var expected = new StreamEvent<Empty>[] { StreamEvent.CreateInterval(1, 10, Empty.Default) };
Assert.IsTrue(result.SequenceEqual(expected));
}
@ -257,9 +258,7 @@ namespace SimpleTesting
.ToEnumerable()
.ToArray()
;
var expected = new StreamEvent<Empty>[] {
StreamEvent.CreateInterval(3, 11, Empty.Default),
};
var expected = new StreamEvent<Empty>[] { StreamEvent.CreateInterval(3, 11, Empty.Default) };
Assert.IsTrue(result.SequenceEqual(expected));
}
@ -299,15 +298,14 @@ namespace SimpleTesting
.ToEnumerable()
.ToArray()
;
var expected = new StreamEvent<Empty>[] {
StreamEvent.CreateInterval(3, 11, Empty.Default),
};
var expected = new StreamEvent<Empty>[] { StreamEvent.CreateInterval(3, 11, Empty.Default) };
Assert.IsTrue(result.SequenceEqual(expected));
}
public static void AfaDefinePattern01()
{
var source1 = new StreamEvent<AfaPayload>[] {
var source1 = new StreamEvent<AfaPayload>[]
{
StreamEvent.CreatePoint(100, new AfaPayload { Field1 = "A", Field2 = 4 }),
StreamEvent.CreatePoint(110, new AfaPayload { Field1 = "C", Field2 = 3 }),
StreamEvent.CreatePoint(120, new AfaPayload { Field1 = "A", Field2 = 1 }),
@ -329,7 +327,8 @@ namespace SimpleTesting
.ToEnumerable()
.ToArray();
var expected = new StreamEvent<int>[] {
var expected = new StreamEvent<int>[]
{
StreamEvent.CreateInterval(110, 1100, 0),
StreamEvent.CreateInterval(150, 1120, 14),
};
@ -339,7 +338,8 @@ namespace SimpleTesting
public static void AfaDefinePattern02()
{
var source1 = new StreamEvent<AfaPayload>[] {
var source1 = new StreamEvent<AfaPayload>[]
{
StreamEvent.CreatePoint(100, new AfaPayload { Field1 = "A", Field2 = 4 }),
StreamEvent.CreatePoint(110, new AfaPayload { Field1 = "C", Field2 = 3 }),
StreamEvent.CreatePoint(120, new AfaPayload { Field1 = "A", Field2 = 1 }),
@ -361,7 +361,8 @@ namespace SimpleTesting
.ToArray()
;
var expected = new StreamEvent<int>[] {
var expected = new StreamEvent<int>[]
{
StreamEvent.CreateInterval(110, 1100, 0),
StreamEvent.CreateInterval(150, 1120, 14),
};
@ -371,7 +372,8 @@ namespace SimpleTesting
public static void AfaDefinePattern03()
{
var source1 = new StreamEvent<AfaPayload>[] {
var source1 = new StreamEvent<AfaPayload>[]
{
StreamEvent.CreatePoint(100, new AfaPayload { Field1 = "A", Field2 = 4 }),
StreamEvent.CreatePoint(110, new AfaPayload { Field1 = "C", Field2 = 3 }),
StreamEvent.CreatePoint(120, new AfaPayload { Field1 = "A", Field2 = 1 }),
@ -392,7 +394,8 @@ namespace SimpleTesting
.ToArray()
;
var expected = new StreamEvent<int>[] {
var expected = new StreamEvent<int>[]
{
StreamEvent.CreateInterval(110, 1100, 17),
};
Assert.IsTrue(result.SequenceEqual(expected));
@ -401,7 +404,8 @@ namespace SimpleTesting
public static void AfaPatternAiBi01()
{
var source1 = new StreamEvent<AfaPayload>[] {
var source1 = new StreamEvent<AfaPayload>[]
{
StreamEvent.CreatePoint(100, new AfaPayload { Field1 = "A", Field2 = 4 }),
StreamEvent.CreatePoint(110, new AfaPayload { Field1 = "A", Field2 = 3 }),
StreamEvent.CreatePoint(120, new AfaPayload { Field1 = "A", Field2 = 1 }),
@ -421,7 +425,8 @@ namespace SimpleTesting
.ToEnumerable()
.ToArray()
;
var expected = new StreamEvent<int>[] {
var expected = new StreamEvent<int>[]
{
StreamEvent.CreateInterval(130, 1120, 1),
StreamEvent.CreateInterval(140, 1110, 1),
StreamEvent.CreateInterval(150, 1100, 1),
@ -431,7 +436,8 @@ namespace SimpleTesting
public static void AfaPatternAiBi02()
{
var source1 = new StreamEvent<AfaPayload>[] {
var source1 = new StreamEvent<AfaPayload>[]
{
StreamEvent.CreatePoint(100, new AfaPayload { Field1 = "A", Field2 = 4 }),
StreamEvent.CreatePoint(110, new AfaPayload { Field1 = "A", Field2 = 3 }),
StreamEvent.CreatePoint(120, new AfaPayload { Field1 = "A", Field2 = 1 }),
@ -452,7 +458,8 @@ namespace SimpleTesting
.ToEnumerable()
.ToArray()
;
var expected = new StreamEvent<int>[] {
var expected = new StreamEvent<int>[]
{
StreamEvent.CreateInterval(150, 1100, 1),
};
Assert.IsTrue(result.SequenceEqual(expected));

Просмотреть файл

@ -23,7 +23,8 @@ namespace SimpleTesting
public void ExtendTest1()
{
// nothing interesting happens here
var inputList = new[] {
var inputList = new[]
{
StreamEvent.CreateStart(1, "A"),
StreamEvent.CreateEnd(2, 1, "A"),
StreamEvent.CreateStart(2, "A"),
@ -34,7 +35,8 @@ namespace SimpleTesting
StreamEvent.CreateEnd(5, 4, "A")
};
var compareTo = new[] {
var compareTo = new[]
{
StreamEvent.CreateStart(1, "A"),
StreamEvent.CreateStart(2, "A"),
StreamEvent.CreateStart(3, "A"),
@ -67,7 +69,8 @@ namespace SimpleTesting
public void ExtendTest2()
{
// nothing interesting happens here
var inputList = new[] {
var inputList = new[]
{
StreamEvent.CreateInterval(1, 5, "A"),
StreamEvent.CreateInterval(2, 10, "A"),
StreamEvent.CreateInterval(3, 8, "A"),
@ -75,7 +78,8 @@ namespace SimpleTesting
StreamEvent.CreateInterval(8, 9, "A"),
};
var compareTo = new[] {
var compareTo = new[]
{
StreamEvent.CreateInterval(1, 15, "A"),
StreamEvent.CreateInterval(2, 20, "A"),
StreamEvent.CreateInterval(3, 18, "A"),
@ -98,7 +102,8 @@ namespace SimpleTesting
{
var payload = StructTuple.Create("A", 3);
// nothing interesting happens here
var inputList = new[] {
var inputList = new[]
{
StreamEvent.CreateInterval(1, 5, payload),
StreamEvent.CreateInterval(2, 10, payload),
StreamEvent.CreateInterval(3, 8, payload),
@ -106,7 +111,8 @@ namespace SimpleTesting
StreamEvent.CreateInterval(8, 9, payload),
};
var compareTo = new StreamEvent<StructTuple<string, int>>[] {
var compareTo = new StreamEvent<StructTuple<string, int>>[]
{
StreamEvent.CreateInterval(1, 15, payload),
StreamEvent.CreateInterval(2, 20, payload),
StreamEvent.CreateInterval(3, 18, payload),
@ -125,7 +131,8 @@ namespace SimpleTesting
public void ExtendTestNegative1()
{
// nothing interesting happens here
var inputList = new[] {
var inputList = new[]
{
StreamEvent.CreateStart(1, "A"),
StreamEvent.CreateStart(2, "A"),
StreamEvent.CreateStart(3, "A"),
@ -136,7 +143,8 @@ namespace SimpleTesting
StreamEvent.CreateEnd(8, 4, "A"),
};
var compareTo = new[] {
var compareTo = new[]
{
StreamEvent.CreateStart(1, "A"),
StreamEvent.CreateEnd(2, 1, "A"),
StreamEvent.CreateStart(2, "A"),
@ -158,7 +166,8 @@ namespace SimpleTesting
public void ExtendTestNegative2()
{
// nothing interesting happens here
var inputList = new[] {
var inputList = new[]
{
StreamEvent.CreateInterval(1, 15, "A"),
StreamEvent.CreateInterval(2, 20, "A"),
StreamEvent.CreateInterval(3, 18, "A"),
@ -166,7 +175,8 @@ namespace SimpleTesting
StreamEvent.CreateInterval(8, 19, "A"),
};
var compareTo = new[] {
var compareTo = new[]
{
StreamEvent.CreateInterval(1, 5, "A"),
StreamEvent.CreateInterval(2, 10, "A"),
StreamEvent.CreateInterval(3, 8, "A"),
@ -185,7 +195,8 @@ namespace SimpleTesting
public void ExtendTestNegative3()
{
// nothing interesting happens here
var inputList = new[] {
var inputList = new[]
{
StreamEvent.CreateStart(1, "A"),
StreamEvent.CreateStart(2, "A"),
StreamEvent.CreateStart(3, "A"),
@ -196,7 +207,8 @@ namespace SimpleTesting
StreamEvent.CreateEnd(18, 4, "A"),
};
var compareTo = new[] {
var compareTo = new[]
{
StreamEvent.CreateStart(3, "A"),
StreamEvent.CreateStart(4, "A"),
StreamEvent.CreateEnd(7, 3, "A"),
@ -214,7 +226,8 @@ namespace SimpleTesting
public void ExtendTestNegative4()
{
// nothing interesting happens here
var inputList = new[] {
var inputList = new[]
{
StreamEvent.CreateInterval(1, 15, "A"),
StreamEvent.CreateInterval(2, 20, "A"),
StreamEvent.CreateInterval(3, 18, "A"),
@ -222,7 +235,8 @@ namespace SimpleTesting
StreamEvent.CreateInterval(8, 19, "A"),
};
var compareTo = new[] {
var compareTo = new[]
{
StreamEvent.CreateInterval(2, 5, "A"),
END
};
@ -241,7 +255,8 @@ namespace SimpleTesting
{
var payload = StructTuple.Create("A", 3);
// nothing interesting happens here
var inputList = new[] {
var inputList = new[]
{
StreamEvent.CreateInterval(1, 15, payload),
StreamEvent.CreateInterval(2, 20, payload),
StreamEvent.CreateInterval(3, 18, payload),
@ -249,7 +264,8 @@ namespace SimpleTesting
StreamEvent.CreateInterval(8, 19, payload),
};
var compareTo = new[] {
var compareTo = new[]
{
StreamEvent.CreateInterval(2, 5, payload),
END2
};

Просмотреть файл

@ -23,7 +23,8 @@ namespace SimpleTesting
public void PointAtEndTest1()
{
// nothing interesting happens here
var inputList = new[] {
var inputList = new[]
{
StreamEvent.CreateStart(1, "A"),
StreamEvent.CreateEnd(2, 1, "A"),
StreamEvent.CreateStart(2, "A"),
@ -34,7 +35,8 @@ namespace SimpleTesting
StreamEvent.CreateEnd(5, 4, "A")
};
var compareTo = new[] {
var compareTo = new[]
{
StreamEvent.CreatePoint(2, "A"),
StreamEvent.CreatePoint(3, "A"),
StreamEvent.CreatePoint(4, "A"),
@ -52,7 +54,8 @@ namespace SimpleTesting
public void PointAtEndTest2()
{
// nothing interesting happens here
var inputList = new[] {
var inputList = new[]
{
StreamEvent.CreateInterval(1, 5, "A"),
StreamEvent.CreateInterval(2, 10, "A"),
StreamEvent.CreateInterval(3, 8, "A"),
@ -60,7 +63,8 @@ namespace SimpleTesting
StreamEvent.CreateInterval(8, 9, "A"),
};
var compareTo = new[] {
var compareTo = new[]
{
StreamEvent.CreatePoint(5, "A"),
StreamEvent.CreatePoint(6, "A"),
StreamEvent.CreatePoint(8, "A"),
@ -88,7 +92,8 @@ namespace SimpleTesting
public void PointAtEndTest3()
{
// nothing interesting happens here
var inputList = new[] {
var inputList = new[]
{
StreamEvent.CreateStart(1, "A"),
StreamEvent.CreateEnd(2, 1, "A"),
StreamEvent.CreateStart(2, "A"),
@ -99,7 +104,8 @@ namespace SimpleTesting
StreamEvent.CreateEnd(5, 4, "A")
};
var compareTo = new[] {
var compareTo = new[]
{
StreamEvent.CreatePoint(101, "A"),
StreamEvent.CreatePoint(102, "A"),
StreamEvent.CreatePoint(103, "A"),
@ -122,7 +128,8 @@ namespace SimpleTesting
{
var payload = StructTuple.Create("A", 3);
// nothing interesting happens here
var inputList = new[] {
var inputList = new[]
{
StreamEvent.CreateStart(1, payload),
StreamEvent.CreateEnd(2, 1, payload),
StreamEvent.CreateStart(2, payload),
@ -133,7 +140,8 @@ namespace SimpleTesting
StreamEvent.CreateEnd(5, 4, payload)
};
var compareTo = new StreamEvent<StructTuple<string, int>>[] {
var compareTo = new StreamEvent<StructTuple<string, int>>[]
{
StreamEvent.CreatePoint(2, payload),
StreamEvent.CreatePoint(3, payload),
StreamEvent.CreatePoint(4, payload),
@ -155,7 +163,8 @@ namespace SimpleTesting
{
var payload = StructTuple.Create("A", 3);
// nothing interesting happens here
var inputList = new[] {
var inputList = new[]
{
StreamEvent.CreateInterval(1, 5, payload),
StreamEvent.CreateInterval(2, 10, payload),
StreamEvent.CreateInterval(3, 8, payload),
@ -163,7 +172,8 @@ namespace SimpleTesting
StreamEvent.CreateInterval(8, 9, payload),
};
var compareTo = new StreamEvent<StructTuple<string, int>>[] {
var compareTo = new StreamEvent<StructTuple<string, int>>[]
{
StreamEvent.CreatePoint(5, payload),
StreamEvent.CreatePoint(6, payload),
StreamEvent.CreatePoint(8, payload),
@ -186,7 +196,8 @@ namespace SimpleTesting
{
var payload = StructTuple.Create("A", 3);
// nothing interesting happens here
var inputList = new[] {
var inputList = new[]
{
StreamEvent.CreateStart(1, payload),
StreamEvent.CreateEnd(2, 1, payload),
StreamEvent.CreateStart(2, payload),
@ -197,7 +208,8 @@ namespace SimpleTesting
StreamEvent.CreateEnd(5, 4, payload)
};
var compareTo = new StreamEvent<StructTuple<string, int>>[] {
var compareTo = new StreamEvent<StructTuple<string, int>>[]
{
StreamEvent.CreatePoint(101, payload),
StreamEvent.CreatePoint(102, payload),
StreamEvent.CreatePoint(103, payload),

Просмотреть файл

@ -24,7 +24,8 @@ namespace SimpleTesting
public static void StitchTestMultisetMultiStart()
{
// nothing interesting happens here
var inputList = new[] {
var inputList = new[]
{
StreamEvent.CreateStart(1, "A"),
StreamEvent.CreateStart(2, "A"),
StreamEvent.CreateEnd(3, 2, "A"),
@ -36,7 +37,8 @@ namespace SimpleTesting
StreamEvent.CreateEnd(7, 4, "A")
};
var compareTo = new[] {
var compareTo = new[]
{
StreamEvent.CreateStart(1, "A"),
StreamEvent.CreateStart(2, "A"),
StreamEvent.CreateEnd(6, 1, "A"), // 6->5->1
@ -64,7 +66,8 @@ namespace SimpleTesting
var input = inputList.ToObservable().ToStreamable();
var outputStream = input.Stitch();
var compareTo = new[] {
var compareTo = new[]
{
StreamEvent.CreateStart(1, "A"),
StreamEvent.CreateStart(2, "B"),
StreamEvent.CreateEnd(3, 1, "A"),
@ -79,7 +82,8 @@ namespace SimpleTesting
public void StitchTestSimpleSplice()
{
// nothing interesting happens here
var inputList = new[] {
var inputList = new[]
{
StreamEvent.CreateStart(1, "A"),
StreamEvent.CreateEnd(2, 1, "A"),
StreamEvent.CreateStart(2, "A"),
@ -90,7 +94,8 @@ namespace SimpleTesting
StreamEvent.CreateEnd(5, 4, "A")
};
var compareTo = new[] {
var compareTo = new[]
{
StreamEvent.CreateStart(1, "A"),
StreamEvent.CreateEnd(5, 1, "A"),
END
@ -106,7 +111,8 @@ namespace SimpleTesting
public void StitchTestMultisetOneStart()
{
// Two different start times
var inputList = new[] {
var inputList = new[]
{
StreamEvent.CreateStart(1, "A"),
StreamEvent.CreateStart(1, "A"),
StreamEvent.CreateEnd(2, 1, "A"),
@ -119,7 +125,8 @@ namespace SimpleTesting
StreamEvent.CreateEnd(6, 1, "A")
};
var compareTo = new[] {
var compareTo = new[]
{
StreamEvent.CreateStart(1, "A"),
StreamEvent.CreateStart(1, "A"),
StreamEvent.CreateEnd(5, 1, "A"), // 5->4->3->2->1
@ -138,7 +145,8 @@ namespace SimpleTesting
public void StitchTestMultisetExtraSlowStart()
{
// Two different start times
var inputList = new[] {
var inputList = new[]
{
StreamEvent.CreateStart(1, "A"),
StreamEvent.CreateStart(1, "A"),
StreamEvent.CreateStart(1, "A"),
@ -159,7 +167,8 @@ namespace SimpleTesting
StreamEvent.CreateEnd(6, 1, "A")
};
var compareTo = new[] {
var compareTo = new[]
{
StreamEvent.CreateStart(1, "A"),
StreamEvent.CreateStart(1, "A"),
StreamEvent.CreateStart(1, "A"),
@ -181,7 +190,8 @@ namespace SimpleTesting
// This is the odd little case where we swapped "BEGIN" and "END" at both times 3 and 4
// so that they arrive in the opposite order. This shouldn't trouble the system at all:
// Everything that happens at Time 3 is identical. Right? Right!
var inputList = new[] {
var inputList = new[]
{
StreamEvent.CreateStart(1, "A"),
StreamEvent.CreateEnd(2, 1, "A"),
StreamEvent.CreateStart(2, "A"),
@ -192,7 +202,8 @@ namespace SimpleTesting
StreamEvent.CreateEnd(5, 4, "A")
};
var compareTo = new[] {
var compareTo = new[]
{
StreamEvent.CreateStart(1, "A"),
StreamEvent.CreateEnd(5, 1, "A"),
END
@ -209,7 +220,8 @@ namespace SimpleTesting
{
// We have done horrible thigns to the dictionary: all elements are
// identical!
var inputList = new[] {
var inputList = new[]
{
StreamEvent.CreateStart(1, "A"),
StreamEvent.CreateEnd(2, 1, "A"),
StreamEvent.CreateStart(2, "B"),
@ -220,7 +232,8 @@ namespace SimpleTesting
StreamEvent.CreateEnd(5, 4, "B")
};
var compareTo = new[] {
var compareTo = new[]
{
StreamEvent.CreateStart(1, "A"),
StreamEvent.CreateEnd(5, 1, "A"),
END
@ -311,7 +324,8 @@ namespace SimpleTesting
public static void StitchTestMultisetMultiStartCodegen()
{
// nothing interesting happens here
var inputList = new[] {
var inputList = new[]
{
StreamEvent.CreateStart(1, StructTuple.Create("A", 3)),
StreamEvent.CreateStart(2, StructTuple.Create("A", 3)),
StreamEvent.CreateEnd(3, 2, StructTuple.Create("A", 3)),
@ -323,7 +337,8 @@ namespace SimpleTesting
StreamEvent.CreateEnd(7, 4, StructTuple.Create("A", 3))
};
var compareTo = new[] {
var compareTo = new[]
{
StreamEvent.CreateStart(1, StructTuple.Create("A", 3)),
StreamEvent.CreateStart(2, StructTuple.Create("A", 3)),
StreamEvent.CreateEnd(6, 1, StructTuple.Create("A", 3)), // 6->5->1
@ -353,7 +368,8 @@ namespace SimpleTesting
var input = inputList.ToObservable().ToStreamable();
var outputStream = input.Stitch();
var compareTo = new[] {
var compareTo = new[]
{
StreamEvent.CreateStart(1, StructTuple.Create("A", 3)),
StreamEvent.CreateStart(2, StructTuple.Create("B", 3)),
StreamEvent.CreateEnd(3, 1, StructTuple.Create("A", 3)),
@ -369,7 +385,8 @@ namespace SimpleTesting
public void StitchTestSimpleSpliceCodegen()
{
// nothing interesting happens here
var inputList = new[] {
var inputList = new[]
{
StreamEvent.CreateStart(1, StructTuple.Create("A", 3)),
StreamEvent.CreateEnd(2, 1, StructTuple.Create("A", 3)),
StreamEvent.CreateStart(2, StructTuple.Create("A", 3)),
@ -380,7 +397,8 @@ namespace SimpleTesting
StreamEvent.CreateEnd(5, 4, StructTuple.Create("A", 3))
};
var compareTo = new[] {
var compareTo = new[]
{
StreamEvent.CreateStart(1, StructTuple.Create("A", 3)),
StreamEvent.CreateEnd(5, 1, StructTuple.Create("A", 3)),
END
@ -396,7 +414,8 @@ namespace SimpleTesting
public void StitchTestMultisetOneStartCodegen()
{
// Two different start times
var inputList = new[] {
var inputList = new[]
{
StreamEvent.CreateStart(1, StructTuple.Create("A", 3)),
StreamEvent.CreateStart(1, StructTuple.Create("A", 3)),
StreamEvent.CreateEnd(2, 1, StructTuple.Create("A", 3)),
@ -409,7 +428,8 @@ namespace SimpleTesting
StreamEvent.CreateEnd(6, 1, StructTuple.Create("A", 3))
};
var compareTo = new[] {
var compareTo = new[]
{
StreamEvent.CreateStart(1, StructTuple.Create("A", 3)),
StreamEvent.CreateStart(1, StructTuple.Create("A", 3)),
StreamEvent.CreateEnd(5, 1, StructTuple.Create("A", 3)), // 5->4->3->2->1
@ -430,7 +450,8 @@ namespace SimpleTesting
public void StitchTestMultisetExtraSlowStartCodegen()
{
// Two different start times
var inputList = new[] {
var inputList = new[]
{
StreamEvent.CreateStart(1, StructTuple.Create("A", 3)),
StreamEvent.CreateStart(1, StructTuple.Create("A", 3)),
StreamEvent.CreateStart(1, StructTuple.Create("A", 3)),
@ -451,7 +472,8 @@ namespace SimpleTesting
StreamEvent.CreateEnd(6, 1, StructTuple.Create("A", 3))
};
var compareTo = new[] {
var compareTo = new[]
{
StreamEvent.CreateStart(1, StructTuple.Create("A", 3)),
StreamEvent.CreateStart(1, StructTuple.Create("A", 3)),
StreamEvent.CreateStart(1, StructTuple.Create("A", 3)),
@ -475,7 +497,8 @@ namespace SimpleTesting
// This is the odd little case where we swapped "BEGIN" and "END" at both times 3 and 4
// so that they arrive in the opposite order. This shouldn't trouble the system at all:
// Everything that happens at Time 3 is identical. Right? Right!
var inputList = new[] {
var inputList = new[]
{
StreamEvent.CreateStart(1, StructTuple.Create("A", 3)),
StreamEvent.CreateEnd(2, 1, StructTuple.Create("A", 3)),
StreamEvent.CreateStart(2, StructTuple.Create("A", 3)),
@ -486,7 +509,8 @@ namespace SimpleTesting
StreamEvent.CreateEnd(5, 4, StructTuple.Create("A", 3))
};
var compareTo = new[] {
var compareTo = new[]
{
StreamEvent.CreateStart(1, StructTuple.Create("A", 3)),
StreamEvent.CreateEnd(5, 1, StructTuple.Create("A", 3)),
END
@ -505,7 +529,8 @@ namespace SimpleTesting
{
// We have done horrible thigns to the dictionary: all elements are
// identical!
var inputList = new[] {
var inputList = new[]
{
StreamEvent.CreateStart(1, StructTuple.Create("A", 3)),
StreamEvent.CreateEnd(2, 1, StructTuple.Create("A", 3)),
StreamEvent.CreateStart(2, StructTuple.Create("B", 3)),
@ -516,7 +541,8 @@ namespace SimpleTesting
StreamEvent.CreateEnd(5, 4, StructTuple.Create("B", 3))
};
var compareTo = new[] {
var compareTo = new[]
{
StreamEvent.CreateStart(1, StructTuple.Create("A", 3)),
StreamEvent.CreateEnd(5, 1, StructTuple.Create("A", 3)),
END