Package com.yahoo.search.query
Class Trace
java.lang.Object
com.yahoo.search.query.Trace
- All Implemented Interfaces:
Cloneable
Trace settings and methods for tracing a query.
The actual trace is a tree structure stored in the query execution.
- Author:
- bratseth
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionclone()
boolean
static QueryProfileType
int
int
getLevel()
Returns the level of detail we'll be tracing at in this query.int
boolean
getQuery()
Returns whether any trace entries should include the query.boolean
Returns whether trace entries should have a timestamp.int
hashCode()
boolean
isTraceable
(int level) void
setExplainLevel
(int explainLevel) Sets the explain level of this query, 0 means no tracing.void
setLevel
(int level) void
setProfileDepth
(int profileDepth) Sets the profiling depth.void
setQuery
(boolean query) void
setTimestamps
(boolean timestamps) toString()
void
Adds a trace message to this query if the trace level of the query is sufficiently high.void
void
Adds a trace message to this query if the trace level of the query is sufficiently high.void
Adds a context message to this query and to the info log, if the context level of the query is sufficiently high.void
Traces how properties was resolved and from where.
-
Field Details
-
TRACE
- See Also:
-
LEVEL
- See Also:
-
EXPLAIN_LEVEL
- See Also:
-
PROFILE_DEPTH
- See Also:
-
TIMESTAMPS
- See Also:
-
QUERY
- See Also:
-
-
Constructor Details
-
Trace
-
-
Method Details
-
getArgumentType
-
getLevel
public int getLevel()Returns the level of detail we'll be tracing at in this query. The default level is 0; no tracing. -
setLevel
public void setLevel(int level) -
isTraceable
public boolean isTraceable(int level) -
setExplainLevel
public void setExplainLevel(int explainLevel) Sets the explain level of this query, 0 means no tracing. Higher numbers means increasingly more explaining. -
getExplainLevel
public int getExplainLevel() -
setProfileDepth
public void setProfileDepth(int profileDepth) Sets the profiling depth. Profiling enabled if non-zero. Higher numbers means increasingly more detail. -
getProfileDepth
public int getProfileDepth() -
getTimestamps
public boolean getTimestamps()Returns whether trace entries should have a timestamp. Default is false. -
setTimestamps
public void setTimestamps(boolean timestamps) -
getQuery
public boolean getQuery()Returns whether any trace entries should include the query. Default is true. -
setQuery
public void setQuery(boolean query) -
trace
Adds a context message to this query and to the info log, if the context level of the query is sufficiently high. The context information will be carried over to the result at creation. The message parameter will be included with XML escaping.- Parameters:
message
- the message to addtraceLevel
- the context level of the message, this method will do nothing if the traceLevel of the query is lower than this value
-
trace
-
trace
Adds a trace message to this query if the trace level of the query is sufficiently high.- Parameters:
message
- the message to addincludeQuery
- true to append the query root stringValue at the end of the messagetraceLevel
- the context level of the message, this method will do nothing if the traceLevel of the query is lower than this value
-
trace
Adds a trace message to this query if the trace level of the query is sufficiently high.- Parameters:
includeQuery
- true to append the query root stringValue at the end of the messagetraceLevel
- the context level of the message, this method will do nothing if the traceLevel of the query is lower than this valuemessages
- the messages whose toStrings will be concatenated into the trace message. Concatenation will only happen if the trace level is sufficiently high.
-
traceProperties
public void traceProperties()Traces how properties was resolved and from where. Done after the fact to avoid special handling of tracelevel, which is the property deciding whether this needs to be done -
cloneFor
-
equals
-
hashCode
public int hashCode() -
clone
-
toString
-