Example usage for org.apache.hadoop.conf Configuration getSocketAddr

List of usage examples for org.apache.hadoop.conf Configuration getSocketAddr

Introduction

In this page you can find the example usage for org.apache.hadoop.conf Configuration getSocketAddr.

Prototype

public InetSocketAddress getSocketAddr(String name, String defaultAddress, int defaultPort) 

Source Link

Document

Get the socket address for name property as a InetSocketAddress.

Usage

From source file:org.springframework.yarn.am.AppmasterRmTemplate.java

License:Apache License

@Override
protected InetSocketAddress getRpcAddress(Configuration config) {
    InetSocketAddress addr = config.getSocketAddr(YarnConfiguration.RM_SCHEDULER_ADDRESS,
            YarnConfiguration.DEFAULT_RM_SCHEDULER_ADDRESS, YarnConfiguration.DEFAULT_RM_SCHEDULER_PORT);
    try {/*ww w . j  av  a  2s . co m*/
        setupTokens(addr);
    } catch (IOException e) {
        log.error("Error setting up tokens", e);
    }
    return addr;
}

From source file:org.springframework.yarn.client.ClientRmTemplate.java

License:Apache License

@Override
protected InetSocketAddress getRpcAddress(Configuration config) {
    return config.getSocketAddr(YarnConfiguration.RM_ADDRESS, YarnConfiguration.DEFAULT_RM_ADDRESS,
            YarnConfiguration.DEFAULT_RM_PORT);
}

From source file:org.springframework.yarn.support.YarnUtils.java

License:Apache License

/**
 * Gets the address.// w ww.j av  a  2 s .  com
 *
 * @param conf the Yarn configuration
 * @return the address
 */
public static InetSocketAddress getAddress(Configuration conf) {
    return conf.getSocketAddr(YarnConfiguration.RM_ADDRESS, YarnConfiguration.DEFAULT_RM_ADDRESS,
            YarnConfiguration.DEFAULT_RM_PORT);
}