当前位置: 首页>>代码示例>>Java>>正文


Java VertexLocationHint类代码示例

本文整理汇总了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);
}
 
开发者ID:apache,项目名称:tez,代码行数:20,代码来源:TestFairCartesianProductVertexManager.java

示例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());
}
 
开发者ID:apache,项目名称:tez,代码行数:19,代码来源:TestFairCartesianProductVertexManager.java

示例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());
}
 
开发者ID:apache,项目名称:tez,代码行数:19,代码来源:TestFairCartesianProductVertexManager.java

示例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);
}
 
开发者ID:apache,项目名称:tez,代码行数:19,代码来源:TestFairCartesianProductVertexManager.java

示例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;
}
 
开发者ID:apache,项目名称:tez,代码行数:17,代码来源:DAGImpl.java

示例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;
}
 
开发者ID:apache,项目名称:tez,代码行数:19,代码来源:TestVertexImpl.java

示例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;
}
 
开发者ID:apache,项目名称:tez,代码行数:18,代码来源:TestVertexImpl.java

示例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();
}
 
开发者ID:apache,项目名称:tez,代码行数:17,代码来源:TestVertexImpl.java

示例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;
}
 
开发者ID:apache,项目名称:incubator-tez,代码行数:16,代码来源:DAGImpl.java

示例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);
}
 
开发者ID:apache,项目名称:incubator-tez,代码行数:8,代码来源:VertexManager.java

示例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()]);
  }
}
 
开发者ID:apache,项目名称:incubator-tez,代码行数:9,代码来源:VertexImpl.java

示例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);
}
 
开发者ID:apache,项目名称:incubator-tez,代码行数:8,代码来源:VertexImpl.java

示例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();
  }
}
 
开发者ID:apache,项目名称:incubator-tez,代码行数:12,代码来源:VertexImpl.java

示例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;
}
 
开发者ID:apache,项目名称:incubator-tez,代码行数:11,代码来源:VertexParallelismUpdatedEvent.java

示例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);
  }
}
 
开发者ID:apache,项目名称:incubator-tez,代码行数:32,代码来源:TestVertexImpl.java


注:本文中的org.apache.tez.dag.api.VertexLocationHint类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。