Example usage for org.apache.hadoop.yarn.server.api ResourceTracker registerNodeManager

List of usage examples for org.apache.hadoop.yarn.server.api ResourceTracker registerNodeManager

Introduction

In this page you can find the example usage for org.apache.hadoop.yarn.server.api ResourceTracker registerNodeManager.

Prototype

@Idempotent
    RegisterNodeManagerResponse registerNodeManager(RegisterNodeManagerRequest request)
            throws YarnException, IOException;

Source Link

Usage

From source file:io.hops.metadata.util.DistributedRTClientEvaluation.java

License:Apache License

/**
 * Registers a node with the RT. If num is greater that 1, multiple requests
 * are sent for the same node and the last response is returned;
 * <p/>//from  w  ww  . j a va 2s  .  c  o  m
 *
 * @param rt
 * @param host
 * @param port
 * @param num
 * @return
 */
private void registerClient(ResourceTracker rt, NodeId nodeId) {
    try {
        RegisterNodeManagerRequest request = Records.newRecord(RegisterNodeManagerRequest.class);
        request.setHttpPort(nodeId.getPort());
        request.setNodeId(nodeId);
        Resource resource = Resource.newInstance(5012, 8);
        request.setResource(resource);
        rt.registerNodeManager(request);
    } catch (YarnException ex) {
        LOG.error("HOP :: Error sending NodeHeartbeatResponse", ex);
    } catch (IOException ex) {
        LOG.error("HOP :: Error sending NodeHeartbeatResponse", ex);
    }
}