Class Trace

java.lang.Object
com.yahoo.search.query.Trace
All Implemented Interfaces:
Cloneable

public class Trace extends Object implements Cloneable
Trace settings and methods for tracing a query. The actual trace is a tree structure stored in the query execution.
Author:
bratseth
  • Field Details

  • Constructor Details

    • Trace

      public Trace(Query parent)
  • Method Details

    • getArgumentType

      public static QueryProfileType 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)
    • getProfiling

      public Profiling getProfiling()
    • trace

      public void trace(String message, int traceLevel)
      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 add
      traceLevel - the context level of the message, this method will do nothing if the traceLevel of the query is lower than this value
    • trace

      public void trace(Object message, int traceLevel)
    • trace

      public void trace(String message, boolean includeQuery, int traceLevel)
      Adds a trace message to this query if the trace level of the query is sufficiently high.
      Parameters:
      message - the message to add
      includeQuery - true to append the query root stringValue at the end of the message
      traceLevel - the context level of the message, this method will do nothing if the traceLevel of the query is lower than this value
    • trace

      public void trace(boolean includeQuery, int traceLevel, Object... messages)
      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 message
      traceLevel - the context level of the message, this method will do nothing if the traceLevel of the query is lower than this value
      messages - 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

      public Trace cloneFor(Query parent)
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • clone

      public Trace clone()
      Overrides:
      clone in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object