Пример #1
0
 internal virtual string Visit(DLinqAggregateNode node,
                               CodeMemberMethod vertexMethod,
                               string[] readerNames,
                               string[] writerNames)
 {
     return node.AddVertexCode(vertexMethod, readerNames, writerNames);
 }
Пример #2
0
 private DLinqQueryNode VisitAggregate(QueryNodeInfo source,
                                       Expression seed,
                                       LambdaExpression funcLambda,
                                       LambdaExpression resultLambda,
                                       Expression queryExpr)
 {
     DLinqQueryNode child = this.Visit(source);
     DLinqQueryNode resNode = child;
     if (DryadLinqExpression.IsAssociative(funcLambda))
     {
         LambdaExpression combinerLambda = DryadLinqExpression.GetAssociativeCombiner(funcLambda);
         ResourceAttribute attrib = AttributeSystem.GetResourceAttrib(funcLambda);
         bool funcIsExpensive = (attrib != null && attrib.IsExpensive); 
         resNode = this.PromoteConcat(
                           source, child,
                           x => new DLinqAggregateNode("AssocAggregate", seed,
                                                       funcLambda, combinerLambda, null,
                                                       1, queryExpr, x, false));
         resNode = new DLinqAggregateNode("AssocAggregate", null, combinerLambda, combinerLambda, resultLambda,
                                          3, queryExpr, resNode, funcIsExpensive);
     }
     else
     {
         resNode = new DLinqAggregateNode("Aggregate", seed, funcLambda, null, resultLambda, 3,
                                          queryExpr, child, false);
     }
     return resNode;
 }