internal virtual string Visit(DLinqSuperNode node,
                               CodeMemberMethod vertexMethod,
                               string[] readerNames,
                               string[] writerNames)
 {
     return node.AddVertexCode(vertexMethod, readerNames, writerNames);
 }
Exemple #2
0
        internal DLinqQueryNode PipelineReduce()
        {
            if (!this.CanBePipelined())
            {
                return this;
            }

            DLinqQueryNode[] nodeChildren = this.Children;
            DLinqSuperNode resNode = new DLinqSuperNode(this);
            List<DLinqQueryNode> childList = new List<DLinqQueryNode>();
            for (int i = 0; i < nodeChildren.Length; i++)
            {
                DLinqQueryNode child = nodeChildren[i];
                if (this.CanNotBePipelinedWith(child))
                {
                    childList.Add(child);
                    bool found = child.UpdateParent(this, resNode);
                }
                else
                {
                    if (child is DLinqSuperNode)
                    {
                        DLinqSuperNode superChild = (DLinqSuperNode)child;
                        nodeChildren[i] = superChild.RootNode;
                        superChild.SwitchTo(resNode);
                    }
                    else
                    {
                        child.SuperNode = resNode;
                    }

                    // Fix the child's children
                    foreach (DLinqQueryNode child1 in child.Children)
                    {
                        childList.Add(child1);
                        bool found = child1.UpdateParent(child, resNode);
                    }
                }
            }

            DLinqQueryNode[] resChildren = new DLinqQueryNode[childList.Count];
            for (int i = 0; i < resChildren.Length; i++)
            {
                resChildren[i] = childList[i];
            }
            resNode.Children = resChildren;
            resNode.OutputDataSetInfo = resNode.RootNode.OutputDataSetInfo;
            return resNode;
        }
Exemple #3
0
 internal void SwitchTo(DLinqSuperNode node)
 {
     this.SwitchTo(this.m_rootNode, node);
 }
Exemple #4
0
 private void SwitchTo(DLinqQueryNode curNode, DLinqSuperNode node)
 {
     if (curNode.SuperNode == this)
     {
         curNode.SuperNode = node;
         foreach (DLinqQueryNode child in curNode.Children)
         {
             this.SwitchTo(child, node);
         }
     }
 }
Exemple #5
0
 internal DLinqQueryNode(QueryNodeType nodeType,
                       DryadLinqQueryGen queryGen,
                       Expression queryExpr,
                       params DLinqQueryNode[] children)
 {
     this.m_nodeType = nodeType;
     this.m_queryGen = queryGen;
     this.m_queryExpression = queryExpr;
     this.m_parents = new List<DLinqQueryNode>(1);
     this.m_children = children;
     foreach (DLinqQueryNode child in children)
     {
         child.Parents.Add(this);
     }
     this.m_superNode = null;
     this.m_isForked = false;
     this.m_uniqueId = DryadLinqQueryGen.StartPhaseId;
     this.m_channelType = ChannelType.DiskFile;
     this.m_conOpType = ConnectionOpType.Pointwise;
     this.m_opName = null;
     this.m_vertexEntryMethod = null;
     this.m_outputDataSetInfo = null;
     this.m_partitionCount = -1;
     this.m_dynamicManager = null;
 }