當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。