Class OptimizerTracer

java.lang.Object
org.apache.derby.impl.sql.compile.OptimizerTracer
All Implemented Interfaces:
OptionalTool

public class OptimizerTracer extends Object implements OptionalTool

OptionalTool for tracing the Optimizer.

  • Constructor Details

    • OptimizerTracer

      public OptimizerTracer()
      0-arg constructor required by the OptionalTool contract
  • Method Details

    • loadTool

      public void loadTool(String... configurationParameters) throws SQLException

      Turns on optimizer tracing. May take optional parameters:

      • xml - If the first arg is the "xml" literal, then trace output will be formatted as xml.
      • custom, $class - If the first arg is the "custom" literal, then the next arg must be the name of a class which implements org.apache.derby.iapi.sql.compile.OptTrace and which has a 0-arg constructor. The 0-arg constructor is called and the resulting OptTrace object is plugged in to trace the optimizer.
      Specified by:
      loadTool in interface OptionalTool
      Throws:
      SQLException
    • cantInstantiate

      private SQLException cantInstantiate(String className)
    • unloadTool

      public void unloadTool(String... configurationParameters) throws SQLException

      Print the optimizer trace and turn off tracing. Takes optional parameters:

      • fileName - Where to write the optimizer trace. If omitted, the trace is written to System.out.
      Specified by:
      unloadTool in interface OptionalTool
      Throws:
      SQLException
    • wrap

      private SQLException wrap(Throwable t)
      Wrap an exception in a SQLException
    • wrap

      private SQLException wrap(String errorMessage)
    • getContext

      private static Context getContext(String contextID)
      Privileged lookup of a Context. Must be private so that user code can't call this entry point.