public class QueryTrace extends Object
sessions
and
events
table in the system_traces
keyspace and can be
retrieve manually using the trace identifier (the one returned by
getTraceId()
).
This class provides facilities to fetch the traces from Cassandra. Please
note that the writing of the trace is done asynchronously in Cassandra. So
accessing the trace too soon after the query may result in the trace being
incomplete.Modifier and Type | Class and Description |
---|---|
static class |
QueryTrace.Event
A trace event.
|
Modifier and Type | Method and Description |
---|---|
InetAddress |
getCoordinator()
Returns the coordinator host of the query.
|
int |
getDurationMicros()
Returns the server-side duration of the query in microseconds.
|
List<QueryTrace.Event> |
getEvents()
Returns the events contained in this trace.
|
Map<String,String> |
getParameters()
Returns the parameters attached to this trace.
|
String |
getRequestType()
Returns the type of request.
|
long |
getStartedAt()
Returns the server-side timestamp of the start of this query.
|
UUID |
getTraceId()
Returns the identifier of this trace.
|
String |
toString() |
public UUID getTraceId()
public String getRequestType()
null
if the request
type is not yet available.TraceRetrievalException
- if the trace details cannot be retrieve
from Cassandra successfully.public int getDurationMicros()
Integer.MIN_VALUE
if the duration is not yet
available.TraceRetrievalException
- if the trace details cannot be retrieve
from Cassandra successfully.public InetAddress getCoordinator()
null
if the coordinator is not yet available.TraceRetrievalException
- if the trace details cannot be retrieve
from Cassandra successfully.public Map<String,String> getParameters()
null
if the coordinator is not yet available.TraceRetrievalException
- if the trace details cannot be retrieve
from Cassandra successfully.public long getStartedAt()
TraceRetrievalException
- if the trace details cannot be retrieve
from Cassandra successfully.public List<QueryTrace.Event> getEvents()
TraceRetrievalException
- if the trace details cannot be retrieve
from Cassandra successfully.