public static void configureRemoteCluster(Job job, Configuration clusterConf) {
    Configuration conf = job.getConfiguration();

    if (!conf.getBoolean(LOCALITY_SENSITIVE_CONF_KEY, DEFAULT_LOCALITY_SENSITIVE)) {
      return;
    }

    final String quorum = clusterConf.get(HConstants.ZOOKEEPER_QUORUM);
    final int clientPort = clusterConf.getInt(HConstants.ZOOKEEPER_CLIENT_PORT,
      HConstants.DEFAULT_ZOOKEEPER_CLIENT_PORT);
    final String parent =
      clusterConf.get(HConstants.ZOOKEEPER_ZNODE_PARENT, HConstants.DEFAULT_ZOOKEEPER_ZNODE_PARENT);

    conf.set(REMOTE_CLUSTER_ZOOKEEPER_QUORUM_CONF_KEY, quorum);
    conf.setInt(REMOTE_CLUSTER_ZOOKEEPER_CLIENT_PORT_CONF_KEY, clientPort);
    conf.set(REMOTE_CLUSTER_ZOOKEEPER_ZNODE_PARENT_CONF_KEY, parent);

    LOG.info("ZK configs for remote cluster of bulkload is configured: " + quorum + ":" + clientPort
      + "/" + parent);
  }
Configure HBase cluster key for remote cluster to load region location for locality-sensitive
if it's enabled. It's not necessary to call this method explicitly when the cluster key for
HBase cluster to be used to load region location is configured in the job configuration. Call
this method when another HBase cluster key is configured in the job configuration. For example,
you should call when you load data from HBase cluster A using {@link TableInputFormat} and
generate hfiles for HBase cluster B. Otherwise, HFileOutputFormat2 fetch location from cluster
A and locality-sensitive won't working correctly.
{@link #configureIncrementalLoad(Job, Table, RegionLocator)} calls this method using
{@link Table#getConfiguration} as clusterConf. See HBASE-25608.
@param job         which has configuration to be updated
@param clusterConf which contains cluster key of the HBase cluster to be locality-sensitive
@see #configureIncrementalLoad(Job, Table, RegionLocator)
@see #LOCALITY_SENSITIVE_CONF_KEY
@see #REMOTE_CLUSTER_ZOOKEEPER_QUORUM_CONF_KEY
@see #REMOTE_CLUSTER_ZOOKEEPER_CLIENT_PORT_CONF_KEY
@see #REMOTE_CLUSTER_ZOOKEEPER_ZNODE_PARENT_CONF_KEY
hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/HFileOutputFormat2.java