Class CalciteTrace

java.lang.Object
org.apache.calcite.util.trace.CalciteTrace

public abstract class CalciteTrace extends Object
Contains all of the tracers used within org.apache.calcite class libraries.

Note to developers

Please ensure that every tracer used in org.apache.calcite is added to this class as a public static final member called componentTracer. For example, getPlannerTracer() is the tracer used by all classes which take part in the query planning process.

The javadoc in this file is the primary source of information on what tracers are available, so the javadoc against each tracer member must be an up-to-date description of what that tracer does.

In the class where the tracer is used, create a private (or perhaps protected) static final member called tracer.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final org.slf4j.Logger
    The "org.apache.calcite.sql.parser" tracer reports parser events in SqlParser and other classes at DEBUG.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static ThreadLocal<@Nullable Function2<Void,File,String>>
    Thread-local handler that is called with dynamically generated Java code.
    static org.slf4j.Logger
    The "org.apache.calcite.sql.parser" tracer reports parse events.
    static org.slf4j.Logger
    Reports volcano planner optimization task events.
    static org.slf4j.Logger
    The "org.apache.calcite.plan.RelOptPlanner" tracer prints the query optimization process.
    static org.slf4j.Logger
    The "org.apache.calcite.rel.RelImplementorImpl" tracer reports when expressions are bound to variables (DEBUG, formerly FINE)
    static org.slf4j.Logger
     
    static org.slf4j.Logger
    The tracer "org.apache.calcite.sql.timing" traces timing for various stages of query processing.
    static org.slf4j.Logger
    The "org.apache.calcite.sql2rel" tracer reports parse events.
    static org.slf4j.Logger
    The "org.apache.calcite.prepare.Prepare" tracer prints the generated program at DEBUG (formerly, FINE) or higher.
    static org.slf4j.Logger
    getTestTracer(Class<?> testClass)
    The tracers report important/useful information related with the execution of unit tests.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • PARSER_LOGGER

      public static final org.slf4j.Logger PARSER_LOGGER
      The "org.apache.calcite.sql.parser" tracer reports parser events in SqlParser and other classes at DEBUG.
  • Constructor Details

    • CalciteTrace

      public CalciteTrace()
  • Method Details

    • getPlannerTracer

      public static org.slf4j.Logger getPlannerTracer()
      The "org.apache.calcite.plan.RelOptPlanner" tracer prints the query optimization process.

      Levels:

      • Logger.debug(String) (formerly FINE) prints rules as they fire;
      • Logger.trace(String) (formerly FINER) prints and validates the whole expression pool and rule queue as each rule fires;
      • Logger.trace(String) (formerly FINEST) also prints finer details like rule importances.
    • getPlannerTaskTracer

      public static org.slf4j.Logger getPlannerTaskTracer()
      Reports volcano planner optimization task events.
    • getStatementTracer

      public static org.slf4j.Logger getStatementTracer()
      The "org.apache.calcite.prepare.Prepare" tracer prints the generated program at DEBUG (formerly, FINE) or higher.
    • getRelImplementorTracer

      public static org.slf4j.Logger getRelImplementorTracer()
      The "org.apache.calcite.rel.RelImplementorImpl" tracer reports when expressions are bound to variables (DEBUG, formerly FINE)
    • getSqlTimingTracer

      public static org.slf4j.Logger getSqlTimingTracer()
      The tracer "org.apache.calcite.sql.timing" traces timing for various stages of query processing.
      See Also:
    • getParserTracer

      public static org.slf4j.Logger getParserTracer()
      The "org.apache.calcite.sql.parser" tracer reports parse events.
    • getSqlToRelTracer

      public static org.slf4j.Logger getSqlToRelTracer()
      The "org.apache.calcite.sql2rel" tracer reports parse events.
    • getRuleAttemptsTracer

      public static org.slf4j.Logger getRuleAttemptsTracer()
    • getTestTracer

      public static org.slf4j.Logger getTestTracer(Class<?> testClass)
      The tracers report important/useful information related with the execution of unit tests.
    • getDynamicHandler

      public static ThreadLocal<@Nullable Function2<Void,File,String>> getDynamicHandler()
      Thread-local handler that is called with dynamically generated Java code. It exists for unit-testing. The handler is never null; the default handler does nothing.