db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhille...@apache.org
Subject svn commit: r1454537 - in /db/derby/code/trunk: java/engine/org/apache/derby/catalog/Java5SystemProcedures.java java/tools/org/apache/derby/impl/tools/optional/OptimizerTracer.java tools/jar/tools.properties
Date Fri, 08 Mar 2013 20:42:09 GMT
Author: rhillegas
Date: Fri Mar  8 20:42:08 2013
New Revision: 1454537

URL: http://svn.apache.org/r1454537
Log:
DERBY-6022: Add an optional tool for turning on optimizer tracing and dumping the trace to
the console.

Added:
    db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/optional/OptimizerTracer.java
  (with props)
Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/catalog/Java5SystemProcedures.java
    db/derby/code/trunk/tools/jar/tools.properties

Modified: db/derby/code/trunk/java/engine/org/apache/derby/catalog/Java5SystemProcedures.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/catalog/Java5SystemProcedures.java?rev=1454537&r1=1454536&r2=1454537&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/catalog/Java5SystemProcedures.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/catalog/Java5SystemProcedures.java Fri
Mar  8 20:42:08 2013
@@ -64,6 +64,7 @@ public  class   Java5SystemProcedures
     {
         { "databaseMetaData", "org.apache.derby.impl.tools.optional.DBMDWrapper" },
         { "foreignViews", "org.apache.derby.impl.tools.optional.ForeignDBViews" },
+        { "optimizerTracing", "org.apache.derby.impl.tools.optional.OptimizerTracer" },
     };
 
     ///////////////////////////////////////////////////////////////////////////////////

Added: db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/optional/OptimizerTracer.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/optional/OptimizerTracer.java?rev=1454537&view=auto
==============================================================================
--- db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/optional/OptimizerTracer.java
(added)
+++ db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/optional/OptimizerTracer.java
Fri Mar  8 20:42:08 2013
@@ -0,0 +1,89 @@
+/*
+
+   Derby - Class org.apache.derby.impl.tools.optional.OptimizerTracer
+
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
+ */
+
+package org.apache.derby.impl.tools.optional;
+
+import java.sql.SQLException;
+
+import org.apache.derby.iapi.db.OptimizerTrace;
+import org.apache.derby.iapi.sql.dictionary.OptionalTool;
+
+/**
+ * <p>
+ * OptionalTool to create wrapper functions and views for all of the user tables
+ * in a foreign database.
+ * </p>
+ */
+public	class   OptimizerTracer  implements OptionalTool
+{
+    ////////////////////////////////////////////////////////////////////////
+    //
+    //	CONSTANTS
+    //
+    ////////////////////////////////////////////////////////////////////////
+
+    ////////////////////////////////////////////////////////////////////////
+    //
+    //	STATE
+    //
+    ////////////////////////////////////////////////////////////////////////
+
+    ////////////////////////////////////////////////////////////////////////
+    //
+    //	CONSTRUCTOR
+    //
+    ////////////////////////////////////////////////////////////////////////
+
+    /** 0-arg constructor required by the OptionalTool contract */
+    public  OptimizerTracer() {}
+
+    ///////////////////////////////////////////////////////////////////////////////////
+    //
+    // OptionalTool BEHAVIOR
+    //
+    ///////////////////////////////////////////////////////////////////////////////////
+
+    /**
+     * <p>
+     * Turns on optimizer tracing.
+     * </p>
+     */
+    public  void    loadTool( String... configurationParameters )
+        throws SQLException
+    {
+        OptimizerTrace.setOptimizerTrace( true );
+    }
+
+    /**
+     * <p>
+     * Dump the optimizer trace and turn off tracing.
+     * </p>
+     */
+    public  void    unloadTool( String... configurationParameters )
+        throws SQLException
+    {
+        System.out.println( OptimizerTrace.getOptimizerTraceOutput() );
+
+        OptimizerTrace.setOptimizerTrace( false );
+    }
+
+}
+

Propchange: db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/optional/OptimizerTracer.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: db/derby/code/trunk/tools/jar/tools.properties
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/tools/jar/tools.properties?rev=1454537&r1=1454536&r2=1454537&view=diff
==============================================================================
--- db/derby/code/trunk/tools/jar/tools.properties (original)
+++ db/derby/code/trunk/tools/jar/tools.properties Fri Mar  8 20:42:08 2013
@@ -31,5 +31,6 @@ derby.module.SignatureChecker=org.apache
 derby.module.planexporter=org.apache.derby.tools.PlanExporter
 derby.module.dbmdwrapper=org.apache.derby.impl.tools.optional.DBMDWrapper
 derby.module.fdbv=org.apache.derby.impl.tools.optional.ForeignDBViews
+derby.module.opttrace=org.apache.derby.impl.tools.optional.OptimizerTracer
 
 



Mime
View raw message