Class XPLAINDefaultVisitor
- java.lang.Object
-
- org.apache.derby.impl.sql.execute.xplain.XPLAINDefaultVisitor
-
- All Implemented Interfaces:
XPLAINVisitor
public class XPLAINDefaultVisitor extends java.lang.Object implements 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
Constructors Constructor Description XPLAINDefaultVisitor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
doXPLAIN(RunTimeStatistics rss, Activation activation)
This method is the hook method which is called from the TopResultSet.void
reset()
Call this method to reset the visitor for a new run over the statistics.void
setNumberOfChildren(int noChildren)
This method informs the visitor about the number of children.void
visit(ResultSetStatistics statistics)
This is the Visitor hook method, which gets called from each ResultSetStatistics.
-
-
-
Method Detail
-
visit
public void visit(ResultSetStatistics statistics)
Description copied from interface:XPLAINVisitor
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.- Specified by:
visit
in interfaceXPLAINVisitor
- Parameters:
statistics
- the statistics, which want to get explained.
-
reset
public void reset()
Description copied from interface:XPLAINVisitor
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().- Specified by:
reset
in interfaceXPLAINVisitor
-
doXPLAIN
public void doXPLAIN(RunTimeStatistics rss, Activation activation)
Description copied from interface:XPLAINVisitor
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.- Specified by:
doXPLAIN
in interfaceXPLAINVisitor
-
setNumberOfChildren
public void setNumberOfChildren(int noChildren)
Description copied from interface:XPLAINVisitor
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.- Specified by:
setNumberOfChildren
in interfaceXPLAINVisitor
- Parameters:
noChildren
- the number of children of the current explained node.
-
-