예제 #1
0
 protected override ISortedStream <Correlated <AggregationResult <TIn, TKey, TAggrRes> >, TKey> CreateOutputStream(AggregateCorrelatedSortedArgs <TIn, TAggrRes, TKey> args)
 {
     return(CreateSortedStream(
                args.InputStream.Observable.AggregateGrouped(
                    i => new Correlated <TAggrRes>
     {
         Row = args.CreateEmptyAggregation(i.Row),
         CorrelationKeys = new HashSet <Guid>()
     },
                    args.InputStream.SortDefinition,
                    (a, i) =>
     {
         a.Row = args.Aggregate(a.Row, i.Row);
         a.CorrelationKeys.UnionWith(i.CorrelationKeys);
         return a;
     },
                    (i, a) => new Correlated <AggregationResult <TIn, TKey, TAggrRes> >
     {
         CorrelationKeys = a.CorrelationKeys,
         Row = new AggregationResult <TIn, TKey, TAggrRes>
         {
             Aggregation = a.Row,
             FirstValue = i.Row,
             Key = args.InputStream.SortDefinition.GetKey(i)
         }
     }),
                new SortDefinition <Correlated <AggregationResult <TIn, TKey, TAggrRes> >, TKey>(i => i.Row.Key, args.InputStream.SortDefinition.KeyPosition)));
 }
예제 #2
0
 public AggregateCorrelatedSortedStreamNode(string name, AggregateCorrelatedSortedArgs <TIn, TAggrRes, TKey> args) : base(name, args)
 {
 }