org.apache.derby.iapi.sql.execute
Interface ExecutionFactory

All Known Implementing Classes:
GenericExecutionFactory

public interface ExecutionFactory

This is the factory for creating a factories needed by execution per connection, and the context to hold them.

There is expected to be one of these configured per database.

If a factory is needed outside of execution (say, data dictionary or compilation), then it belongs in the LanguageConnectionContext.

See Also:
LanguageConnectionContext

Field Summary
static java.lang.String MODULE
          Module name for the monitor's module locating system.
 
Method Summary
 ExecIndexRow getIndexableRow(ExecRow valueRow)
          This returns the value row as an indexable row
 ExecIndexRow getIndexableRow(int numColumns)
          This returns an indexable row
 Qualifier getQualifier(int columnId, int operator, GeneratedMethod orderableGetter, Activation activation, boolean orderedNulls, boolean unknownRV, boolean negateCompareResult, int variantType)
          Get a Qualifier to use with a scan of a conglomerate.
 ResultColumnDescriptor getResultColumnDescriptor(ResultColumnDescriptor compileRCD)
          Create an execution time ResultColumnDescriptor from a compile time RCD.
 ResultDescription getResultDescription(ResultColumnDescriptor[] columns, java.lang.String statementType)
          Create a result description given parameters for it.
 ResultSetFactory getResultSetFactory()
          Only one result set factory is needed for a database in the system.
 ResultSetStatisticsFactory getResultSetStatisticsFactory()
          Get the ResultSetStatisticsFactory from this ExecutionFactory.
 RowChanger getRowChanger(long heapConglom, StaticCompiledOpenConglomInfo heapSCOCI, DynamicCompiledOpenConglomInfo heapDCOCI, IndexRowGenerator[] irgs, long[] indexCIDS, StaticCompiledOpenConglomInfo[] indexSCOCIs, DynamicCompiledOpenConglomInfo[] indexDCOCIs, int numberOfColumns, TransactionController tc, int[] changedColumnIds, FormatableBitSet baseRowReadList, int[] baseRowReadMap, int[] streamStorableColIds, Activation activation)
          Create a new RowChanger for doing insert update and delete operations based on partial before and after.
 RowChanger getRowChanger(long heapConglom, StaticCompiledOpenConglomInfo heapSCOCI, DynamicCompiledOpenConglomInfo heapDCOCI, IndexRowGenerator[] irgs, long[] indexCIDS, StaticCompiledOpenConglomInfo[] indexSCOCIs, DynamicCompiledOpenConglomInfo[] indexDCOCIs, int numberOfColumns, TransactionController tc, int[] changedColumnIds, int[] streamStorableHeapColIds, Activation activation)
          Create a new RowChanger for performing update and delete operations based on full before and after rows.
 ScanQualifier[][] getScanQualifier(int numQualifiers)
          Get an array of ScanQualifiers for a scan.
 ExecRow getValueRow(int numColumns)
          This returns a new row that is storable but not indexable
 XPLAINFactoryIF getXPLAINFactory()
          Get the XPLAINFactory from this ExecutionFactory.
 ExecutionContext newExecutionContext(ContextManager cm)
          Get the ExecutionFactory from this ExecutionContext.
 void releaseScanQualifier(ScanQualifier[][] scanQualifiers)
          Release a ScanQualifier[] (back to the pool or free it).
 

Field Detail

MODULE

static final java.lang.String MODULE
Module name for the monitor's module locating system.

See Also:
Constant Field Values
Method Detail

getResultSetFactory

ResultSetFactory getResultSetFactory()
Only one result set factory is needed for a database in the system. We require that an execution factory be configured for each database. Each execution factory then needs to know about the result set factory it is maintaining for its database, so that it can provide it through calls to this method. So, we reuse the result set factory by making it available to each connection in that connection's execution context.

Returns:
the result set factory for this database.

getResultSetStatisticsFactory

ResultSetStatisticsFactory getResultSetStatisticsFactory()
                                                         throws StandardException
Get the ResultSetStatisticsFactory from this ExecutionFactory.

Returns:
The result set statistics factory associated with this ExecutionFactory
Throws:
StandardException - Thrown on error

getXPLAINFactory

XPLAINFactoryIF getXPLAINFactory()
                                 throws StandardException
Get the XPLAINFactory from this ExecutionFactory.

Returns:
The xplain factory associated with this ExecutionContext
Throws:
StandardException - Thrown on error

newExecutionContext

ExecutionContext newExecutionContext(ContextManager cm)
Get the ExecutionFactory from this ExecutionContext. We want an execution context so that we can push it onto the stack. We could instead require the implementation push it onto the stack for us, but this way we know which context object exactly was pushed onto the stack.

Parameters:
cm - the context manager

getResultColumnDescriptor

ResultColumnDescriptor getResultColumnDescriptor(ResultColumnDescriptor compileRCD)
Create an execution time ResultColumnDescriptor from a compile time RCD.

Parameters:
compileRCD - The compile time RCD.
Returns:
The execution time ResultColumnDescriptor

getResultDescription

ResultDescription getResultDescription(ResultColumnDescriptor[] columns,
                                       java.lang.String statementType)
Create a result description given parameters for it.


getScanQualifier

ScanQualifier[][] getScanQualifier(int numQualifiers)
Get an array of ScanQualifiers for a scan. ScanQualifiers are used with the DataDictionary.

Parameters:
numQualifiers - The number of ScanQualifiers to get.

releaseScanQualifier

void releaseScanQualifier(ScanQualifier[][] scanQualifiers)
Release a ScanQualifier[] (back to the pool or free it).


getQualifier

Qualifier getQualifier(int columnId,
                       int operator,
                       GeneratedMethod orderableGetter,
                       Activation activation,
                       boolean orderedNulls,
                       boolean unknownRV,
                       boolean negateCompareResult,
                       int variantType)
Get a Qualifier to use with a scan of a conglomerate.

Parameters:
columnId - The store id of the column to qualify
operator - One of Orderable.ORDER_OP_EQUALS, Orderable.ORDER_OP_LESSTHAN, or Orderable.ORDER_OP_LESSOREQUALS
orderableGetter - A generated method that returns the Orderable to be compared with the column
activation - The Activation that acts as the receiver for the generated method
orderedNulls - True means that null == null for the sake of this Qualifier
unknownRV - The value to return if the comparison between the column and the Orderable value returns the unknown truth value
negateCompareResult - True means to negate the result of the comparison. So, for example, to do a > comparison, you would pass ORDER_OP_LESSOREQUALS and set negate to true.
variantType - The variantType for the qualifier's orderable. (Determines whether or not to cache the value.)
Returns:
A new Qualifier

getRowChanger

RowChanger getRowChanger(long heapConglom,
                         StaticCompiledOpenConglomInfo heapSCOCI,
                         DynamicCompiledOpenConglomInfo heapDCOCI,
                         IndexRowGenerator[] irgs,
                         long[] indexCIDS,
                         StaticCompiledOpenConglomInfo[] indexSCOCIs,
                         DynamicCompiledOpenConglomInfo[] indexDCOCIs,
                         int numberOfColumns,
                         TransactionController tc,
                         int[] changedColumnIds,
                         int[] streamStorableHeapColIds,
                         Activation activation)
                         throws StandardException
Create a new RowChanger for performing update and delete operations based on full before and after rows.

Parameters:
heapConglom - Conglomerate # for the heap
heapSCOCI - The SCOCI for the heap.
heapDCOCI - The DCOCI for the heap.
irgs - the IndexRowGenerators for the table's indexes. We use positions in this array as local id's for indexes. To support updates, only indexes that change need be included.
indexCIDS - the conglomerateids for the table's idexes. indexCIDS[ix] corresponds to the same index as irgs[ix].
indexSCOCIs - the SCOCIs for the table's idexes. indexSCOCIs[ix] corresponds to the same index as irgs[ix].
indexDCOCIs - the DCOCIs for the table's idexes. indexDCOCIs[ix] corresponds to the same index as irgs[ix].
numberOfColumns - Number of columns in a full row.
tc - the transaction controller
streamStorableHeapColIds - Column ids of stream storable columns. (0 based, Only needed for sync. null if none or not needed).
activation - The Activation.
Throws:
StandardException - Thrown on error

getRowChanger

RowChanger getRowChanger(long heapConglom,
                         StaticCompiledOpenConglomInfo heapSCOCI,
                         DynamicCompiledOpenConglomInfo heapDCOCI,
                         IndexRowGenerator[] irgs,
                         long[] indexCIDS,
                         StaticCompiledOpenConglomInfo[] indexSCOCIs,
                         DynamicCompiledOpenConglomInfo[] indexDCOCIs,
                         int numberOfColumns,
                         TransactionController tc,
                         int[] changedColumnIds,
                         FormatableBitSet baseRowReadList,
                         int[] baseRowReadMap,
                         int[] streamStorableColIds,
                         Activation activation)
                         throws StandardException
Create a new RowChanger for doing insert update and delete operations based on partial before and after.

Parameters:
heapConglom - Conglomerate # for the heap
heapSCOCI - The SCOCI for the heap.
heapDCOCI - The DCOCI for the heap.
irgs - the IndexRowGenerators for the table's indexes. We use positions in this array as local id's for indexes. To support updates, only indexes that change need be included.
indexCIDS - the conglomerateids for the table's idexes. indexCIDS[ix] corresponds to the same index as irgs[ix].
indexSCOCIs - the SCOCIs for the table's idexes. indexSCOCIs[ix] corresponds to the same index as irgs[ix].
indexDCOCIs - the DCOCIs for the table's idexes. indexDCOCIs[ix] corresponds to the same index as irgs[ix].
numberOfColumns - Number of columns in partial row.
tc - the transaction controller
changedColumnIds - array of 1 based ints of columns to be updated. Used by update only.
baseRowReadList - the columns in the base row that were read (1 based)
baseRowReadMap - baseRowReadMap[heapColId]->readRowColId (0 based)
streamStorableColIds - Column ids of stream storable columns. (0 based, Only needed for sync. null if none or not needed).
activation - The Activation.
Throws:
StandardException - Thrown on error

getValueRow

ExecRow getValueRow(int numColumns)
This returns a new row that is storable but not indexable


getIndexableRow

ExecIndexRow getIndexableRow(int numColumns)
This returns an indexable row


getIndexableRow

ExecIndexRow getIndexableRow(ExecRow valueRow)
This returns the value row as an indexable row


Built on Thu 2011-03-10 11:54:14+0000, from revision ???

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