public static object GetFactory(HpcLinqContext context, Type type) { lock (s_codeGenLock) { if (s_TypeToFactory.ContainsKey(type)) { return s_TypeToFactory[type]; } HpcLinqCodeGen codeGen = new HpcLinqCodeGen(context, new VertexCodeGen()); codeGen.AddDryadCodeForType(type); // build assembly, and load into memory, because we'll next instantiate // the factory type out of the generated assembly. codeGen.BuildAssembly(true); string factoryTypeFullName = TargetNamespace + "." + HpcLinqFactoryClassName(type); object factory = codeGen.m_loadedVertexAssembly.CreateInstance(factoryTypeFullName); s_TypeToFactory.Add(type, factory); return factory; } }
private void Initialize(VertexCodeGen vertexCodeGen) { this.m_codeGen = new HpcLinqCodeGen(this.m_context, vertexCodeGen); this.m_queryPlan1 = null; this.m_queryPlan2 = null; this.m_queryPlan3 = null; this.m_DryadLinqProgram = null; this.m_queryPlan1 = null; this.m_exprNodeInfoMap = new Dictionary<Expression, QueryNodeInfo>(); this.m_referencedQueryMap = new Dictionary<Expression, QueryNodeInfo>(); this.m_inputUriMap = new Dictionary<string, DryadInputNode>(); this.m_outputUriMap = new Dictionary<string, DryadOutputNode>(); this.queryExecutor = new JobExecutor(this.m_context); // Initialize the data structures for the output tables this.m_outputTypes = new Type[this.m_queryExprs.Length]; this.m_outputDatapaths = new string[this.m_queryExprs.Length]; this.m_queryNodeInfos = new QueryNodeInfo[this.m_queryExprs.Length]; for (int i = 0; i < this.m_queryExprs.Length; i++) { this.m_queryNodeInfos[i] = this.BuildNodeInfoGraph(this.m_queryExprs[i]); this.m_queryNodeInfos[i] = new QueryNodeInfo(this.m_queryExprs[i], false, this.m_queryNodeInfos[i]); this.m_outputDatapaths[i] = DataPath.GetDataPath(this.m_outputTableUris[i]); Dictionary<string, string> args = DataPath.GetArguments(this.m_outputTableUris[i]); if (!(DataPath.IsDsc(this.m_outputDatapaths[i]) || DataPath.IsHdfs(this.m_outputDatapaths[i]))) { throw new DryadLinqException(HpcLinqErrorCode.UnrecognizedDataSource, String.Format(SR.UnrecognizedDataSource, this.m_outputTableUris[i])); } } }
internal Pipeline(CodeMemberMethod vertexMethod, HpcLinqCodeGen codeGen, string[] writerNames) { this.m_vertexMethod = vertexMethod; this.m_codeGen = codeGen; this.m_readerNames = null; this.m_writerNames = writerNames; this.m_nodes = new List<DryadQueryNode>(); }