本文整理汇总了Java中org.apache.tez.dag.api.EdgeProperty.DataSourceType类的典型用法代码示例。如果您正苦于以下问题:Java DataSourceType类的具体用法?Java DataSourceType怎么用?Java DataSourceType使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DataSourceType类属于org.apache.tez.dag.api.EdgeProperty包,在下文中一共展示了DataSourceType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createDAG
import org.apache.tez.dag.api.EdgeProperty.DataSourceType; //导入依赖的package包/类
public static DAG createDAG(String name,
Configuration conf) throws Exception {
byte[] payload = null;
int taskCount = TEZ_SIMPLE_DAG_NUM_TASKS_DEFAULT;
if (conf != null) {
taskCount = conf.getInt(TEZ_SIMPLE_DAG_NUM_TASKS, TEZ_SIMPLE_DAG_NUM_TASKS_DEFAULT);
payload = TezUtils.createUserPayloadFromConf(conf);
}
DAG dag = new DAG(name);
Vertex v1 = new Vertex("v1", TestProcessor.getProcDesc(payload), taskCount, defaultResource);
Vertex v2 = new Vertex("v2", TestProcessor.getProcDesc(payload), taskCount, defaultResource);
dag.addVertex(v1).addVertex(v2).addEdge(new Edge(v1, v2,
new EdgeProperty(DataMovementType.SCATTER_GATHER,
DataSourceType.PERSISTED,
SchedulingType.SEQUENTIAL,
TestOutput.getOutputDesc(payload),
TestInput.getInputDesc(payload))));
return dag;
}
示例2: createDAG
import org.apache.tez.dag.api.EdgeProperty.DataSourceType; //导入依赖的package包/类
public static DAG createDAG(String name,
Configuration conf) throws Exception {
byte[] payload = null;
int taskCount = TEZ_SIMPLE_DAG_NUM_TASKS_DEFAULT;
if (conf != null) {
taskCount = conf.getInt(TEZ_SIMPLE_DAG_NUM_TASKS, TEZ_SIMPLE_DAG_NUM_TASKS_DEFAULT);
payload = TezUtils.createUserPayloadFromConf(conf);
}
DAG dag = new DAG(name);
Vertex v1 = new Vertex("v1", TestProcessor.getProcDesc(payload), taskCount, defaultResource);
Vertex v2 = new Vertex("v2", TestProcessor.getProcDesc(payload), taskCount, defaultResource);
Vertex v3 = new Vertex("v3", TestProcessor.getProcDesc(payload), taskCount, defaultResource);
dag.addVertex(v1).addVertex(v2).addEdge(new Edge(v1, v2,
new EdgeProperty(DataMovementType.SCATTER_GATHER,
DataSourceType.PERSISTED,
SchedulingType.SEQUENTIAL,
TestOutput.getOutputDesc(payload),
TestInput.getInputDesc(payload))));
dag.addVertex(v3).addEdge(new Edge(v2, v3,
new EdgeProperty(DataMovementType.SCATTER_GATHER,
DataSourceType.PERSISTED,
SchedulingType.SEQUENTIAL,
TestOutput.getOutputDesc(payload),
TestInput.getInputDesc(payload))));
return dag;
}
示例3: testVerifyScatterGather
import org.apache.tez.dag.api.EdgeProperty.DataSourceType; //导入依赖的package包/类
@Test(timeout = 5000)
public void testVerifyScatterGather() {
Vertex v1 = new Vertex("v1",
new ProcessorDescriptor(dummyProcessorClassName),
dummyTaskCount, dummyTaskResource);
Vertex v2 = new Vertex("v2",
new ProcessorDescriptor("MapProcessor"),
dummyTaskCount, dummyTaskResource);
Edge e1 = new Edge(v1, v2,
new EdgeProperty(DataMovementType.SCATTER_GATHER,
DataSourceType.PERSISTED, SchedulingType.SEQUENTIAL,
new OutputDescriptor(dummyOutputClassName),
new InputDescriptor(dummyInputClassName)));
DAG dag = new DAG("testDag");
dag.addVertex(v1);
dag.addVertex(v2);
dag.addEdge(e1);
dag.verify();
}
示例4: testVerifyCustomEdge
import org.apache.tez.dag.api.EdgeProperty.DataSourceType; //导入依赖的package包/类
@Test(timeout = 5000)
public void testVerifyCustomEdge() {
Vertex v1 = new Vertex("v1",
new ProcessorDescriptor(dummyProcessorClassName),
dummyTaskCount, dummyTaskResource);
Vertex v2 = new Vertex("v2",
new ProcessorDescriptor("MapProcessor"),
dummyTaskCount, dummyTaskResource);
Edge e1 = new Edge(v1, v2,
new EdgeProperty(new EdgeManagerDescriptor("emClass"),
DataSourceType.PERSISTED,
SchedulingType.SEQUENTIAL,
new OutputDescriptor(dummyOutputClassName),
new InputDescriptor(dummyInputClassName)));
DAG dag = new DAG("testDag");
dag.addVertex(v1);
dag.addVertex(v2);
dag.addEdge(e1);
dag.verify();
}
示例5: testVerifyOneToOne
import org.apache.tez.dag.api.EdgeProperty.DataSourceType; //导入依赖的package包/类
@Test(timeout = 5000)
public void testVerifyOneToOne() {
Vertex v1 = new Vertex("v1",
new ProcessorDescriptor(dummyProcessorClassName),
dummyTaskCount, dummyTaskResource);
Vertex v2 = new Vertex("v2",
new ProcessorDescriptor("MapProcessor"),
dummyTaskCount, dummyTaskResource);
Edge e1 = new Edge(v1, v2,
new EdgeProperty(DataMovementType.ONE_TO_ONE,
DataSourceType.PERSISTED, SchedulingType.SEQUENTIAL,
new OutputDescriptor(dummyOutputClassName),
new InputDescriptor(dummyInputClassName)));
DAG dag = new DAG("testDag");
dag.addVertex(v1);
dag.addVertex(v2);
dag.addEdge(e1);
dag.verify();
}
示例6: testVerifyOneToOneNoInferParallelism
import org.apache.tez.dag.api.EdgeProperty.DataSourceType; //导入依赖的package包/类
@Test(timeout = 5000)
public void testVerifyOneToOneNoInferParallelism() {
Vertex v1 = new Vertex("v1",
new ProcessorDescriptor(dummyProcessorClassName),
-1, dummyTaskResource);
Vertex v2 = new Vertex("v2",
new ProcessorDescriptor("MapProcessor"),
-1, dummyTaskResource);
Edge e1 = new Edge(v1, v2,
new EdgeProperty(DataMovementType.ONE_TO_ONE,
DataSourceType.PERSISTED, SchedulingType.SEQUENTIAL,
new OutputDescriptor(dummyOutputClassName),
new InputDescriptor(dummyInputClassName)));
DAG dag = new DAG("testDag");
dag.addVertex(v1);
dag.addVertex(v2);
dag.addEdge(e1);
dag.verify();
Assert.assertEquals(-1, v2.getParallelism());
}
示例7: testVerifyBroadcast
import org.apache.tez.dag.api.EdgeProperty.DataSourceType; //导入依赖的package包/类
@Test(timeout = 5000)
public void testVerifyBroadcast() {
Vertex v1 = new Vertex("v1",
new ProcessorDescriptor(dummyProcessorClassName),
dummyTaskCount, dummyTaskResource);
Vertex v2 = new Vertex("v2",
new ProcessorDescriptor("MapProcessor"),
dummyTaskCount, dummyTaskResource);
Edge e1 = new Edge(v1, v2,
new EdgeProperty(DataMovementType.BROADCAST,
DataSourceType.PERSISTED, SchedulingType.SEQUENTIAL,
new OutputDescriptor(dummyOutputClassName),
new InputDescriptor(dummyInputClassName)));
DAG dag = new DAG("testDag");
dag.addVertex(v1);
dag.addVertex(v2);
dag.addEdge(e1);
dag.verify();
}
示例8: testVerify3
import org.apache.tez.dag.api.EdgeProperty.DataSourceType; //导入依赖的package包/类
@Test(expected = IllegalStateException.class, timeout = 5000)
public void testVerify3() {
Vertex v1 = new Vertex("v1",
new ProcessorDescriptor(dummyProcessorClassName),
dummyTaskCount, dummyTaskResource);
Vertex v2 = new Vertex("v2",
new ProcessorDescriptor("MapProcessor"),
dummyTaskCount, dummyTaskResource);
Edge e1 = new Edge(v1, v2,
new EdgeProperty(DataMovementType.SCATTER_GATHER,
DataSourceType.EPHEMERAL, SchedulingType.SEQUENTIAL,
new OutputDescriptor(dummyOutputClassName),
new InputDescriptor(dummyInputClassName)));
DAG dag = new DAG("testDag");
dag.addVertex(v1);
dag.addVertex(v2);
dag.addEdge(e1);
dag.verify();
}
示例9: testVerify4
import org.apache.tez.dag.api.EdgeProperty.DataSourceType; //导入依赖的package包/类
@Test(expected = IllegalStateException.class, timeout = 5000)
public void testVerify4() {
Vertex v1 = new Vertex("v1",
new ProcessorDescriptor(dummyProcessorClassName),
dummyTaskCount, dummyTaskResource);
Vertex v2 = new Vertex("v2",
new ProcessorDescriptor("MapProcessor"),
dummyTaskCount, dummyTaskResource);
Edge e1 = new Edge(v1, v2,
new EdgeProperty(DataMovementType.SCATTER_GATHER,
DataSourceType.EPHEMERAL, SchedulingType.CONCURRENT,
new OutputDescriptor(dummyOutputClassName),
new InputDescriptor(dummyInputClassName)));
DAG dag = new DAG("testDag");
dag.addVertex(v1);
dag.addVertex(v2);
dag.addEdge(e1);
dag.verify();
}
示例10: testOutputAndOutputVertexNameCollision
import org.apache.tez.dag.api.EdgeProperty.DataSourceType; //导入依赖的package包/类
@Test(expected = IllegalStateException.class, timeout = 5000)
public void testOutputAndOutputVertexNameCollision() {
Vertex v1 = new Vertex("v1",
new ProcessorDescriptor("MapProcessor"),
dummyTaskCount, dummyTaskResource);
Vertex v2 = new Vertex("v2",
new ProcessorDescriptor("MapProcessor"),
dummyTaskCount, dummyTaskResource);
v1.addOutput("v2", new OutputDescriptor());
Edge e1 = new Edge(v1, v2,
new EdgeProperty(DataMovementType.SCATTER_GATHER,
DataSourceType.PERSISTED, SchedulingType.SEQUENTIAL,
new OutputDescriptor("dummy output class"),
new InputDescriptor("dummy input class")));
DAG dag = new DAG("testDag");
dag.addVertex(v1);
dag.addVertex(v2);
dag.addEdge(e1);
dag.verify();
}
示例11: createDAG
import org.apache.tez.dag.api.EdgeProperty.DataSourceType; //导入依赖的package包/类
public static DAG createDAG(String name,
Configuration conf) throws Exception {
UserPayload payload = UserPayload.create(null);
int taskCount = TEZ_SIMPLE_DAG_NUM_TASKS_DEFAULT;
if (conf != null) {
taskCount = conf.getInt(TEZ_SIMPLE_DAG_NUM_TASKS, TEZ_SIMPLE_DAG_NUM_TASKS_DEFAULT);
payload = TezUtils.createUserPayloadFromConf(conf);
}
DAG dag = DAG.create(name);
Vertex v1 = Vertex.create("v1", TestProcessor.getProcDesc(payload), taskCount, defaultResource);
Vertex v2 = Vertex.create("v2", TestProcessor.getProcDesc(payload), taskCount, defaultResource);
dag.addVertex(v1).addVertex(v2).addEdge(Edge.create(v1, v2,
EdgeProperty.create(DataMovementType.SCATTER_GATHER,
DataSourceType.PERSISTED,
SchedulingType.SEQUENTIAL,
TestOutput.getOutputDesc(payload),
TestInput.getInputDesc(payload))));
return dag;
}
示例12: createDAG
import org.apache.tez.dag.api.EdgeProperty.DataSourceType; //导入依赖的package包/类
/**
* v1 --> v2 <br>
* v1 has a customized VM to control whether to schedule only one second task when it is partiallyFinished test case.
* v2 has a customized VM which could control when to kill AM
*
* @param vertexManagerClass
* @param dmType
* @param failOnParitialCompleted
* @return
* @throws IOException
*/
private DAG createDAG(String dagName, Class vertexManagerClass, DataMovementType dmType,
boolean failOnParitialCompleted) throws IOException {
if (failOnParitialCompleted) {
tezConf.set(FAIL_ON_PARTIAL_FINISHED, "true");
} else {
tezConf.set(FAIL_ON_PARTIAL_FINISHED, "false");
}
DAG dag = DAG.create(dagName);
UserPayload payload = UserPayload.create(null);
Vertex v1 = Vertex.create("v1", MyProcessor.getProcDesc(), 2);
v1.setVertexManagerPlugin(VertexManagerPluginDescriptor.create(
ScheduleControlledVertexManager.class.getName()).setUserPayload(
TezUtils.createUserPayloadFromConf(tezConf)));
Vertex v2 = Vertex.create("v2", DoNothingProcessor.getProcDesc(), 2);
v2.setVertexManagerPlugin(VertexManagerPluginDescriptor.create(
vertexManagerClass.getName()).setUserPayload(
TezUtils.createUserPayloadFromConf(tezConf)));
dag.addVertex(v1).addVertex(v2);
dag.addEdge(Edge.create(v1, v2, EdgeProperty.create(dmType,
DataSourceType.PERSISTED, SchedulingType.SEQUENTIAL,
TestOutput.getOutputDesc(payload), TestInput.getInputDesc(payload))));
return dag;
}
示例13: createDAG
import org.apache.tez.dag.api.EdgeProperty.DataSourceType; //导入依赖的package包/类
public static DAG createDAG(String name,
Configuration conf) throws Exception {
UserPayload payload = null;
int taskCount = TEZ_SIMPLE_DAG_NUM_TASKS_DEFAULT;
if (conf != null) {
taskCount = conf.getInt(TEZ_SIMPLE_DAG_NUM_TASKS, TEZ_SIMPLE_DAG_NUM_TASKS_DEFAULT);
payload = TezUtils.createUserPayloadFromConf(conf);
}
DAG dag = DAG.create(name);
Vertex v1 = Vertex.create("v1", TestProcessor.getProcDesc(payload), taskCount, defaultResource);
Vertex v2 = Vertex.create("v2", TestProcessor.getProcDesc(payload), taskCount, defaultResource);
Vertex v3 = Vertex.create("v3", TestProcessor.getProcDesc(payload), taskCount, defaultResource);
dag.addVertex(v1).addVertex(v2).addEdge(Edge.create(v1, v2,
EdgeProperty.create(DataMovementType.SCATTER_GATHER,
DataSourceType.PERSISTED,
SchedulingType.SEQUENTIAL,
TestOutput.getOutputDesc(payload),
TestInput.getInputDesc(payload))));
dag.addVertex(v3).addEdge(Edge.create(v2, v3,
EdgeProperty.create(DataMovementType.SCATTER_GATHER,
DataSourceType.PERSISTED,
SchedulingType.SEQUENTIAL,
TestOutput.getOutputDesc(payload),
TestInput.getInputDesc(payload))));
return dag;
}
示例14: createDAG
import org.apache.tez.dag.api.EdgeProperty.DataSourceType; //导入依赖的package包/类
private DAG createDAG(String dagName, boolean uv12CommitFail, boolean v3CommitFail) {
DAG dag = DAG.create(dagName);
Vertex v1 = Vertex.create("v1", ProcessorDescriptor.create("Proc"), 1);
Vertex v2 = Vertex.create("v2", ProcessorDescriptor.create("Proc"), 1);
Vertex v3 = Vertex.create("v3", ProcessorDescriptor.create("Proc"), 1);
VertexGroup uv12 = dag.createVertexGroup("uv12", v1, v2);
DataSinkDescriptor uv12DataSink = DataSinkDescriptor.create(
OutputDescriptor.create("dummy output"), createOutputCommitterDesc(uv12CommitFail), null);
uv12.addDataSink("uv12Out", uv12DataSink);
DataSinkDescriptor v3DataSink = DataSinkDescriptor.create(
OutputDescriptor.create("dummy output"), createOutputCommitterDesc(v3CommitFail), null);
v3.addDataSink("v3Out", v3DataSink);
GroupInputEdge e1 = GroupInputEdge.create(uv12, v3, EdgeProperty.create(
DataMovementType.SCATTER_GATHER, DataSourceType.PERSISTED,
SchedulingType.SEQUENTIAL,
OutputDescriptor.create("dummy output class"),
InputDescriptor.create("dummy input class")), InputDescriptor
.create("merge.class"));
dag.addVertex(v1)
.addVertex(v2)
.addVertex(v3)
.addEdge(e1);
return dag;
}
示例15: testVertexSetParallelismDecrease
import org.apache.tez.dag.api.EdgeProperty.DataSourceType; //导入依赖的package包/类
@Test(timeout = 5000)
public void testVertexSetParallelismDecrease() throws Exception {
VertexImpl v3 = vertices.get("vertex3");
v3.vertexReconfigurationPlanned();
initAllVertices(VertexState.INITED);
Assert.assertEquals(2, v3.getTotalTasks());
Assert.assertEquals(2, v3.getTasks().size());
VertexImpl v1 = vertices.get("vertex1");
startVertex(vertices.get("vertex2"));
startVertex(v1);
EdgeManagerPluginDescriptor mockEdgeManagerDescriptor =
EdgeManagerPluginDescriptor.create(EdgeManagerForTest.class.getName());
EdgeProperty edgeProp = EdgeProperty.create(mockEdgeManagerDescriptor,
DataSourceType.PERSISTED, SchedulingType.SEQUENTIAL, OutputDescriptor.create("Out"),
InputDescriptor.create("In"));
Map<String, EdgeProperty> edgeManagerDescriptors =
Collections.singletonMap(
v1.getName(), edgeProp);
v3.reconfigureVertex(1, null, edgeManagerDescriptors);
v3.doneReconfiguringVertex();
assertTrue(v3.sourceVertices.get(v1).getEdgeManager() instanceof
EdgeManagerForTest);
checkTasks(v3, 1);
}