public static Configuration createClusterConf(Configuration baseConf, String clusterKey,
    String overridePrefix) throws IOException {
    Configuration clusterConf = HBaseConfiguration.create(baseConf);
    if (!StringUtils.isBlank(clusterKey)) {
      applyClusterKeyToConf(clusterConf, clusterKey);
    }

    if (!StringUtils.isBlank(overridePrefix)) {
      Configuration clusterSubset = HBaseConfiguration.subset(clusterConf, overridePrefix);
      HBaseConfiguration.merge(clusterConf, clusterSubset);
    }
    return clusterConf;
  }
Generates a {@link Configuration} instance by applying property overrides prefixed by a cluster
profile key to the base Configuration. Override properties are extracted by the
{@link #subset(Configuration, String)} method, then the merged on top of the base Configuration
and returned.
@param baseConf       the base configuration to use, containing prefixed override properties
@param clusterKey     the ZooKeeper quorum cluster key to apply, or {@code null} if none
@param overridePrefix the property key prefix to match for override properties, or {@code null}
                      if none
@return the merged configuration with override properties and cluster key applied
hbase-common/src/main/java/org/apache/hadoop/hbase/HBaseConfiguration.java