Top Description Constructors Methods
org.apache.derby.impl.sql.execute.xplain

public Class XPLAINDefaultVisitor

extends Object
implements XPLAINVisitor
Class Inheritance
All Implemented Interfaces
org.apache.derby.iapi.sql.execute.xplain.XPLAINVisitor
Imports
java.sql.SQLException, org.apache.derby.iapi.services.monitor.Monitor, org.apache.derby.shared.common.stream.HeaderPrintWriter, org.apache.derby.iapi.sql.Activation, org.apache.derby.iapi.sql.conn.ConnectionUtil, .LanguageConnectionContext, org.apache.derby.iapi.sql.execute.RunTimeStatistics, .ResultSetStatistics, org.apache.derby.iapi.sql.execute.xplain.XPLAINVisitor

This is the Default Visitor which produces explain information like the old getRuntimeStatistics() approach.
It exists to support backward-compatibility. The only thing this visitor does, is to log the output of the statistics to the default log stream. (the file derby.log)

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
doXPLAIN(RunTimeStatistics rss, Activation activation)

Implements org.apache.derby.iapi.sql.execute.xplain.XPLAINVisitor.doXPLAIN.

This method is the hook method which is called from the TopResultSet.

public void
reset()

Implements org.apache.derby.iapi.sql.execute.xplain.XPLAINVisitor.reset.

Call this method to reset the visitor for a new run over the statistics.

public void
setNumberOfChildren(int
the number of children of the current explained node.
noChildren
)

Implements org.apache.derby.iapi.sql.execute.xplain.XPLAINVisitor.setNumberOfChildren.

This method informs the visitor about the number of children.

public void
visit(ResultSetStatistics
the statistics, which want to get explained.
statistics
)

Implements org.apache.derby.iapi.sql.execute.xplain.XPLAINVisitor.visit.

This is the Visitor hook method, which gets called from each ResultSetStatistics.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

XPLAINDefaultVisitorback to summary
public XPLAINDefaultVisitor()

Method Detail

doXPLAINback to summary
public void doXPLAIN(RunTimeStatistics rss, Activation activation)

Implements org.apache.derby.iapi.sql.execute.xplain.XPLAINVisitor.doXPLAIN.

Doc from org.apache.derby.iapi.sql.execute.xplain.XPLAINVisitor.doXPLAIN.

This method is the hook method which is called from the TopResultSet. It starts the explanation of the current ResultSetStatistics tree and keeps the information during one explain run.

resetback to summary
public void reset()

Implements org.apache.derby.iapi.sql.execute.xplain.XPLAINVisitor.reset.

Doc from org.apache.derby.iapi.sql.execute.xplain.XPLAINVisitor.reset.

Call this method to reset the visitor for a new run over the statistics. A default implementation should call this method automatically at first of a call of doXPLAIN().

setNumberOfChildrenback to summary
public void setNumberOfChildren(int noChildren)

Implements org.apache.derby.iapi.sql.execute.xplain.XPLAINVisitor.setNumberOfChildren.

Doc from org.apache.derby.iapi.sql.execute.xplain.XPLAINVisitor.setNumberOfChildren.

This method informs the visitor about the number of children. It has to be called first! by the different explainable nodes before the visit method of the visitor gets called. Each node knows how many children he has. The visitor can use this information to resolve the relationship of the current explained node to above nodes. Due to the top-down, pre-order, depth-first traversal of the tree, this information can directly be exploited.

Parameters
noChildren:int

the number of children of the current explained node.

visitback to summary
public void visit(ResultSetStatistics statistics)

Implements org.apache.derby.iapi.sql.execute.xplain.XPLAINVisitor.visit.

Doc from org.apache.derby.iapi.sql.execute.xplain.XPLAINVisitor.visit.

This is the Visitor hook method, which gets called from each ResultSetStatistics. It depends on the sub-class implementation of this interface, to describe the behaviour of the explanation facility.
To be easily extendable with new explain representation methods, just implement this interface and provide the new behaviour.

Parameters
statistics:ResultSetStatistics

the statistics, which want to get explained.