parent
69acde33c2
commit
2ab81eee2d
|
@ -37,10 +37,6 @@ public interface ActionFuture<T> extends Future<T> {
|
||||||
* Similar to {@link #get()}, just catching the {@link InterruptedException} and throwing
|
* Similar to {@link #get()}, just catching the {@link InterruptedException} and throwing
|
||||||
* an {@link IllegalStateException} instead. Also catches
|
* an {@link IllegalStateException} instead. Also catches
|
||||||
* {@link java.util.concurrent.ExecutionException} and throws the actual cause instead.
|
* {@link java.util.concurrent.ExecutionException} and throws the actual cause instead.
|
||||||
* <p>
|
|
||||||
* Note, the actual cause is unwrapped to the actual failure (for example, unwrapped
|
|
||||||
* from {@link org.elasticsearch.transport.RemoteTransportException}. The root failure is
|
|
||||||
* still accessible using {@link #getRootFailure()}.
|
|
||||||
*/
|
*/
|
||||||
T actionGet();
|
T actionGet();
|
||||||
|
|
||||||
|
@ -48,10 +44,6 @@ public interface ActionFuture<T> extends Future<T> {
|
||||||
* Similar to {@link #get(long, java.util.concurrent.TimeUnit)}, just catching the {@link InterruptedException} and throwing
|
* Similar to {@link #get(long, java.util.concurrent.TimeUnit)}, just catching the {@link InterruptedException} and throwing
|
||||||
* an {@link IllegalStateException} instead. Also catches
|
* an {@link IllegalStateException} instead. Also catches
|
||||||
* {@link java.util.concurrent.ExecutionException} and throws the actual cause instead.
|
* {@link java.util.concurrent.ExecutionException} and throws the actual cause instead.
|
||||||
* <p>
|
|
||||||
* Note, the actual cause is unwrapped to the actual failure (for example, unwrapped
|
|
||||||
* from {@link org.elasticsearch.transport.RemoteTransportException}. The root failure is
|
|
||||||
* still accessible using {@link #getRootFailure()}.
|
|
||||||
*/
|
*/
|
||||||
T actionGet(String timeout);
|
T actionGet(String timeout);
|
||||||
|
|
||||||
|
@ -59,10 +51,6 @@ public interface ActionFuture<T> extends Future<T> {
|
||||||
* Similar to {@link #get(long, java.util.concurrent.TimeUnit)}, just catching the {@link InterruptedException} and throwing
|
* Similar to {@link #get(long, java.util.concurrent.TimeUnit)}, just catching the {@link InterruptedException} and throwing
|
||||||
* an {@link IllegalStateException} instead. Also catches
|
* an {@link IllegalStateException} instead. Also catches
|
||||||
* {@link java.util.concurrent.ExecutionException} and throws the actual cause instead.
|
* {@link java.util.concurrent.ExecutionException} and throws the actual cause instead.
|
||||||
* <p>
|
|
||||||
* Note, the actual cause is unwrapped to the actual failure (for example, unwrapped
|
|
||||||
* from {@link org.elasticsearch.transport.RemoteTransportException}. The root failure is
|
|
||||||
* still accessible using {@link #getRootFailure()}.
|
|
||||||
*
|
*
|
||||||
* @param timeoutMillis Timeout in millis
|
* @param timeoutMillis Timeout in millis
|
||||||
*/
|
*/
|
||||||
|
@ -72,10 +60,6 @@ public interface ActionFuture<T> extends Future<T> {
|
||||||
* Similar to {@link #get(long, java.util.concurrent.TimeUnit)}, just catching the {@link InterruptedException} and throwing
|
* Similar to {@link #get(long, java.util.concurrent.TimeUnit)}, just catching the {@link InterruptedException} and throwing
|
||||||
* an {@link IllegalStateException} instead. Also catches
|
* an {@link IllegalStateException} instead. Also catches
|
||||||
* {@link java.util.concurrent.ExecutionException} and throws the actual cause instead.
|
* {@link java.util.concurrent.ExecutionException} and throws the actual cause instead.
|
||||||
* <p>
|
|
||||||
* Note, the actual cause is unwrapped to the actual failure (for example, unwrapped
|
|
||||||
* from {@link org.elasticsearch.transport.RemoteTransportException}. The root failure is
|
|
||||||
* still accessible using {@link #getRootFailure()}.
|
|
||||||
*/
|
*/
|
||||||
T actionGet(long timeout, TimeUnit unit);
|
T actionGet(long timeout, TimeUnit unit);
|
||||||
|
|
||||||
|
@ -83,16 +67,6 @@ public interface ActionFuture<T> extends Future<T> {
|
||||||
* Similar to {@link #get(long, java.util.concurrent.TimeUnit)}, just catching the {@link InterruptedException} and throwing
|
* Similar to {@link #get(long, java.util.concurrent.TimeUnit)}, just catching the {@link InterruptedException} and throwing
|
||||||
* an {@link IllegalStateException} instead. Also catches
|
* an {@link IllegalStateException} instead. Also catches
|
||||||
* {@link java.util.concurrent.ExecutionException} and throws the actual cause instead.
|
* {@link java.util.concurrent.ExecutionException} and throws the actual cause instead.
|
||||||
* <p>
|
|
||||||
* Note, the actual cause is unwrapped to the actual failure (for example, unwrapped
|
|
||||||
* from {@link org.elasticsearch.transport.RemoteTransportException}. The root failure is
|
|
||||||
* still accessible using {@link #getRootFailure()}.
|
|
||||||
*/
|
*/
|
||||||
T actionGet(TimeValue timeout);
|
T actionGet(TimeValue timeout);
|
||||||
|
|
||||||
/**
|
|
||||||
* The root (possibly) wrapped failure.
|
|
||||||
*/
|
|
||||||
@Nullable
|
|
||||||
Throwable getRootFailure();
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,8 +36,6 @@ import java.util.concurrent.TimeoutException;
|
||||||
*/
|
*/
|
||||||
public abstract class AdapterActionFuture<T, L> extends BaseFuture<T> implements ActionFuture<T>, ActionListener<L> {
|
public abstract class AdapterActionFuture<T, L> extends BaseFuture<T> implements ActionFuture<T>, ActionListener<L> {
|
||||||
|
|
||||||
private Throwable rootFailure;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public T actionGet() {
|
public T actionGet() {
|
||||||
try {
|
try {
|
||||||
|
@ -105,9 +103,4 @@ public abstract class AdapterActionFuture<T, L> extends BaseFuture<T> implements
|
||||||
}
|
}
|
||||||
|
|
||||||
protected abstract T convert(L listenerResponse);
|
protected abstract T convert(L listenerResponse);
|
||||||
|
|
||||||
@Override
|
|
||||||
public Throwable getRootFailure() {
|
|
||||||
return rootFailure;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue