code: public static HostDiscovery getHostDiscoveryForLocation(URI location, Optional<CuratorFramework> curator, String serviceName, MetricRegistry metricRegistry) {
          checkArgument(getLocationType(location) == LocationType.EMO_HOST_DISCOVERY, "Location does not use host discovery");
          Optional<List<String>> hosts = getHostOverride(location);
          if (hosts.isPresent()) {
              return createFixedHostDiscovery(serviceName, hosts.get().toArray(new String[hosts.get().size()]));
          } else {
              checkState(curator.isPresent(), "curator required");
              return createZooKeeperHostDiscovery(curator.get(), serviceName, metricRegistry);
          }
      }
docs: Returns the HostDiscovery for a given location.  The curator should come from a previous call to
  {@link #getCuratorForLocation(java.net.URI)} to the same location.