當前位置: 首頁>>代碼示例>>Java>>正文


Java InputDescriptor.setUserPayload方法代碼示例

本文整理匯總了Java中org.apache.tez.dag.api.InputDescriptor.setUserPayload方法的典型用法代碼示例。如果您正苦於以下問題:Java InputDescriptor.setUserPayload方法的具體用法?Java InputDescriptor.setUserPayload怎麽用?Java InputDescriptor.setUserPayload使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.apache.tez.dag.api.InputDescriptor的用法示例。


在下文中一共展示了InputDescriptor.setUserPayload方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getInputDesc

import org.apache.tez.dag.api.InputDescriptor; //導入方法依賴的package包/類
public static InputDescriptor getInputDesc(UserPayload payload) {
  InputDescriptor desc = InputDescriptor.create(TestInput.class.getName());
  if (payload != null) {
    desc.setUserPayload(payload);
  }
  return desc;
}
 
開發者ID:apache,項目名稱:tez,代碼行數:8,代碼來源:TestInput.java

示例2: onRootVertexInitialized

import org.apache.tez.dag.api.InputDescriptor; //導入方法依賴的package包/類
@Override
public void onRootVertexInitialized(String inputName, InputDescriptor inputDescriptor,
    List<Event> events) {
  List<RootInputDataInformationEvent> riEvents = Lists.newLinkedList();
  boolean dataInformationEventSeen = false;
  for (Event event : events) {
    if (event instanceof RootInputConfigureVertexTasksEvent) {
      // No tasks should have been started yet. Checked by initial state check.
      Preconditions.checkState(dataInformationEventSeen == false);
      Preconditions.checkState(context.getVertexNumTasks(context.getVertexName()) == -1,
          "Parallelism for the vertex should be set to -1 if the InputInitializer is setting parallelism"
              + ", VertexName: " + context.getVertexName());
      Preconditions.checkState(configuredInputName == null,
          "RootInputVertexManager cannot configure multiple inputs. Use a custom VertexManager"
              + ", VertexName: " + context.getVertexName() + ", ConfiguredInput: "
              + configuredInputName + ", CurrentInput: " + inputName);
      configuredInputName = inputName;
      RootInputConfigureVertexTasksEvent cEvent = (RootInputConfigureVertexTasksEvent) event;
      Map<String, RootInputSpecUpdate> rootInputSpecUpdate = new HashMap<String, RootInputSpecUpdate>();
      rootInputSpecUpdate.put(
          inputName,
          cEvent.getRootInputSpecUpdate() == null ? RootInputSpecUpdate
              .getDefaultSinglePhysicalInputSpecUpdate() : cEvent.getRootInputSpecUpdate());
      context.setVertexParallelism(cEvent.getNumTasks(),
          new VertexLocationHint(cEvent.getTaskLocationHints()), null, rootInputSpecUpdate);
    }
    if (event instanceof RootInputUpdatePayloadEvent) {
      // No tasks should have been started yet. Checked by initial state check.
      Preconditions.checkState(dataInformationEventSeen == false);
      inputDescriptor.setUserPayload(((RootInputUpdatePayloadEvent) event)
          .getUserPayload());
    } else if (event instanceof RootInputDataInformationEvent) {
      dataInformationEventSeen = true;
      // # Tasks should have been set by this point.
      Preconditions.checkState(context.getVertexNumTasks(context.getVertexName()) != 0);
      Preconditions.checkState(
          configuredInputName == null || configuredInputName.equals(inputName),
          "RootInputVertexManager cannot configure multiple inputs. Use a custom VertexManager"
              + ", VertexName:" + context.getVertexName() + ", ConfiguredInput: "
              + configuredInputName + ", CurrentInput: " + inputName);
      configuredInputName = inputName;
      
      RootInputDataInformationEvent rEvent = (RootInputDataInformationEvent)event;
      rEvent.setTargetIndex(rEvent.getSourceIndex()); // 1:1 routing
      riEvents.add(rEvent);
    }
  }
  context.addRootInputEvents(inputName, riEvents);
}
 
開發者ID:apache,項目名稱:incubator-tez,代碼行數:50,代碼來源:RootInputVertexManager.java

示例3: onRootVertexInitialized

import org.apache.tez.dag.api.InputDescriptor; //導入方法依賴的package包/類
@Override
public void onRootVertexInitialized(String inputName, InputDescriptor inputDescriptor,
    List<Event> events) {
  List<InputDataInformationEvent> riEvents = Lists.newLinkedList();
  boolean dataInformationEventSeen = false;
  for (Event event : events) {
    if (event instanceof InputConfigureVertexTasksEvent) {
      // No tasks should have been started yet. Checked by initial state check.
      Preconditions.checkState(dataInformationEventSeen == false);
      Preconditions.checkState(getContext().getVertexNumTasks(getContext().getVertexName()) == -1,
          "Parallelism for the vertex should be set to -1 if the InputInitializer is setting parallelism"
              + ", VertexName: " + getContext().getVertexName());
      Preconditions.checkState(configuredInputName == null,
          "RootInputVertexManager cannot configure multiple inputs. Use a custom VertexManager"
              + ", VertexName: " + getContext().getVertexName() + ", ConfiguredInput: "
              + configuredInputName + ", CurrentInput: " + inputName);
      configuredInputName = inputName;
      InputConfigureVertexTasksEvent cEvent = (InputConfigureVertexTasksEvent) event;
      Map<String, InputSpecUpdate> rootInputSpecUpdate = new HashMap<String, InputSpecUpdate>();
      rootInputSpecUpdate.put(
          inputName,
          cEvent.getInputSpecUpdate() == null ? InputSpecUpdate
              .getDefaultSinglePhysicalInputSpecUpdate() : cEvent.getInputSpecUpdate());
      getContext().reconfigureVertex(rootInputSpecUpdate, cEvent.getLocationHint(),
            cEvent.getNumTasks());
    }
    if (event instanceof InputUpdatePayloadEvent) {
      // No tasks should have been started yet. Checked by initial state check.
      Preconditions.checkState(dataInformationEventSeen == false);
      inputDescriptor.setUserPayload(UserPayload.create(
          ((InputUpdatePayloadEvent) event).getUserPayload()));
    } else if (event instanceof InputDataInformationEvent) {
      dataInformationEventSeen = true;
      // # Tasks should have been set by this point.
      Preconditions.checkState(getContext().getVertexNumTasks(getContext().getVertexName()) != 0);
      Preconditions.checkState(
          configuredInputName == null || configuredInputName.equals(inputName),
          "RootInputVertexManager cannot configure multiple inputs. Use a custom VertexManager"
              + ", VertexName:" + getContext().getVertexName() + ", ConfiguredInput: "
              + configuredInputName + ", CurrentInput: " + inputName);
      configuredInputName = inputName;
      
      InputDataInformationEvent rEvent = (InputDataInformationEvent)event;
      rEvent.setTargetIndex(rEvent.getSourceIndex()); // 1:1 routing
      riEvents.add(rEvent);
    }
  }
  getContext().addRootInputEvents(inputName, riEvents);
}
 
開發者ID:apache,項目名稱:tez,代碼行數:50,代碼來源:RootInputVertexManager.java


注:本文中的org.apache.tez.dag.api.InputDescriptor.setUserPayload方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。