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 hostProperty, String addressProperty, String defaultAddressValue,
        int defaultPort) 

Source Link

Document

Get the socket address for hostProperty as a InetSocketAddress.

Usage

From source file:io.hops.util.GroupMembershipService.java

License:Apache License

@Override
public synchronized void serviceInit(Configuration conf) throws Exception {

    this.conf = conf;
    groupMembershipServiceAddress = conf.getSocketAddr(YarnConfiguration.RM_BIND_HOST,
            YarnConfiguration.RM_GROUP_MEMBERSHIP_ADDRESS,
            YarnConfiguration.DEFAULT_RM_GROUP_MEMBERSHIP_ADDRESS,
            YarnConfiguration.DEFAULT_RM_GROUP_MEMBERSHIP_PORT);
    adminAcl = new AccessControlList(
            conf.get(YarnConfiguration.YARN_ADMIN_ACL, YarnConfiguration.DEFAULT_YARN_ADMIN_ACL));
    if (HAUtil.isHAEnabled(conf)) {
        this.rmId = HAUtil.getRMHAId(conf);
    }/*from w  w w  . ja v  a 2s .c o  m*/
    daemonUser = UserGroupInformation.getCurrentUser();
    authorizer = YarnAuthorizationProvider.getInstance(conf);
    authorizer.setAdmins(getAdminAclList(conf), UserGroupInformation.getCurrentUser());

    LOG.info("init groupMembershipService " + this.rmId);
}