me.prettyprint.cassandra.model
Class ExecutionResult<T>

java.lang.Object
  extended by 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

Field Summary
protected static String BASE_MSG_FORMAT
           
 
Constructor Summary
ExecutionResult(T value, long execTime, CassandraHost cassandraHost)
           
 
Method Summary
protected  String formatMessage(String resultName, String query)
           
 T get()
           
 long getExecutionTimeMicro()
          Execution time is actually recorded in nanos, so we divide this by 1000 make the number more sensible
 long getExecutionTimeNano()
           
 CassandraHost getHostUsed()
          The cassandra host that was actually used to execute the operation
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

BASE_MSG_FORMAT

protected static final String BASE_MSG_FORMAT
See Also:
Constant Field Values
Constructor Detail

ExecutionResult

public ExecutionResult(T value,
                       long execTime,
                       CassandraHost cassandraHost)
Method Detail

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.