public class ExecutionInfo extends Object
This provides the following information on the execution of a (successful) query:
Modifier and Type | Method and Description |
---|---|
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.
|
public List<Host> getTriedHosts()
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.
public Host getQueriedHost()
This is a shortcut for getTriedHosts().get(getTriedHosts().size())
.
public ConsistencyLevel getAchievedConsistencyLevel()
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
.
null
if the original consistency level of the query was
achieved, or the consistency level that was ultimately achieved if the
RetryPolicy
triggered a retry at a different consistency level
than the original one.public QueryTrace getQueryTrace()
QueryTrace
object for this query if tracing was
enable for this query, or null
otherwise.Copyright © 2014. All Rights Reserved.