org.apache.derby.impl.sql.execute.xplain
Class XPLAINSystemTableVisitor

java.lang.Object
  extended by org.apache.derby.impl.sql.execute.xplain.XPLAINSystemTableVisitor
All Implemented Interfaces:
XPLAINVisitor

public class XPLAINSystemTableVisitor
extends java.lang.Object
implements XPLAINVisitor

This is the Visitor, which explains the information and stores the statistics in the system catalogs. It traverses the result set statistics tree and extracts the information.


Field Summary
private  Activation activation
           
private  boolean considerTimingInformation
           
private  DataDictionary dd
           
private  DataDescriptorGenerator ddg
           
private  LanguageConnectionContext lcc
           
private  boolean no_call_stmts
           
private  int noChildren
           
private  java.util.List rsets
           
private  java.util.List rsetsTimings
           
private  java.util.List scanrsets
           
private  java.util.List sortrsets
           
private  XPLAINStatementDescriptor stmt
           
private  XPLAINStatementTimingsDescriptor stmtTimings
           
private  UUID stmtUUID
           
private  TransactionController tc
           
private  java.util.Stack UUIDStack
           
 
Constructor Summary
XPLAINSystemTableVisitor()
           
 
Method Summary
private  void addArraysToSystemCatalogs()
          This method writes the created descriptor arrays to the cooresponding system catalogs.
private  void addStmtDescriptorsToSystemCatalog()
          This method writes only the stmt and its timing descriptor to the dataDictionary
private  void clean()
          This method cleans up things after explanation.
 void doXPLAIN(RunTimeStatistics rss, Activation activation)
          the interface method, which gets called by the Top-ResultSet, which starts the tree traversal.
private  java.sql.Connection getDefaultConn()
          Open a nested Connection with which to execute INSERT statements.
private  void pushUUIDnoChildren(UUID uuid)
          helper method, which pushes the UUID, "number of Children" times onto the UUIDStack.
 void reset()
          This method resets the visitor.
 void setNumberOfChildren(int noChildren)
          this method only stores the current number of children of the current explained node.
 void visit(ResultSetStatistics statistics)
          Visit this node, calling back to it to get details.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

no_call_stmts

private boolean no_call_stmts

lcc

private LanguageConnectionContext lcc

dd

private DataDictionary dd

tc

private TransactionController tc

ddg

private DataDescriptorGenerator ddg

activation

private Activation activation

considerTimingInformation

private boolean considerTimingInformation

stmt

private XPLAINStatementDescriptor stmt

stmtTimings

private XPLAINStatementTimingsDescriptor stmtTimings

stmtUUID

private UUID stmtUUID

rsets

private java.util.List rsets

rsetsTimings

private java.util.List rsetsTimings

sortrsets

private java.util.List sortrsets

scanrsets

private java.util.List scanrsets

noChildren

private int noChildren

UUIDStack

private java.util.Stack UUIDStack
Constructor Detail

XPLAINSystemTableVisitor

public XPLAINSystemTableVisitor()
Method Detail

pushUUIDnoChildren

private void pushUUIDnoChildren(UUID uuid)
helper method, which pushes the UUID, "number of Children" times onto the UUIDStack.

Parameters:
uuid - the UUID to push

setNumberOfChildren

public void setNumberOfChildren(int noChildren)
this method only stores the current number of children of the current explained node. The child nodes then can re-use this information.

Specified by:
setNumberOfChildren in interface XPLAINVisitor
Parameters:
noChildren - the number of children of the current explained node.

visit

public void visit(ResultSetStatistics statistics)
Visit this node, calling back to it to get details. This method visits the RS Statisitcs node, calling back to the node to get detailed descriptor information about it.

Specified by:
visit in interface XPLAINVisitor
Parameters:
statistics - the statistics, which want to get explained.

reset

public void reset()
This method resets the visitor. Gets called right before explanation to make sure all needed objects exist and are up to date and the lists are cleared

Specified by:
reset in interface XPLAINVisitor

doXPLAIN

public void doXPLAIN(RunTimeStatistics rss,
                     Activation activation)
              throws StandardException
the interface method, which gets called by the Top-ResultSet, which starts the tree traversal.

Specified by:
doXPLAIN in interface XPLAINVisitor
Throws:
StandardException

clean

private void clean()
This method cleans up things after explanation. It frees kept resources and still holded references.


getDefaultConn

private java.sql.Connection getDefaultConn()
                                    throws java.sql.SQLException
Open a nested Connection with which to execute INSERT statements.

Throws:
java.sql.SQLException

addStmtDescriptorsToSystemCatalog

private void addStmtDescriptorsToSystemCatalog()
                                        throws StandardException,
                                               java.sql.SQLException
This method writes only the stmt and its timing descriptor to the dataDictionary

Throws:
StandardException
java.sql.SQLException

addArraysToSystemCatalogs

private void addArraysToSystemCatalogs()
                                throws StandardException,
                                       java.sql.SQLException
This method writes the created descriptor arrays to the cooresponding system catalogs.

Throws:
StandardException
java.sql.SQLException

Built on Thu 2010-12-23 20:49:13+0000, from revision ???

Apache Derby V10.6 Internals - Copyright © 2004,2007 The Apache Software Foundation. All Rights Reserved.