Beispiel #1
0
 internal void BuildDryadLinqAssembly(DryadLinqQueryGen queryGen)
 {
     lock (s_codeGenLock)
     {
         // this method only gets called from DryadLinqQueryGen.GenerateDryadProgram() before job submission. 
         // Since we don't load the generated vertex DLL after that, the check for
         // "should re-gen?" below is based on m_generatedVertexDllPath being set
         if (this.m_generatedVertexDllPath == null)
         {
             queryGen.CodeGenVisit();
             this.BuildAssembly(false);
         }
     }
 }
 /// <summary>
 /// Explain a query plan in terms of elementary operations.
 /// </summary>
 /// <param name="gen">Query generator.</param>
 /// <returns>A string explaining the plan.</returns>
 internal string Explain(DryadLinqQueryGen gen)
 {
     StringBuilder plan = new StringBuilder();
     gen.CodeGenVisit();
     this.CodeShowVisit(plan, gen.QueryPlan());
     return plan.ToString();
 }
Beispiel #3
0
        /// <summary>
        /// Create a dummy node with a specific code generator.
        /// </summary>
        /// <param name="queryGen">Query generator to instantiate.</param>
        /// <param name="outputType">Type of the single output.</param>
        /// <param name="partitionCount">The number of partitions.</param>
        /// <param name="children">The upstream nodes</param>
        internal DLinqDummyNode(DryadLinqQueryGen queryGen,
                                Type outputType,
                                int partitionCount,
                                params DLinqQueryNode[] children)
            : base(QueryNodeType.Dummy, queryGen, null, children)
        {
            this.m_opName = "Dummy";
            this.m_outputType = outputType;
            this.m_outputDataSetInfo = new DataSetInfo();
            this.m_partitionCount = partitionCount;

            this.DynamicManager = DynamicManager.None;
        }
Beispiel #4
0
 internal DLinqInputNode(DryadLinqQueryGen queryGen, ConstantExpression queryExpr)
     : base(QueryNodeType.InputTable, queryGen, queryExpr)
 {
     this.m_table = queryExpr.Value as DryadLinqQuery;
     if (this.m_table == null)
     {
         throw DryadLinqException.Create(DryadLinqErrorCode.UnknownError, SR.InputMustBeDryadLinqSource, queryExpr);
     }
     if (!queryGen.Context.Equals(this.m_table.Context))
     {
         throw new DryadLinqException("This query was constructed using different DryadLinqContexts.");
     }
     if (TypeSystem.IsTypeOrAnyGenericParamsAnonymous(queryExpr.Type.GetGenericArguments()[0]))
     {
         throw DryadLinqException.Create(DryadLinqErrorCode.InputTypeCannotBeAnonymous,
                                         SR.InputTypeCannotBeAnonymous,
                                         queryExpr);
     }
     this.m_opName = "Input";
     this.m_outputDataSetInfo = ((DryadLinqQuery)this.m_table).DataSetInfo;
     this.m_partitionCount = this.m_outputDataSetInfo.partitionInfo.Count;
     this.m_dynamicManager = DynamicManager.None;
 }
Beispiel #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;
 }