Example usage for org.apache.hadoop.yarn.api.records Container setNodeHttpAddress

List of usage examples for org.apache.hadoop.yarn.api.records Container setNodeHttpAddress

Introduction

In this page you can find the example usage for org.apache.hadoop.yarn.api.records Container setNodeHttpAddress.

Prototype

@Private
    @Unstable
    public abstract void setNodeHttpAddress(String nodeHttpAddress);

Source Link

Usage

From source file:org.apache.hoya.yarn.appmaster.state.AppState.java

License:Apache License

/**
 * build up the special master node, which lives
 * in the live node set but has a lifecycle bonded to the AM
 * @param containerId the AM master/*  w  w  w. jav  a 2 s.  c  o m*/
 * @param host
 * @param nodeHttpAddress
 */
public void buildAppMasterNode(ContainerId containerId, String host, int amPort, String nodeHttpAddress) {
    Container container = new ContainerPBImpl();
    container.setId(containerId);
    NodeId nodeId = NodeId.newInstance(host, amPort);
    container.setNodeId(nodeId);
    container.setNodeHttpAddress(nodeHttpAddress);
    RoleInstance am = new RoleInstance(container);
    am.role = HoyaKeys.COMPONENT_AM;
    appMasterNode = am;
    //it is also added to the set of live nodes
    getLiveNodes().put(containerId, am);
}

From source file:org.apache.slider.server.appmaster.state.AppState.java

License:Apache License

/**
 * build up the special master node, which lives
 * in the live node set but has a lifecycle bonded to the AM
 * @param containerId the AM master//from w ww .j  ava2 s .c  o m
 * @param host hostname
 * @param amPort port
 * @param nodeHttpAddress http address: may be null
 */
public void buildAppMasterNode(ContainerId containerId, String host, int amPort, String nodeHttpAddress) {
    Container container = new ContainerPBImpl();
    container.setId(containerId);
    NodeId nodeId = NodeId.newInstance(host, amPort);
    container.setNodeId(nodeId);
    container.setNodeHttpAddress(nodeHttpAddress);
    RoleInstance am = new RoleInstance(container);
    am.role = SliderKeys.COMPONENT_AM;
    appMasterNode = am;
    //it is also added to the set of live nodes
    getLiveNodes().put(containerId, am);

    // patch up the role status
    RoleStatus roleStatus = roleStatusMap.get((SliderKeys.ROLE_AM_PRIORITY_INDEX));
    roleStatus.setDesired(1);
    roleStatus.incActual();
    roleStatus.incStarted();
}