Search in sources :

Example 1 with NoRetryJaxRsStrategy

use of com.yahoo.vespa.jaxrs.client.NoRetryJaxRsStrategy in project vespa by vespa-engine.

the class SingleInstanceClusterControllerClientFactory method createClient.

@Override
public ClusterControllerClient createClient(List<HostName> clusterControllers, String clusterName) {
    if (clusterControllers.isEmpty()) {
        throw new IllegalArgumentException("No cluster controller instances found");
    }
    HostName controllerHostName = clusterControllers.iterator().next();
    // TODO: Get this from service monitor.
    int port = CLUSTERCONTROLLER_HARDCODED_PORT;
    log.log(LogLevel.DEBUG, () -> "For cluster '" + clusterName + "' with controllers " + clusterControllers + ", creating api client for " + controllerHostName.s() + ":" + port);
    JaxRsStrategy<ClusterControllerJaxRsApi> strategy = new NoRetryJaxRsStrategy<>(controllerHostName, port, jaxRsClientFactory, ClusterControllerJaxRsApi.class, CLUSTERCONTROLLER_API_PATH, CLUSTERCONTROLLER_HARDCODED_SCHEME);
    return new ClusterControllerClientImpl(strategy, clusterName);
}
Also used : NoRetryJaxRsStrategy(com.yahoo.vespa.jaxrs.client.NoRetryJaxRsStrategy) HostName(com.yahoo.vespa.applicationmodel.HostName)

Aggregations

HostName (com.yahoo.vespa.applicationmodel.HostName)1 NoRetryJaxRsStrategy (com.yahoo.vespa.jaxrs.client.NoRetryJaxRsStrategy)1