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

public Interface ExecutionFactory

Known Direct Implementers
org.apache.derby.impl.sql.execute.GenericExecutionFactory
Imports
org.apache.derby.iapi.sql.Activation, .Activation, .ResultColumnDescriptor, .ResultDescription, org.apache.derby.shared.common.error.StandardException, org.apache.derby.iapi.sql.conn.LanguageConnectionContext, org.apache.derby.iapi.store.access.DynamicCompiledOpenConglomInfo, .Qualifier, .StaticCompiledOpenConglomInfo, .TransactionController, org.apache.derby.iapi.sql.dictionary.IndexRowGenerator, org.apache.derby.iapi.sql.execute.xplain.XPLAINFactoryIF, java.util.Properties, org.apache.derby.iapi.services.io.FormatableBitSet, org.apache.derby.iapi.services.loader.GeneratedMethod, org.apache.derby.iapi.services.context.ContextManager, org.apache.derby.catalog.TypeDescriptor, .UUID

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
org.apache.derby.iapi.sql.conn.LanguageConnectionContext

Field Summary

Modifier and TypeField and Description
public static final String
MODULE

Module name for the monitor's module locating system.

Method Summary

Modifier and TypeMethod and Description
public ExecIndexRow
getIndexableRow(int numColumns)

This returns an indexable row

public ExecIndexRow
getIndexableRow(ExecRow valueRow)

This returns the value row as an indexable row

public Qualifier

Returns:

A new Qualifier
getQualifier
(int
The store id of the column to qualify
columnId
,
int
One of Orderable.ORDER_OP_EQUALS, Orderable.ORDER_OP_LESSTHAN, or Orderable.ORDER_OP_LESSOREQUALS
operator
,
GeneratedMethod
A generated method that returns the Orderable to be compared with the column
orderableGetter
,
Activation
The Activation that acts as the receiver for the generated method
activation
,
boolean
True means that null == null for the sake of this Qualifier
orderedNulls
,
boolean
The value to return if the comparison between the column and the Orderable value returns the unknown truth value
unknownRV
,
boolean
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.
negateCompareResult
,
int
The variantType for the qualifier's orderable. (Determines whether or not to cache the value.)
variantType
)

Get a Qualifier to use with a scan of a conglomerate.

public ResultColumnDescriptor

Returns:

The execution time ResultColumnDescriptor
getResultColumnDescriptor
(ResultColumnDescriptor
The compile time RCD.
compileRCD
)

Create an execution time ResultColumnDescriptor from a compile time RCD.

public ResultDescription
getResultDescription(ResultColumnDescriptor[] columns, String statementType)

Create a result description given parameters for it.

public ResultSetFactory

Returns:

the result set factory for this database.
getResultSetFactory
()

Only one result set factory is needed for a database in the system.

public ResultSetStatisticsFactory

Returns:

The result set statistics factory associated with this ExecutionFactory
getResultSetStatisticsFactory
()

Get the ResultSetStatisticsFactory from this ExecutionFactory.

public RowChanger
getRowChanger(long
Conglomerate # for the heap
heapConglom
,
StaticCompiledOpenConglomInfo
The SCOCI for the heap.
heapSCOCI
,
DynamicCompiledOpenConglomInfo
The DCOCI for the heap.
heapDCOCI
,
IndexRowGenerator[]
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.
irgs
,
long[]
the conglomerateids for the table's idexes. indexCIDS[ix] corresponds to the same index as irgs[ix].
indexCIDS
,
StaticCompiledOpenConglomInfo[]
the SCOCIs for the table's idexes. indexSCOCIs[ix] corresponds to the same index as irgs[ix].
indexSCOCIs
,
DynamicCompiledOpenConglomInfo[]
the DCOCIs for the table's idexes. indexDCOCIs[ix] corresponds to the same index as irgs[ix].
indexDCOCIs
,
int
Number of columns in a full row.
numberOfColumns
,
TransactionController
the transaction controller
tc
,
int[] changedColumnIds, int[]
Column ids of stream storable columns. (0 based, Only needed for sync. null if none or not needed).
streamStorableHeapColIds
,
Activation
The Activation.
activation
)

Create a new RowChanger for performing update and delete operations based on full before and after rows.

public RowChanger
getRowChanger(long
Conglomerate # for the heap
heapConglom
,
StaticCompiledOpenConglomInfo
The SCOCI for the heap.
heapSCOCI
,
DynamicCompiledOpenConglomInfo
The DCOCI for the heap.
heapDCOCI
,
IndexRowGenerator[]
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.
irgs
,
long[]
the conglomerateids for the table's idexes. indexCIDS[ix] corresponds to the same index as irgs[ix].
indexCIDS
,
StaticCompiledOpenConglomInfo[]
the SCOCIs for the table's idexes. indexSCOCIs[ix] corresponds to the same index as irgs[ix].
indexSCOCIs
,
DynamicCompiledOpenConglomInfo[]
the DCOCIs for the table's idexes. indexDCOCIs[ix] corresponds to the same index as irgs[ix].
indexDCOCIs
,
int
Number of columns in partial row.
numberOfColumns
,
TransactionController
the transaction controller
tc
,
int[]
array of 1 based ints of columns to be updated. Used by update only.
changedColumnIds
,
FormatableBitSet
the columns in the base row that were read (1 based)
baseRowReadList
,
int[]
baseRowReadMap[heapColId]->readRowColId (0 based)
baseRowReadMap
,
int[]
Column ids of stream storable columns. (0 based, Only needed for sync. null if none or not needed).
streamStorableColIds
,
Activation
The Activation.
activation
)

Create a new RowChanger for doing insert update and delete operations based on partial before and after.

public ScanQualifier[][]
getScanQualifier(int
The number of ScanQualifiers to get.
numQualifiers
)

Get an array of ScanQualifiers for a scan.

public ExecRow
getValueRow(int numColumns)

This returns a new row that is storable but not indexable

public XPLAINFactoryIF

Returns:

The xplain factory associated with this ExecutionContext
getXPLAINFactory
()

Get the XPLAINFactory from this ExecutionFactory.

public ExecutionContext
newExecutionContext(ContextManager
the context manager
cm
)

Get the ExecutionFactory from this ExecutionContext.

public void
releaseScanQualifier(ScanQualifier[][] scanQualifiers)

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

Field Detail

MODULEback to summary
public static final String MODULE

Module name for the monitor's module locating system.

Method Detail

getIndexableRowback to summary
public ExecIndexRow getIndexableRow(int numColumns)

This returns an indexable row

getIndexableRowback to summary
public ExecIndexRow getIndexableRow(ExecRow valueRow)

This returns the value row as an indexable row

getQualifierback to summary
public 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:int

The store id of the column to qualify

operator:int

One of Orderable.ORDER_OP_EQUALS, Orderable.ORDER_OP_LESSTHAN, or Orderable.ORDER_OP_LESSOREQUALS

orderableGetter:GeneratedMethod

A generated method that returns the Orderable to be compared with the column

activation:Activation

The Activation that acts as the receiver for the generated method

orderedNulls:boolean

True means that null == null for the sake of this Qualifier

unknownRV:boolean

The value to return if the comparison between the column and the Orderable value returns the unknown truth value

negateCompareResult:boolean

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:int

The variantType for the qualifier's orderable. (Determines whether or not to cache the value.)

Returns:Qualifier

A new Qualifier

getResultColumnDescriptorback to summary
public ResultColumnDescriptor getResultColumnDescriptor(ResultColumnDescriptor compileRCD)

Create an execution time ResultColumnDescriptor from a compile time RCD.

Parameters
compileRCD:ResultColumnDescriptor

The compile time RCD.

Returns:ResultColumnDescriptor

The execution time ResultColumnDescriptor

getResultDescriptionback to summary
public ResultDescription getResultDescription(ResultColumnDescriptor[] columns, String statementType)

Create a result description given parameters for it.

getResultSetFactoryback to summary
public 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:ResultSetFactory

the result set factory for this database.

getResultSetStatisticsFactoryback to summary
public ResultSetStatisticsFactory getResultSetStatisticsFactory() throws StandardException

Get the ResultSetStatisticsFactory from this ExecutionFactory.

Returns:ResultSetStatisticsFactory

The result set statistics factory associated with this ExecutionFactory

Exceptions
StandardException:
Thrown on error
getRowChangerback to summary
public 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:long

Conglomerate # for the heap

heapSCOCI:StaticCompiledOpenConglomInfo

The SCOCI for the heap.

heapDCOCI:DynamicCompiledOpenConglomInfo

The DCOCI for the heap.

irgs:IndexRowGenerator[]

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:long[]

the conglomerateids for the table's idexes. indexCIDS[ix] corresponds to the same index as irgs[ix].

indexSCOCIs:StaticCompiledOpenConglomInfo[]

the SCOCIs for the table's idexes. indexSCOCIs[ix] corresponds to the same index as irgs[ix].

indexDCOCIs:DynamicCompiledOpenConglomInfo[]

the DCOCIs for the table's idexes. indexDCOCIs[ix] corresponds to the same index as irgs[ix].

numberOfColumns:int

Number of columns in a full row.

tc:TransactionController

the transaction controller

streamStorableHeapColIds:int[]

Column ids of stream storable columns. (0 based, Only needed for sync. null if none or not needed).

activation:Activation

The Activation.

Exceptions
StandardException:
Thrown on error
getRowChangerback to summary
public 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:long

Conglomerate # for the heap

heapSCOCI:StaticCompiledOpenConglomInfo

The SCOCI for the heap.

heapDCOCI:DynamicCompiledOpenConglomInfo

The DCOCI for the heap.

irgs:IndexRowGenerator[]

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:long[]

the conglomerateids for the table's idexes. indexCIDS[ix] corresponds to the same index as irgs[ix].

indexSCOCIs:StaticCompiledOpenConglomInfo[]

the SCOCIs for the table's idexes. indexSCOCIs[ix] corresponds to the same index as irgs[ix].

indexDCOCIs:DynamicCompiledOpenConglomInfo[]

the DCOCIs for the table's idexes. indexDCOCIs[ix] corresponds to the same index as irgs[ix].

numberOfColumns:int

Number of columns in partial row.

tc:TransactionController

the transaction controller

changedColumnIds:int[]

array of 1 based ints of columns to be updated. Used by update only.

baseRowReadList:FormatableBitSet

the columns in the base row that were read (1 based)

baseRowReadMap:int[]

baseRowReadMap[heapColId]->readRowColId (0 based)

streamStorableColIds:int[]

Column ids of stream storable columns. (0 based, Only needed for sync. null if none or not needed).

activation:Activation

The Activation.

Exceptions
StandardException:
Thrown on error
getScanQualifierback to summary
public ScanQualifier[][] getScanQualifier(int numQualifiers)

Get an array of ScanQualifiers for a scan. ScanQualifiers are used with the DataDictionary.

Parameters
numQualifiers:int

The number of ScanQualifiers to get.

getValueRowback to summary
public ExecRow getValueRow(int numColumns)

This returns a new row that is storable but not indexable

getXPLAINFactoryback to summary
public XPLAINFactoryIF getXPLAINFactory() throws StandardException

Get the XPLAINFactory from this ExecutionFactory.

Returns:XPLAINFactoryIF

The xplain factory associated with this ExecutionContext

Exceptions
StandardException:
Thrown on error
newExecutionContextback to summary
public 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:ContextManager

the context manager

releaseScanQualifierback to summary
public void releaseScanQualifier(ScanQualifier[][] scanQualifiers)

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