本文整理汇总了Java中org.apache.tez.dag.api.VertexLocationHint类的典型用法代码示例。如果您正苦于以下问题:Java VertexLocationHint类的具体用法?Java VertexLocationHint怎么用?Java VertexLocationHint使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
VertexLocationHint类属于org.apache.tez.dag.api包,在下文中一共展示了VertexLocationHint类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testSchedulingVertexOnlyWithBroadcast
import org.apache.tez.dag.api.VertexLocationHint; //导入依赖的package包/类
@Test(timeout = 5000)
public void testSchedulingVertexOnlyWithBroadcast() throws Exception {
setupDAGVertexOnlyWithBroadcast(30, 1, 1);
vertexManager.onVertexStateUpdated(new VertexStateUpdate("v0", VertexState.CONFIGURED));
vertexManager.onVertexStateUpdated(new VertexStateUpdate("v1", VertexState.CONFIGURED));
vertexManager.onVertexManagerEventReceived(getVMEvent(250, "v0", 0));
vertexManager.onVertexManagerEventReceived(getVMEvent(200, "v1", 0));
verify(ctx, times(1)).reconfigureVertex(
eq(30), any(VertexLocationHint.class), edgePropertiesCaptor.capture());
assertFalse(edgePropertiesCaptor.getValue().containsKey("v2"));
vertexManager.onVertexStarted(null);
vertexManager.onSourceTaskCompleted(getTaId("v0", 0));
vertexManager.onSourceTaskCompleted(getTaId("v1", 0));
verifyScheduleRequest(0);
vertexManager.onVertexStateUpdated(new VertexStateUpdate("v2", VertexState.RUNNING));
verifyScheduleRequest(1, 0, 1, 6, 7);
}
示例2: testGroupingFraction
import org.apache.tez.dag.api.VertexLocationHint; //导入依赖的package包/类
@Test(timeout = 5000)
public void testGroupingFraction() throws Exception {
setupGroupingFractionTest();
vertexManager.onVertexManagerEventReceived(getVMEvent(10000, "v0", 0));
vertexManager.onVertexManagerEventReceived(getVMEvent(10000, "v1", 0));
for (int i = 0; i < 10; i++) {
vertexManager.onSourceTaskCompleted(getTaId("v0", i));
}
for (int i = 0; i < 14; i++) {
vertexManager.onSourceTaskCompleted(getTaId("v1", i));
}
verify(ctx, never()).reconfigureVertex(
anyInt(), any(VertexLocationHint.class), anyMapOf(String.class, EdgeProperty.class));
vertexManager.onSourceTaskCompleted(getTaId("v1", 14));
verify(ctx, times(1)).reconfigureVertex(
eq(24), any(VertexLocationHint.class), edgePropertiesCaptor.capture());
}
示例3: testDisableGrouping
import org.apache.tez.dag.api.VertexLocationHint; //导入依赖的package包/类
@Test(timeout = 5000)
public void testDisableGrouping() throws Exception {
when(ctx.getInputVertexEdgeProperties()).thenReturn(getEdgePropertyMap(2));
setSrcParallelism(ctx, 1, 2, 3);
CartesianProductConfigProto.Builder builder = CartesianProductConfigProto.newBuilder();
builder.setIsPartitioned(false).addSources("v0").addSources("v1")
.setMaxParallelism(30).setMinOpsPerWorker(1).setEnableGrouping(false);
vertexManager.initialize(builder.build());
vertexManager.onVertexStateUpdated(new VertexStateUpdate("v0", VertexState.CONFIGURED));
vertexManager.onVertexStateUpdated(new VertexStateUpdate("v1", VertexState.CONFIGURED));
vertexManager.onVertexManagerEventReceived(getVMEvent(250, "v0", 0));
vertexManager.onVertexManagerEventReceived(getVMEvent(200, "v1", 0));
verify(ctx, times(1)).reconfigureVertex(
eq(6), any(VertexLocationHint.class), edgePropertiesCaptor.capture());
}
示例4: testParallelismTwoSkewedSource
import org.apache.tez.dag.api.VertexLocationHint; //导入依赖的package包/类
@Test(timeout = 5000)
public void testParallelismTwoSkewedSource() throws Exception {
setupDAGVertexOnly(100, 10000, 10, 10);
vertexManager.onVertexStateUpdated(new VertexStateUpdate("v0", VertexState.CONFIGURED));
vertexManager.onVertexStateUpdated(new VertexStateUpdate("v1", VertexState.CONFIGURED));
vertexManager.onVertexManagerEventReceived(getVMEvent(15000, "v0", 0));
for (int i = 0; i < 30; i++) {
vertexManager.onVertexManagerEventReceived(getVMEvent(1, "v1", i));
}
verify(ctx, times(1)).reconfigureVertex(
eq(99), any(VertexLocationHint.class), edgePropertiesCaptor.capture());
Map<String, EdgeProperty> edgeProperties = edgePropertiesCaptor.getValue();
verifyEdgeProperties(edgeProperties.get("v0"), new String[]{"v0", "v1"},
new int[]{99, 1}, 100);
}
示例5: createVertex
import org.apache.tez.dag.api.VertexLocationHint; //导入依赖的package包/类
private static VertexImpl createVertex(DAGImpl dag, String vertexName, int vId) {
TezVertexID vertexId = TezBuilderUtils.newVertexID(dag.getID(), vId);
VertexPlan vertexPlan = dag.getJobPlan().getVertex(vId);
VertexLocationHint vertexLocationHint = DagTypeConverters
.convertFromDAGPlan(vertexPlan.getTaskLocationHintList());
VertexImpl v = new VertexImpl(
vertexId, vertexPlan, vertexName, dag.dagConf,
dag.eventHandler, dag.taskCommunicatorManagerInterface,
dag.clock, dag.taskHeartbeatHandler,
!dag.commitAllOutputsOnSuccess, dag.appContext, vertexLocationHint,
dag.vertexGroups, dag.taskSpecificLaunchCmdOption, dag.entityUpdateTracker,
dag.dagOnlyConf);
return v;
}
示例6: VertexImplWithRunningInputInitializer
import org.apache.tez.dag.api.VertexLocationHint; //导入依赖的package包/类
public VertexImplWithRunningInputInitializer(TezVertexID vertexId,
VertexPlan vertexPlan, String vertexName,
Configuration conf,
EventHandler eventHandler,
TaskCommunicatorManagerInterface taskCommunicatorManagerInterface,
Clock clock, TaskHeartbeatHandler thh,
AppContext appContext,
VertexLocationHint vertexLocationHint,
DrainDispatcher dispatcher,
InputInitializer presetInitializer,
StateChangeNotifier updateTracker,
Configuration dagConf) {
super(vertexId, vertexPlan, vertexName, conf, eventHandler,
taskCommunicatorManagerInterface, clock, thh, true,
appContext, vertexLocationHint, null, taskSpecificLaunchCmdOption,
updateTracker, dagConf);
this.presetInitializer = presetInitializer;
}
示例7: VertexImplWithControlledInitializerManager
import org.apache.tez.dag.api.VertexLocationHint; //导入依赖的package包/类
public VertexImplWithControlledInitializerManager(TezVertexID vertexId,
VertexPlan vertexPlan, String vertexName,
Configuration conf,
EventHandler eventHandler,
TaskCommunicatorManagerInterface taskCommunicatorManagerInterface,
Clock clock, TaskHeartbeatHandler thh,
AppContext appContext,
VertexLocationHint vertexLocationHint,
DrainDispatcher dispatcher,
StateChangeNotifier updateTracker,
Configuration dagConf) {
super(vertexId, vertexPlan, vertexName, conf, eventHandler,
taskCommunicatorManagerInterface, clock, thh, true,
appContext, vertexLocationHint, null, taskSpecificLaunchCmdOption,
updateTracker, dagConf);
this.dispatcher = dispatcher;
}
示例8: completeInputInitialization
import org.apache.tez.dag.api.VertexLocationHint; //导入依赖的package包/类
public void completeInputInitialization(int initializerIndex, int targetTasks,
List<TaskLocationHint> locationHints) {
List<Event> events = Lists.newArrayListWithCapacity(targetTasks + 1);
InputConfigureVertexTasksEvent configEvent = InputConfigureVertexTasksEvent.create(
targetTasks, VertexLocationHint.create(locationHints), null);
events.add(configEvent);
for (int i = 0; i < targetTasks; i++) {
InputDataInformationEvent diEvent = InputDataInformationEvent.createWithSerializedPayload(i,
null);
events.add(diEvent);
}
eventHandler.handle(new VertexEventRootInputInitialized(vertexID, inputs
.get(initializerIndex).getName(), events));
dispatcher.await();
}
示例9: createVertex
import org.apache.tez.dag.api.VertexLocationHint; //导入依赖的package包/类
private static VertexImpl createVertex(DAGImpl dag, String vertexName, int vId) {
TezVertexID vertexId = TezBuilderUtils.newVertexID(dag.getID(), vId);
VertexPlan vertexPlan = dag.getJobPlan().getVertex(vId);
VertexLocationHint vertexLocationHint = DagTypeConverters
.convertFromDAGPlan(vertexPlan.getTaskLocationHintList());
VertexImpl v = new VertexImpl(
vertexId, vertexPlan, vertexName, dag.conf,
dag.eventHandler, dag.taskAttemptListener,
dag.clock, dag.taskHeartbeatHandler,
!dag.commitAllOutputsOnSuccess, dag.appContext, vertexLocationHint,
dag.vertexGroups, dag.profilerOptions);
return v;
}
示例10: setVertexParallelism
import org.apache.tez.dag.api.VertexLocationHint; //导入依赖的package包/类
@Override
public boolean setVertexParallelism(int parallelism, VertexLocationHint vertexLocationHint,
Map<String, EdgeManagerDescriptor> sourceEdgeManagers,
Map<String, RootInputSpecUpdate> rootInputSpecUpdate) {
return managedVertex.setParallelism(parallelism, vertexLocationHint, sourceEdgeManagers,
rootInputSpecUpdate);
}
示例11: setTaskLocationHints
import org.apache.tez.dag.api.VertexLocationHint; //导入依赖的package包/类
private void setTaskLocationHints(VertexLocationHint vertexLocationHint) {
if (vertexLocationHint != null &&
vertexLocationHint.getTaskLocationHints() != null &&
!vertexLocationHint.getTaskLocationHints().isEmpty()) {
List<TaskLocationHint> locHints = vertexLocationHint.getTaskLocationHints();
taskLocationHints = locHints.toArray(new TaskLocationHint[locHints.size()]);
}
}
示例12: setParallelism
import org.apache.tez.dag.api.VertexLocationHint; //导入依赖的package包/类
@Override
public boolean setParallelism(int parallelism, VertexLocationHint vertexLocationHint,
Map<String, EdgeManagerDescriptor> sourceEdgeManagers,
Map<String, RootInputSpecUpdate> rootInputSpecUpdates) {
return setParallelism(parallelism, vertexLocationHint, sourceEdgeManagers, rootInputSpecUpdates,
false);
}
示例13: setVertexLocationHint
import org.apache.tez.dag.api.VertexLocationHint; //导入依赖的package包/类
public void setVertexLocationHint(VertexLocationHint vertexLocationHint) {
writeLock.lock();
try {
if (LOG.isDebugEnabled()) {
logLocationHints(this.vertexName, vertexLocationHint);
}
setTaskLocationHints(vertexLocationHint);
} finally {
writeLock.unlock();
}
}
示例14: VertexParallelismUpdatedEvent
import org.apache.tez.dag.api.VertexLocationHint; //导入依赖的package包/类
public VertexParallelismUpdatedEvent(TezVertexID vertexID,
int numTasks, VertexLocationHint vertexLocationHint,
Map<String, EdgeManagerDescriptor> sourceEdgeManagers,
Map<String, RootInputSpecUpdate> rootInputSpecUpdates) {
this.vertexID = vertexID;
this.numTasks = numTasks;
this.vertexLocationHint = vertexLocationHint;
this.sourceEdgeManagers = sourceEdgeManagers;
this.rootInputSpecUpdates = rootInputSpecUpdates;
}
示例15: setupVertices
import org.apache.tez.dag.api.VertexLocationHint; //导入依赖的package包/类
private void setupVertices() {
int vCnt = dagPlan.getVertexCount();
LOG.info("Setting up vertices from dag plan, verticesCnt=" + vCnt);
vertices = new HashMap<String, VertexImpl>();
vertexIdMap = new HashMap<TezVertexID, VertexImpl>();
for (int i = 0; i < vCnt; ++i) {
VertexPlan vPlan = dagPlan.getVertex(i);
String vName = vPlan.getName();
TezVertexID vertexId = TezVertexID.getInstance(dagId, i+1);
VertexImpl v = null;
VertexLocationHint locationHint = DagTypeConverters.convertFromDAGPlan(
vPlan.getTaskLocationHintList());
if (useCustomInitializer) {
if (customInitializer == null) {
v = new VertexImplWithControlledInitializerManager(vertexId, vPlan, vPlan.getName(), conf,
dispatcher.getEventHandler(), taskAttemptListener,
clock, thh, appContext, locationHint, dispatcher);
} else {
v = new VertexImplWithRunningInputInitializer(vertexId, vPlan, vPlan.getName(), conf,
dispatcher.getEventHandler(), taskAttemptListener,
clock, thh, appContext, locationHint, dispatcher, customInitializer);
}
} else {
v = new VertexImpl(vertexId, vPlan, vPlan.getName(), conf,
dispatcher.getEventHandler(), taskAttemptListener,
clock, thh, true, appContext, locationHint, vertexGroups, javaProfilerOptions);
}
vertices.put(vName, v);
vertexIdMap.put(vertexId, v);
}
}