Search in sources :

Example 1 with RequestConfigCallback

use of org.elasticsearch.client.RestClientBuilder.RequestConfigCallback in project janusgraph by JanusGraph.

the class RestClientSetup method getRestClient.

protected RestClient getRestClient(HttpHost[] hosts, Configuration config) {
    final RestClientBuilder restClientBuilder = getRestClientBuilder(hosts);
    final HttpClientConfigCallback httpClientConfigCallback = getHttpClientConfigCallback(config);
    if (httpClientConfigCallback != null) {
        restClientBuilder.setHttpClientConfigCallback(httpClientConfigCallback);
    }
    final RequestConfigCallback requestConfigCallback = getRequestConfigCallback(config);
    if (requestConfigCallback != null) {
        restClientBuilder.setRequestConfigCallback(requestConfigCallback);
    }
    if (config.has(ElasticSearchIndex.MAX_RETRY_TIMEOUT)) {
        restClientBuilder.setMaxRetryTimeoutMillis(config.get(ElasticSearchIndex.MAX_RETRY_TIMEOUT));
    }
    return restClientBuilder.build();
}
Also used : BasicAuthHttpClientConfigCallback(org.janusgraph.diskstorage.es.rest.util.BasicAuthHttpClientConfigCallback) HttpClientConfigCallback(org.elasticsearch.client.RestClientBuilder.HttpClientConfigCallback) RestClientBuilder(org.elasticsearch.client.RestClientBuilder) RequestConfigCallback(org.elasticsearch.client.RestClientBuilder.RequestConfigCallback)

Aggregations

RestClientBuilder (org.elasticsearch.client.RestClientBuilder)1 HttpClientConfigCallback (org.elasticsearch.client.RestClientBuilder.HttpClientConfigCallback)1 RequestConfigCallback (org.elasticsearch.client.RestClientBuilder.RequestConfigCallback)1 BasicAuthHttpClientConfigCallback (org.janusgraph.diskstorage.es.rest.util.BasicAuthHttpClientConfigCallback)1