|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.derby.iapi.sql.compile.NodeFactory
org.apache.derby.impl.sql.compile.NodeFactoryImpl
public class NodeFactoryImpl
This class is a factory for QueryTreeNode nodes. It exists to provide methods to generate new nodes without having to call new directly. In the future, it may implement caching of nodes, as well, to avoid memory management and garbage collection.
Field Summary | |
---|---|
private static java.util.Vector |
emptyVector
|
private java.lang.Boolean |
joinOrderOptimization
|
private ClassInfo[] |
nodeCi
|
Fields inherited from class org.apache.derby.iapi.sql.compile.NodeFactory |
---|
MODULE |
Constructor Summary | |
---|---|
NodeFactoryImpl()
Every Module needs a public niladic constructor. |
Method Summary | |
---|---|
void |
boot(boolean create,
java.util.Properties startParams)
Boot this module with the given properties. |
boolean |
canSupport(java.util.Properties startParams)
Module supports the standard database engine and a storeless SQL engine. |
java.lang.Boolean |
doJoinOrderOptimization()
Tell whether to do join order optimization. |
QueryTreeNode |
getCreateAliasNode(java.lang.Object aliasName,
java.lang.Object targetName,
java.lang.Object aliasSpecificInfo,
char aliasType,
java.lang.Boolean delimitedIdentifier,
ContextManager cm)
Get one of the several types of create alias nodes. |
QueryTreeNode |
getNode(int nodeType,
ContextManager cm)
Get a node that takes no initializer arguments. |
ResultSetNode |
mapTableAsVTI(TableDescriptor td,
java.lang.String correlationName,
ResultColumnList resultColumns,
java.util.Properties tableProperties,
ContextManager cm)
Return a node that represents invocation of the virtual table for the given table descriptor. |
protected java.lang.String |
nodeName(int nodeType)
Translate a node type from C_NodeTypes to a class name |
void |
stop()
Stop the module. |
Methods inherited from class org.apache.derby.iapi.sql.compile.NodeFactory |
---|
getNode, getNode, getNode, getNode, getNode, getNode, getNode, getNode, getNode, getNode, getNode, getNode, getNode, getNode |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private java.lang.Boolean joinOrderOptimization
private final ClassInfo[] nodeCi
private static final java.util.Vector emptyVector
Constructor Detail |
---|
public NodeFactoryImpl()
Method Detail |
---|
public boolean canSupport(java.util.Properties startParams)
canSupport
in interface ModuleSupportable
public void boot(boolean create, java.util.Properties startParams) throws StandardException
ModuleControl
An implementation's boot method can throw StandardException. If it is thrown the module is not registered by the monitor and therefore cannot be found through a findModule(). In this case the module's stop() method is not called, thus throwing this exception must free up any resources.
When create is true the contents of the properties object
will be written to the service.properties of the persistent
service. Thus any code that requires an entry in service.properties
must explicitly place the value in this properties set
using the put method.
Typically the properties object contains one or more default
properties sets, which are not written out to service.properties.
These default sets are how callers modify the create process. In a
JDBC connection database create the first set of defaults is a properties
object that contains the attributes that were set on the jdbc:derby: URL.
This attributes properties set has the second default properties set as
its default. This set (which could be null) contains the properties
that the user set on their DriverManager.getConnection() call, and are thus
not owned by Derby code, and thus must not be modified by Derby
code.
When create is false the properties object contains all the properties set in the service.properties file plus a limited number of attributes from the JDBC URL attributes or connection properties set. This avoids properties set by the user compromising the boot process. An example of a property passed in from the JDBC world is the bootPassword for encrypted databases.
Code should not hold onto the passed in properties reference after boot time as its contents may change underneath it. At least after the complete boot is completed, the links to all the default sets will be removed.
boot
in interface ModuleControl
StandardException
- OoopsMonitor
public void stop()
ModuleControl
stop
in interface ModuleControl
Monitor
public java.lang.Boolean doJoinOrderOptimization()
NodeFactory
doJoinOrderOptimization
in class NodeFactory
NodeFactory.doJoinOrderOptimization()
public QueryTreeNode getNode(int nodeType, ContextManager cm) throws StandardException
NodeFactory
getNode
in class NodeFactory
nodeType
- Identifier for the type of node.cm
- A ContextManager
StandardException
- Thrown on errorNodeFactory.getNode(int, org.apache.derby.iapi.services.context.ContextManager)
protected java.lang.String nodeName(int nodeType) throws StandardException
nodeType
- A node type identifier from C_NodeTypes
StandardException
- Thrown on errorpublic QueryTreeNode getCreateAliasNode(java.lang.Object aliasName, java.lang.Object targetName, java.lang.Object aliasSpecificInfo, char aliasType, java.lang.Boolean delimitedIdentifier, ContextManager cm) throws StandardException
getCreateAliasNode
in class NodeFactory
aliasName
- The name of the aliastargetName
- The full path/method namealiasSpecificInfo
- The full path of the target method name,
if anyaliasType
- The type of alias to createdelimitedIdentifier
- Whether or not to treat the class name
as a delimited identifier if trying to
resolve it as a class alias.cm
- A ContextManager
StandardException
- Thrown on errorpublic ResultSetNode mapTableAsVTI(TableDescriptor td, java.lang.String correlationName, ResultColumnList resultColumns, java.util.Properties tableProperties, ContextManager cm) throws StandardException
Currently only handles no argument vtis corresponding to a subset of the diagnostic tables. (e.g. lock_table). The node returned is a FROM_VTI node with a passed in NEW_INVOCATION_NODE representing the class, with no arguments. Other attributes of the original FROM_TABLE node (such as resultColumns) are passed into the FROM_VTI node.
mapTableAsVTI
in class NodeFactory
td
- Table that is really a vticorrelationName
- Correlation name of table clauseresultColumns
- Columns extracted from table.tableProperties
- Properties being passed onto the table scancm
- Current context manager
StandardException
|
Built on Thu 2012-03-29 21:53:33+0000, from revision ??? | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |