Search in sources :

Example 1 with DiscoveryException

use of io.airlift.discovery.client.DiscoveryException in project airlift by airlift.

the class SimpleServiceSelector method selectAllServices.

@Override
public List<ServiceDescriptor> selectAllServices() {
    try {
        ListenableFuture<ServiceDescriptors> future = lookupClient.getServices(type, pool);
        ServiceDescriptors serviceDescriptors = getFutureValue(future, DiscoveryException.class);
        return serviceDescriptors.getServiceDescriptors();
    } catch (DiscoveryException e) {
        log.error(e);
        return ImmutableList.of();
    }
}
Also used : DiscoveryException(io.airlift.discovery.client.DiscoveryException) ServiceDescriptors(io.airlift.discovery.client.ServiceDescriptors)

Aggregations

DiscoveryException (io.airlift.discovery.client.DiscoveryException)1 ServiceDescriptors (io.airlift.discovery.client.ServiceDescriptors)1