Example #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(
      FSSchedulerApp application,
      FSSchedulerNode node,
      Resource capability,
      Priority priority,
      TransactionState ts) {

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

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

    return container;
  }