コード例 #1
0
  /**
   * Create and return a container object reflecting an allocation for the given appliction on the
   * given node with the given capability and priority.
   */
  public Container createContainer(FSSchedulerNode node, Resource capability, Priority priority) {

    NodeId nodeId = node.getRMNode().getNodeID();
    ContainerId containerId =
        BuilderUtils.newContainerId(getApplicationAttemptId(), getNewContainerId());

    // Create the container
    Container container =
        BuilderUtils.newContainer(
            containerId, nodeId, node.getRMNode().getHttpAddress(), capability, priority, null);

    return container;
  }