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

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

Introduction

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

Prototype

public static String resolveConfIndirection(String valInConf) throws IOException 

Source Link

Document

Because ZK ACLs and authentication information may be secret, allow the configuration values to be indirected through a file by specifying the configuration as "@/path/to/file".

Usage

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

License:Apache License

public List<ACL> getZkAcls() throws LlamaException {
    // Parse authentication from configuration.
    String zkAclConf = conf.get(ZK_ACL, ZK_ACL_DEFAULT);
    try {/*  w  w w  .ja  v  a  2s  .  c  o  m*/
        zkAclConf = ZKUtil.resolveConfIndirection(zkAclConf);
        return ZKUtil.parseACLs(zkAclConf);
    } catch (Exception e) {
        throw new LlamaException(e, ErrorCode.ILLEGAL_ARGUMENT, "Couldn't read ACLs based on ", ZK_ACL);
    }
}

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 {//  ww w  .ja  v  a2 s.  c om
        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 va2 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;
    }
}

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

License:Apache License

public static List<ACL> getZKAcls() throws Exception {
    // Parse ACLs from configuration.
    String zkAclConf = KylinConfig.getInstanceFromEnv().getZKAcls();
    try {//from  w  w w  .j  ava  2  s .  c o m
        zkAclConf = ZKUtil.resolveConfIndirection(zkAclConf);
        return ZKUtil.parseACLs(zkAclConf);
    } catch (Exception e) {
        logger.error("Couldn't read ACLs based on 'kylin.env.zookeeper.zk-acl' in kylin.properties");
        throw e;
    }
}