private ServiceRecord getNewServiceRecord() {
    ServiceRecord srv = new ServiceRecord();
    final Map<String, String> confsToPublish = getConfsToPublish();
    for (Map.Entry<String, String> entry : confsToPublish.entrySet()) {
      srv.set(entry.getKey(), entry.getValue());
    }
    return srv;
  }
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