Example usage for org.apache.hadoop.util ZKUtil parseAuth

List of usage examples for org.apache.hadoop.util ZKUtil parseAuth

Introduction

In this page you can find the example usage for org.apache.hadoop.util ZKUtil parseAuth.

Prototype

public static List<ZKAuthInfo> parseAuth(String authString) throws BadAuthFormatException 

Source Link

Document

Parse a comma-separated list of authentication mechanisms.

Usage

From source file:com.cloudera.llama.am.HAServerConfiguration.java

License:Apache License

public List<ZKUtil.ZKAuthInfo> getZkAuths() throws LlamaException {
    String zkAuthConf = conf.get(ZK_AUTH);
    try {//from   ww w  . j a va  2  s.  co m
        zkAuthConf = ZKUtil.resolveConfIndirection(zkAuthConf);
        if (zkAuthConf != null) {
            return ZKUtil.parseAuth(zkAuthConf);
        } else {
            return Collections.emptyList();
        }
    } catch (Exception e) {
        throw new LlamaException(e, ErrorCode.ILLEGAL_ARGUMENT, "Couldn't read Auth based on ", ZK_AUTH);
    }
}

From source file:org.apache.kylin.storage.hbase.util.ZookeeperAclBuilder.java

License:Apache License

public static List<ZKUtil.ZKAuthInfo> getZKAuths() throws Exception {
    // Parse Auths from configuration.
    String zkAuthConf = KylinConfig.getInstanceFromEnv().getZKAuths();
    try {//from w  ww  .  j  a  v  a2  s .  c  o  m
        zkAuthConf = ZKUtil.resolveConfIndirection(zkAuthConf);
        if (zkAuthConf != null) {
            return ZKUtil.parseAuth(zkAuthConf);
        } else {
            return Collections.emptyList();
        }
    } catch (Exception e) {
        logger.error("Couldn't read Auth based on 'kylin.env.zookeeper.zk-auth' in kylin.properties");
        throw e;
    }
}