private Map<String, String> getConfsToPublish() {
    final Map<String, String> confsToPublish = new HashMap<>();
    // Hostname
    confsToPublish.put(HiveConf.ConfVars.HIVE_SERVER2_THRIFT_BIND_HOST.varname,
      conf.get(HiveConf.ConfVars.HIVE_SERVER2_THRIFT_BIND_HOST.varname));
    // Web port
    confsToPublish.put(HiveConf.ConfVars.HIVE_SERVER2_WEBUI_PORT.varname,
      conf.get(HiveConf.ConfVars.HIVE_SERVER2_WEBUI_PORT.varname));
    // Hostname:port
    confsToPublish.put(INSTANCE_URI_CONFIG, conf.get(INSTANCE_URI_CONFIG));
    confsToPublish.put(UNIQUE_IDENTIFIER, uniqueId);
    // Transport mode
    confsToPublish.put(HiveConf.ConfVars.HIVE_SERVER2_TRANSPORT_MODE.varname,
      conf.get(HiveConf.ConfVars.HIVE_SERVER2_TRANSPORT_MODE.varname));
    // Transport specific confs
    if (HiveServer2.isHttpTransportMode(new HiveConf(conf, Configuration.class))) {
      confsToPublish.put(HiveConf.ConfVars.HIVE_SERVER2_THRIFT_HTTP_PORT.varname,
        conf.get(HiveConf.ConfVars.HIVE_SERVER2_THRIFT_HTTP_PORT.varname));
      confsToPublish.put(HiveConf.ConfVars.HIVE_SERVER2_THRIFT_HTTP_PATH.varname,
        conf.get(HiveConf.ConfVars.HIVE_SERVER2_THRIFT_HTTP_PATH.varname));
    } else {
      confsToPublish.put(HiveConf.ConfVars.HIVE_SERVER2_THRIFT_PORT.varname,
        conf.get(HiveConf.ConfVars.HIVE_SERVER2_THRIFT_PORT.varname));
      confsToPublish.put(HiveConf.ConfVars.HIVE_SERVER2_THRIFT_SASL_QOP.varname,
        conf.get(HiveConf.ConfVars.HIVE_SERVER2_THRIFT_SASL_QOP.varname));
    }
    // Auth specific confs
    confsToPublish.put(HiveConf.ConfVars.HIVE_SERVER2_AUTHENTICATION.varname,
      conf.get(HiveConf.ConfVars.HIVE_SERVER2_AUTHENTICATION.varname));
    if (AuthType.isKerberosAuthMode(conf)) {
      confsToPublish.put(HiveConf.ConfVars.HIVE_SERVER2_KERBEROS_PRINCIPAL.varname,
        conf.get(HiveConf.ConfVars.HIVE_SERVER2_KERBEROS_PRINCIPAL.varname));
    }
    // SSL conf
    confsToPublish.put(HiveConf.ConfVars.HIVE_SERVER2_USE_SSL.varname,
      conf.get(HiveConf.ConfVars.HIVE_SERVER2_USE_SSL.varname));
    return confsToPublish;
  }
If leadership related notifications is desired, use this method to register leader latch listener.

@param latchListener   - listener
@param executorService - event handler executor service
service/src/java/org/apache/hive/service/server/HS2ActivePassiveHARegistry.java