public static synchronized HS2ActivePassiveHARegistry getClient(Configuration conf) throws IOException {
    String namespace = HiveConf.getVar(conf, HiveConf.ConfVars.HIVE_SERVER2_ACTIVE_PASSIVE_HA_REGISTRY_NAMESPACE);
    Preconditions.checkArgument(!StringUtils.isBlank(namespace),
      HiveConf.ConfVars.HIVE_SERVER2_ACTIVE_PASSIVE_HA_REGISTRY_NAMESPACE.varname + " cannot be null or empty");
    String nsKey = ZkRegistryBase.getRootNamespace(conf, null, namespace + "-");
    HS2ActivePassiveHARegistry registry = hs2Registries.get(nsKey);
    if (registry == null) {
      registry = HS2ActivePassiveHARegistry.create(conf, true);
      registry.start();
      hs2Registries.put(nsKey, registry);
      LOG.info("Added registry client to cache with namespace: {}", nsKey);
    } else {
      LOG.info("Returning cached registry client for namespace: {}", nsKey);
    }
    return registry;
  }
Helper method to get a HiveServer2HARegistry instance to read from the registry. Only used by clients (JDBC),
service discovery to connect to active HS2 instance in Active/Passive HA configuration.

@param conf {@link Configuration} instance which contains service registry information.
@return HiveServer2HARegistry
service/src/java/org/apache/hive/service/server/HS2ActivePassiveHARegistryClient.java