Top Description Methods
org.apache.derby.iapi.sql.execute.xplain

public Interface XPLAINVisitor

Known Direct Implementers
org.apache.derby.impl.sql.execute.xplain.XPLAINDefaultVisitor, org.apache.derby.impl.sql.execute.xplain.XPLAINSystemTableVisitor
Imports
java.sql.SQLException, org.apache.derby.shared.common.error.StandardException, org.apache.derby.iapi.sql.Activation, org.apache.derby.iapi.sql.execute.RunTimeStatistics, .ResultSetStatistics

Classes, which implement this interface have the ability to explain the gathered ResultSetStatistics. A Visitor pattern is used to traverse the ResultSetStatistics tree and to extract the required information. Classes implementing this interface are responsible about what they extract and what will be done with the extracted information. This approach allows easy representaion extensions of the statistics, e.g. an XML representation.

Method Summary

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

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

public void
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
)

This method informs the visitor about the number of children.

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

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

Method Detail

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

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()

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)

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)

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.