me.prettyprint.cassandra.model
Class ExecutionResult<T>
java.lang.Object
me.prettyprint.cassandra.model.ExecutionResult<T>
- All Implemented Interfaces:
- ResultStatus
- Direct Known Subclasses:
- MutationResultImpl, QueryResultImpl
public class ExecutionResult<T>
- extends Object
- implements ResultStatus
Describes the state of the executed cassandra command.
This is a handy call metadata inspector which reports the call's execution time, status,
which actual host was connected etc.
- Author:
- Ran, zznate
BASE_MSG_FORMAT
protected static final String BASE_MSG_FORMAT
- See Also:
- Constant Field Values
ExecutionResult
public ExecutionResult(T value,
long execTime,
CassandraHost cassandraHost)
get
public T get()
- Returns:
- the actual value returned from the query (or null if it was a mutation that doesn't
return a value)
getExecutionTimeNano
public long getExecutionTimeNano()
- Specified by:
getExecutionTimeNano
in interface ResultStatus
- Returns:
- the execution time, as already recorded, in nanos
getExecutionTimeMicro
public long getExecutionTimeMicro()
- Execution time is actually recorded in nanos, so we divide this by 1000
make the number more sensible
- Specified by:
getExecutionTimeMicro
in interface ResultStatus
- Returns:
toString
public String toString()
- Overrides:
toString
in class Object
formatMessage
protected String formatMessage(String resultName,
String query)
getHostUsed
public CassandraHost getHostUsed()
- The cassandra host that was actually used to execute the operation
- Specified by:
getHostUsed
in interface ResultStatus
Copyright © 2011. All Rights Reserved.