本文整理了Java中org.apache.tez.dag.api.Vertex.addTaskLocalFiles()
方法的一些代码示例,展示了Vertex.addTaskLocalFiles()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Vertex.addTaskLocalFiles()
方法的具体详情如下:
包路径:org.apache.tez.dag.api.Vertex
类名称:Vertex
方法名:addTaskLocalFiles
[英]Set the files etc that must be provided to the tasks of this vertex
[中]设置必须提供给该顶点任务的文件等
代码示例来源:origin: apache/drill
private Vertex createVertex(JobConf conf, ReduceWork reduceWork,
LocalResource appJarLr, List<LocalResource> additionalLr, FileSystem fs,
Path mrScratchDir, Context ctx) throws Exception {
// set up operator plan
conf.set(Utilities.INPUT_NAME, reduceWork.getName());
Utilities.setReduceWork(conf, reduceWork, mrScratchDir, false);
// create the directories FileSinkOperators need
Utilities.createTmpDirs(conf, reduceWork);
VertexExecutionContext vertexExecutionContext = createVertexExecutionContext(reduceWork);
// create the vertex
Vertex reducer = Vertex.create(reduceWork.getName(),
ProcessorDescriptor.create(ReduceTezProcessor.class.getName()).
setUserPayload(TezUtils.createUserPayloadFromConf(conf)),
reduceWork.isAutoReduceParallelism() ?
reduceWork.getMaxReduceTasks() :
reduceWork.getNumReduceTasks(), getContainerResource(conf));
reducer.setTaskEnvironment(getContainerEnvironment(conf, false));
reducer.setExecutionContext(vertexExecutionContext);
reducer.setTaskLaunchCmdOpts(getContainerJavaOpts(conf));
Map<String, LocalResource> localResources = new HashMap<String, LocalResource>();
localResources.put(getBaseName(appJarLr), appJarLr);
for (LocalResource lr: additionalLr) {
localResources.put(getBaseName(lr), lr);
}
reducer.addTaskLocalFiles(localResources);
return reducer;
}
代码示例来源:origin: apache/drill
map.addTaskLocalFiles(localResources);
return map;
代码示例来源:origin: apache/hive
private Vertex createVertex(JobConf conf, ReduceWork reduceWork, FileSystem fs,
Path mrScratchDir, Context ctx, Map<String, LocalResource> localResources)
throws Exception {
// set up operator plan
conf.set(Utilities.INPUT_NAME, reduceWork.getName());
Utilities.setReduceWork(conf, reduceWork, mrScratchDir, false);
// create the directories FileSinkOperators need
Utilities.createTmpDirs(conf, reduceWork);
VertexExecutionContext vertexExecutionContext = createVertexExecutionContext(reduceWork);
// create the vertex
Vertex reducer = Vertex.create(reduceWork.getName(),
ProcessorDescriptor.create(ReduceTezProcessor.class.getName()).
setUserPayload(TezUtils.createUserPayloadFromConf(conf)),
reduceWork.isAutoReduceParallelism() ?
reduceWork.getMaxReduceTasks() :
reduceWork.getNumReduceTasks(), getContainerResource(conf));
reducer.setTaskEnvironment(getContainerEnvironment(conf, false));
reducer.setExecutionContext(vertexExecutionContext);
reducer.setTaskLaunchCmdOpts(getContainerJavaOpts(conf));
reducer.addTaskLocalFiles(localResources);
return reducer;
}
代码示例来源:origin: apache/hive
map.addTaskLocalFiles(localResources);
return map;
代码示例来源:origin: org.apache.tez/tez-tests
private DAG createDAG(TezConfiguration conf, int numTasks, int maxSleepTimeMillis,
int payloadSize, String mode) throws IOException {
Map<String, LocalResource> localResourceMap = new HashMap<String, LocalResource>();
UserPayload payload =
createUserPayload(conf, maxSleepTimeMillis, payloadSize, mode, localResourceMap);
Vertex vertex = Vertex.create("RPCLoadVertex",
ProcessorDescriptor.create(RPCSleepProcessor.class.getName()).setUserPayload(
payload), numTasks).addTaskLocalFiles(localResourceMap);
return DAG.create("RPCLoadGen").addVertex(vertex);
}
代码示例来源:origin: org.apache.tez/tez-tests
MapProcessor.class.getName()).setUserPayload(mapUserPayload), numTasks,
MRHelpers.getResourceForMRMapper(mapStageConf));
mapVertex.addTaskLocalFiles(commonLocalResources)
.addDataSource("MRInput", dataSource)
.setTaskLaunchCmdOpts(MRHelpers.getJavaOptsForMRMapper(mapStageConf)).setTaskEnvironment(mapEnv);
setUserPayload(iReduceUserPayload), numIReducer,
MRHelpers.getResourceForMRReducer(intermediateReduceStageConfs[i]));
ivertex.addTaskLocalFiles(commonLocalResources)
.setTaskLaunchCmdOpts(MRHelpers.getJavaOptsForMRReducer(
intermediateReduceStageConfs[i])).setTaskEnvironment(reduceEnv);
ReduceProcessor.class.getName()).setUserPayload(reducePayload), numReducer,
MRHelpers.getResourceForMRReducer(finalReduceConf));
finalReduceVertex.addTaskLocalFiles(commonLocalResources)
.addDataSink("MROutput", MROutputLegacy.createConfigBuilder(
finalReduceConf, NullOutputFormat.class).build())
代码示例来源:origin: com.facebook.presto.hive/hive-apache
private Vertex createVertex(JobConf conf, ReduceWork reduceWork,
LocalResource appJarLr, List<LocalResource> additionalLr, FileSystem fs,
Path mrScratchDir, Context ctx) throws Exception {
// set up operator plan
conf.set(Utilities.INPUT_NAME, reduceWork.getName());
Utilities.setReduceWork(conf, reduceWork, mrScratchDir, false);
// create the directories FileSinkOperators need
Utilities.createTmpDirs(conf, reduceWork);
// create the vertex
Vertex reducer = Vertex.create(reduceWork.getName(),
ProcessorDescriptor.create(ReduceTezProcessor.class.getName()).
setUserPayload(TezUtils.createUserPayloadFromConf(conf)),
reduceWork.isAutoReduceParallelism() ? reduceWork.getMaxReduceTasks() : reduceWork
.getNumReduceTasks(), getContainerResource(conf));
reducer.setTaskEnvironment(getContainerEnvironment(conf, false));
reducer.setTaskLaunchCmdOpts(getContainerJavaOpts(conf));
Map<String, LocalResource> localResources = new HashMap<String, LocalResource>();
localResources.put(getBaseName(appJarLr), appJarLr);
for (LocalResource lr: additionalLr) {
localResources.put(getBaseName(lr), lr);
}
reducer.addTaskLocalFiles(localResources);
return reducer;
}
代码示例来源:origin: org.apache.tez/tez-tests
.addTaskLocalFiles(commonLocalResources);
FilterByWordOutputProcessor.class.getName()).setUserPayload(TezUtils
.createUserPayloadFromConf(stage2Conf)), dsd.getNumberOfShards());
stage2Vertex.addTaskLocalFiles(commonLocalResources);
代码示例来源:origin: cwensel/cascading
vertex.addTaskLocalFiles( taskLocalResources );
代码示例来源:origin: cascading/cascading-hadoop2-tez
vertex.addTaskLocalFiles( taskLocalResources );
代码示例来源:origin: org.apache.tez/tez-tests
.addTaskLocalFiles(commonLocalResources);
FilterByWordOutputProcessor.class.getName()).setUserPayload(
TezUtils.createUserPayloadFromConf(stage2Conf)), 1);
stage2Vertex.addTaskLocalFiles(commonLocalResources);
代码示例来源:origin: org.apache.tez/tez-tests
mapVertex.setTaskEnvironment(mapEnv);
mapVertex.addTaskLocalFiles(commonLocalResources)
.addDataSource("MRInput", dsd);
vertices.add(mapVertex);
intermediateVertex.setTaskEnvironment(reduceEnv);
intermediateVertex.addTaskLocalFiles(commonLocalResources);
vertices.add(intermediateVertex);
finalReduceVertex.setTaskEnvironment(reduceEnv);
finalReduceVertex.addTaskLocalFiles(commonLocalResources);
finalReduceVertex.addDataSink("MROutput",
MROutputLegacy.createConfigBuilder(finalReduceConf, TextOutputFormat.class, outputPath)
代码示例来源:origin: org.apache.tez/tez-mapreduce
.addTaskLocalFiles(taskLocalResources)
.setLocationHint(VertexLocationHint.create(locations))
.setTaskLaunchCmdOpts(taskJavaOpts);
代码示例来源:origin: com.facebook.presto.hive/hive-apache
map.addTaskLocalFiles(localResources);
return map;
内容来源于网络,如有侵权,请联系作者删除!