mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-08 22:14:59 +00:00
get rid of retry timeout exception
This commit is contained in:
parent
25892351e7
commit
94cf8437d0
@ -33,9 +33,9 @@ public final class RestClient implements Closeable {
|
|||||||
this.transport = new Transport<>(client, connectionPool, maxRetryTimeout);
|
this.transport = new Transport<>(client, connectionPool, maxRetryTimeout);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ElasticsearchResponse performRequest(Verb verb, String endpoint, Map<String, Object> params, HttpEntity entity)
|
public ElasticsearchResponse performRequest(String method, String endpoint, Map<String, Object> params, HttpEntity entity)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
return transport.performRequest(verb, endpoint, params, entity);
|
return transport.performRequest(method, endpoint, params, entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -1,29 +0,0 @@
|
|||||||
/*
|
|
||||||
* Licensed to Elasticsearch under one or more contributor
|
|
||||||
* license agreements. See the NOTICE file distributed with
|
|
||||||
* this work for additional information regarding copyright
|
|
||||||
* ownership. Elasticsearch licenses this file to you under
|
|
||||||
* the Apache License, Version 2.0 (the "License"); you may
|
|
||||||
* not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing,
|
|
||||||
* software distributed under the License is distributed on an
|
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
||||||
* KIND, either express or implied. See the License for the
|
|
||||||
* specific language governing permissions and limitations
|
|
||||||
* under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package org.elasticsearch.client;
|
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
|
|
||||||
public class RetryTimeoutException extends IOException {
|
|
||||||
|
|
||||||
RetryTimeoutException(String message) {
|
|
||||||
super(message);
|
|
||||||
}
|
|
||||||
}
|
|
@ -88,7 +88,7 @@ final class Transport<C extends Connection> implements Closeable {
|
|||||||
long timeElapsed = TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - startTime);
|
long timeElapsed = TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - startTime);
|
||||||
long timeout = retryTimeout - timeElapsed;
|
long timeout = retryTimeout - timeElapsed;
|
||||||
if (timeout <= 0) {
|
if (timeout <= 0) {
|
||||||
RetryTimeoutException retryTimeoutException = new RetryTimeoutException(
|
IOException retryTimeoutException = new IOException(
|
||||||
"request retries exceeded max retry timeout [" + retryTimeout + "]");
|
"request retries exceeded max retry timeout [" + retryTimeout + "]");
|
||||||
retryTimeoutException.addSuppressed(lastSeenException);
|
retryTimeoutException.addSuppressed(lastSeenException);
|
||||||
throw retryTimeoutException;
|
throw retryTimeoutException;
|
||||||
|
@ -1,27 +0,0 @@
|
|||||||
/*
|
|
||||||
* Licensed to Elasticsearch under one or more contributor
|
|
||||||
* license agreements. See the NOTICE file distributed with
|
|
||||||
* this work for additional information regarding copyright
|
|
||||||
* ownership. Elasticsearch licenses this file to you under
|
|
||||||
* the Apache License, Version 2.0 (the "License"); you may
|
|
||||||
* not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing,
|
|
||||||
* software distributed under the License is distributed on an
|
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
||||||
* KIND, either express or implied. See the License for the
|
|
||||||
* specific language governing permissions and limitations
|
|
||||||
* under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package org.elasticsearch.client;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Holds the http verbs/methods supported by elasticsearch, which can be used when sending a request
|
|
||||||
*/
|
|
||||||
public enum Verb {
|
|
||||||
DELETE, GET, HEAD, POST, PUT
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user