use of com.logicalclocks.servicediscoverclient.exceptions.ServiceNotFoundException in project hopsworks by logicalclocks.
the class ServiceDiscoveryController method getAnyAddressOfServiceWithDNSSRVOnly.
@Lock(LockType.READ)
public Service getAnyAddressOfServiceWithDNSSRVOnly(HopsworksService serviceName) throws ServiceDiscoveryException {
ServiceQuery serviceQuery = ServiceQuery.of(constructServiceFQDN(serviceName), Collections.emptySet());
DnsResolver client = (DnsResolver) getClient(Type.DNS);
Optional<Service> serviceOpt = client.getServiceSRVOnly(serviceQuery).findAny();
return serviceOpt.orElseThrow(() -> new ServiceNotFoundException("Could not find service with: " + serviceQuery));
}
use of com.logicalclocks.servicediscoverclient.exceptions.ServiceNotFoundException in project hopsworks by logicalclocks.
the class ServiceDiscoveryController method getAnyAddressOfServiceWithDNS.
@Lock(LockType.READ)
public Service getAnyAddressOfServiceWithDNS(HopsworksService serviceName) throws ServiceDiscoveryException {
ServiceQuery serviceQuery = ServiceQuery.of(constructServiceFQDN(serviceName), Collections.emptySet());
Optional<Service> serviceOpt = getService(Type.DNS, serviceQuery).findAny();
return serviceOpt.orElseThrow(() -> new ServiceNotFoundException("Could not find service with: " + serviceQuery));
}
Aggregations