com.datastax.driver.core
Class ExecutionInfo

java.lang.Object
  extended by com.datastax.driver.core.ExecutionInfo

public class ExecutionInfo
extends Object

Basic information on the execution of a query.

This provides the following information on the execution of a (successful) query:


Method Summary
 ConsistencyLevel getAchievedConsistencyLevel()
          If the query returned without achieving the requested consistency level due to the RetryPolicy, this return the biggest consistency level that has been actually achieved by the query.
 Host getQueriedHost()
          Return the Cassandra host that coordinated this query.
 QueryTrace getQueryTrace()
          The query trace if tracing was enabled on this query.
 List<Host> getTriedHosts()
          The list of tried hosts for this query.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getTriedHosts

public List<Host> getTriedHosts()
The list of tried hosts for this query.

In general, this will be a singleton list with the host that coordinated that query. However, if an host is tried by the driver but is dead or in error, that host is recorded and the query is retry. Also, on a timeout or unavailable exception, some RetryPolicy may retry the query on the same host, so the same host might appear twice.

If you are only interested in fetching the final (and often only) node coordinating the query, getQueriedHost() provides a shortcut to fetch the last element of the list returned by this method.

Returns:
the list of tried hosts for this query, in the order tried.

getQueriedHost

public Host getQueriedHost()
Return the Cassandra host that coordinated this query.

This is a shortcut for getTriedHosts().get(getTriedHosts().size()).

Returns:
return the Cassandra host that coordinated this query.

getAchievedConsistencyLevel

public ConsistencyLevel getAchievedConsistencyLevel()
If the query returned without achieving the requested consistency level due to the RetryPolicy, this return the biggest consistency level that has been actually achieved by the query.

Note that the default RetryPolicy (DefaultRetryPolicy) will never allow a query to be successful without achieving the initially requested consistency level and hence with that default policy, this method will always return null. However, it might occasionally return a non-null with say, DowngradingConsistencyRetryPolicy.


getQueryTrace

public QueryTrace getQueryTrace()
The query trace if tracing was enabled on this query.

Returns:
the QueryTrace object for this query if tracing was enable for this query, or null otherwise.


Copyright © 2013. All Rights Reserved.