public static String getZooKeeperClusterKey(Configuration conf, String name) {
    String ensemble = conf.get(HConstants.ZOOKEEPER_QUORUM).replaceAll("[\\t\\n\\x0B\\f\\r]", "");
    StringBuilder builder = new StringBuilder(ensemble);
    builder.append(":");
    builder.append(conf.get(HConstants.ZOOKEEPER_CLIENT_PORT));
    builder.append(":");
    builder.append(conf.get(HConstants.ZOOKEEPER_ZNODE_PARENT));
    if (name != null && !name.isEmpty()) {
      builder.append(",");
      builder.append(name);
    }
    return builder.toString();
  }
Get the key to the ZK ensemble for this configuration and append a name at the end
@param conf Configuration to use to build the key
@param name Name that should be appended at the end if not empty or null
@return ensemble key with a name (if any)
hbase-common/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKConfig.java