org.elasticsearch.transport
Class PlainTransportFuture<V extends Streamable>
java.lang.Object
org.elasticsearch.common.util.concurrent.AbstractFuture<V>
org.elasticsearch.transport.PlainTransportFuture<V>
- All Implemented Interfaces:
- java.util.concurrent.Future<V>, TransportFuture<V>, TransportResponseHandler<V>
public class PlainTransportFuture<V extends Streamable>
- extends org.elasticsearch.common.util.concurrent.AbstractFuture<V>
- implements TransportFuture<V>, TransportResponseHandler<V>
Method Summary |
java.lang.String |
executor()
|
void |
handleException(TransportException exp)
|
void |
handleResponse(V response)
|
V |
newInstance()
creates a new instance of the return type from the remote call. |
java.lang.String |
toString()
|
V |
txGet()
Waits if necessary for the computation to complete, and then
retrieves its result. |
V |
txGet(long timeout,
java.util.concurrent.TimeUnit unit)
Waits if necessary for at most the given time for the computation
to complete, and then retrieves its result, if available. |
Methods inherited from class org.elasticsearch.common.util.concurrent.AbstractFuture |
cancel, cancel, done, get, get, isCancelled, isDone, set, setException |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.concurrent.Future |
cancel, get, get, isCancelled, isDone |
PlainTransportFuture
public PlainTransportFuture(TransportResponseHandler<V> handler)
txGet
public V txGet()
throws ElasticSearchException
- Description copied from interface:
TransportFuture
- Waits if necessary for the computation to complete, and then
retrieves its result.
- Specified by:
txGet
in interface TransportFuture<V extends Streamable>
- Throws:
ElasticSearchException
txGet
public V txGet(long timeout,
java.util.concurrent.TimeUnit unit)
throws ElasticSearchException
- Description copied from interface:
TransportFuture
- Waits if necessary for at most the given time for the computation
to complete, and then retrieves its result, if available.
- Specified by:
txGet
in interface TransportFuture<V extends Streamable>
- Throws:
ElasticSearchException
newInstance
public V newInstance()
- Description copied from interface:
TransportResponseHandler
- creates a new instance of the return type from the remote call.
called by the infra before de-serializing the response.
- Specified by:
newInstance
in interface TransportResponseHandler<V extends Streamable>
- Returns:
- a new response copy.
executor
public java.lang.String executor()
- Specified by:
executor
in interface TransportResponseHandler<V extends Streamable>
handleResponse
public void handleResponse(V response)
- Specified by:
handleResponse
in interface TransportResponseHandler<V extends Streamable>
handleException
public void handleException(TransportException exp)
- Specified by:
handleException
in interface TransportResponseHandler<V extends Streamable>
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object