com.netflix.astyanax.connectionpool.impl
Class OperationResultImpl<R>
java.lang.Object
com.netflix.astyanax.connectionpool.impl.OperationResultImpl<R>
- Type Parameters:
R -
- All Implemented Interfaces:
- OperationResult<R>
public class OperationResultImpl<R>
- extends java.lang.Object
- implements OperationResult<R>
Impl for OperationResult
Tracks operation attempts, operation pinned host and latency associated with the operation.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
OperationResultImpl
public OperationResultImpl(Host host,
R result,
long latency)
getHost
public Host getHost()
- Specified by:
getHost in interface OperationResult<R>
- Returns:
- Get the host on which the operation was performed
getResult
public R getResult()
- Specified by:
getResult in interface OperationResult<R>
- Returns:
- Get the result data
getLatency
public long getLatency()
- Specified by:
getLatency in interface OperationResult<R>
- Returns:
- Return the length of time to perform the operation. Does not include
connection pool overhead. This time is in nanoseconds
getLatency
public long getLatency(java.util.concurrent.TimeUnit units)
- Specified by:
getLatency in interface OperationResult<R>
- Returns:
- Return the length of time to perform the operation to the remote service. Does not include
connection pool overhead.
getAttemptsCount
public int getAttemptsCount()
- Specified by:
getAttemptsCount in interface OperationResult<R>
- Returns:
- Return the number of times the operation had to be retried. This includes
retries for aborted connections.
setAttemptsCount
public void setAttemptsCount(int count)
- Description copied from interface:
OperationResult
- Set the number of attempts executing this connection
- Specified by:
setAttemptsCount in interface OperationResult<R>