Class CalciteTrace


  • public abstract class CalciteTrace
    extends java.lang.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
      private static java.lang.ThreadLocal<Function2<java.lang.Void,​java.io.File,​java.lang.String>> DYNAMIC_HANDLER  
      static org.slf4j.Logger PARSER_LOGGER
      The "org.apache.calcite.sql.parser" tracer reports parser events in SqlParser and other classes at DEBUG.
    • Constructor Summary

      Constructors 
      Constructor Description
      CalciteTrace()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.ThreadLocal<Function2<java.lang.Void,​java.io.File,​java.lang.String>> getDynamicHandler()
      Thread-local handler that is called with dynamically generated Java code.
      static org.slf4j.Logger getParserTracer()
      The "org.apache.calcite.sql.parser" tracer reports parse events.
      static org.slf4j.Logger getPlannerTracer()
      The "org.apache.calcite.plan.RelOptPlanner" tracer prints the query optimization process.
      static org.slf4j.Logger getRelImplementorTracer()
      The "org.apache.calcite.rel.RelImplementorImpl" tracer reports when expressions are bound to variables (DEBUG, formerly FINE)
      static org.slf4j.Logger getSqlTimingTracer()
      The tracer "org.apache.calcite.sql.timing" traces timing for various stages of query processing.
      static org.slf4j.Logger getSqlToRelTracer()
      The "org.apache.calcite.sql2rel" tracer reports parse events.
      static org.slf4j.Logger getStatementTracer()
      The "org.apache.calcite.prepare.Prepare" tracer prints the generated program at DEBUG (formerly, FINE) or higher.
      • Methods inherited from class java.lang.Object

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

      • 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.
      • DYNAMIC_HANDLER

        private static final java.lang.ThreadLocal<Function2<java.lang.Void,​java.io.File,​java.lang.String>> DYNAMIC_HANDLER
    • Constructor Detail

      • CalciteTrace

        public CalciteTrace()
    • Method Detail

      • 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.
      • 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:
        CalciteTimingTracer
      • 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.
      • getDynamicHandler

        public static java.lang.ThreadLocal<Function2<java.lang.Void,​java.io.File,​java.lang.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.