Top Description Fields Constructors Methods
org.apache.derby.impl.sql.execute

public Class GenericExecutionFactory

extends Object
implements ModuleControl, ModuleSupportable, ExecutionFactory
Class Inheritance
All Implemented Interfaces
org.apache.derby.iapi.sql.execute.ExecutionFactory, org.apache.derby.iapi.services.monitor.ModuleSupportable, org.apache.derby.iapi.services.monitor.ModuleControl
Imports
org.apache.derby.shared.common.reference.EngineType, org.apache.derby.impl.sql.GenericColumnDescriptor, .GenericResultDescription, org.apache.derby.iapi.services.monitor.ModuleControl, .ModuleSupportable, .Monitor, org.apache.derby.shared.common.error.StandardException, org.apache.derby.iapi.sql.conn.LanguageConnectionContext, org.apache.derby.iapi.sql.execute.ExecRow, .ExecIndexRow, .ExecutionContext, .ExecutionFactory, .ResultSetFactory, .ResultSetStatisticsFactory, .ScanQualifier, .RowChanger, org.apache.derby.iapi.sql.execute.xplain.XPLAINFactoryIF, org.apache.derby.iapi.sql.Activation, .ResultColumnDescriptor, .ResultDescription, org.apache.derby.iapi.store.access.DynamicCompiledOpenConglomInfo, .Qualifier, .StaticCompiledOpenConglomInfo, .TransactionController, org.apache.derby.iapi.sql.dictionary.IndexRowGenerator, org.apache.derby.iapi.jdbc.ConnectionContext, org.apache.derby.iapi.services.loader.GeneratedMethod, org.apache.derby.iapi.services.context.ContextManager, org.apache.derby.catalog.UUID, org.apache.derby.iapi.services.io.FormatableBitSet, java.util.Properties, .Vector

This Factory is for creating the execution items needed by a connection for a given database. Once created for the connection, they should be pushed onto the execution context so that they can be found again by subsequent actions during the session.

Field Summary

Modifier and TypeField and Description
private GenericConstantActionFactory
private ResultSetFactory
private ResultSetStatisticsFactory
rssFactory

Statistics factory for this factory.

private XPLAINFactoryIF

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
boot(boolean
True if the database should be created
create
,
Properties
Configuration properties
startParams
)

Implements org.apache.derby.iapi.services.monitor.ModuleControl.boot.

This Factory is expected to be booted relative to a LanguageConnectionFactory.

private static Object
bootServiceModule(final boolean create, final Object serviceModule, final String factoryInterface, final Properties properties)

Must be private so that user code can't call this entry point.

public boolean
canSupport(Properties startParams)

Implements org.apache.derby.iapi.services.monitor.ModuleSupportable.canSupport.

See if this implementation can support any attributes that are listed in properties.

public GenericConstantActionFactory

Returns:

the factory for constant actions.
getConstantActionFactory
()

Get the factory for constant actions.

public ExecIndexRow
getIndexableRow(int numColumns)

Implements org.apache.derby.iapi.sql.execute.ExecutionFactory.getIndexableRow.

This returns an indexable row

public ExecIndexRow
getIndexableRow(ExecRow valueRow)

Implements org.apache.derby.iapi.sql.execute.ExecutionFactory.getIndexableRow.

This returns the value row as an indexable row

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

Implements org.apache.derby.iapi.sql.execute.ExecutionFactory.getQualifier.

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
)

Implements org.apache.derby.iapi.sql.execute.ExecutionFactory.getResultColumnDescriptor.

Create an execution time ResultColumnDescriptor from a compile time RCD.

public ResultDescription
public ResultSetFactory
getResultSetFactory()

Implements org.apache.derby.iapi.sql.execute.ExecutionFactory.getResultSetFactory.

Factories are generic and can be used by all connections.

public ResultSetStatisticsFactory

Returns:

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

Implements org.apache.derby.iapi.sql.execute.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
)

Implements org.apache.derby.iapi.sql.execute.ExecutionFactory.getRowChanger.

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
)

Implements org.apache.derby.iapi.sql.execute.ExecutionFactory.getRowChanger.

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
)

Implements org.apache.derby.iapi.sql.execute.ExecutionFactory.getScanQualifier.

Get an array of ScanQualifiers for a scan.

pack-priv InternalTriggerExecutionContext
getTriggerExecutionContext(LanguageConnectionContext lcc, ConnectionContext cc, String statementText, int dmlType, UUID targetTableId, String targetTableName, Vector<AutoincrementCounter> aiCounters)

Get a trigger execution context

public ExecRow
getValueRow(int numColumns)

Implements org.apache.derby.iapi.sql.execute.ExecutionFactory.getValueRow.

This returns a new row that is storable but not indexable

public XPLAINFactoryIF

Returns:

The XPLAINFactory associated with this ExecutionContext
getXPLAINFactory
()

Implements org.apache.derby.iapi.sql.execute.ExecutionFactory.getXPLAINFactory.

Get the XPLAINFactory from this ExecutionContext.

public ExecutionContext
newExecutionContext(ContextManager
the context manager
cm
)

Implements org.apache.derby.iapi.sql.execute.ExecutionFactory.newExecutionContext.

We want a dependency context so that we can push it onto the stack.

public void
releaseScanQualifier(ScanQualifier[][] qualifiers)

Implements org.apache.derby.iapi.sql.execute.ExecutionFactory.releaseScanQualifier.

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

public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

genericConstantActionFactoryback to summary
private GenericConstantActionFactory genericConstantActionFactory
rsFactoryback to summary
private ResultSetFactory rsFactory
rssFactoryback to summary
private ResultSetStatisticsFactory rssFactory

Statistics factory for this factory.

xplainFactoryback to summary
private XPLAINFactoryIF xplainFactory

Constructor Detail

GenericExecutionFactoryback to summary
public GenericExecutionFactory()

Method Detail

bootback to summary
public void boot(boolean create, Properties startParams) throws StandardException

Implements org.apache.derby.iapi.services.monitor.ModuleControl.boot.

This Factory is expected to be booted relative to a LanguageConnectionFactory.

Parameters
create:boolean

Doc from org.apache.derby.iapi.services.monitor.ModuleControl.boot.

True if the database should be created

startParams:Properties

Doc from org.apache.derby.iapi.services.monitor.ModuleControl.boot.

Configuration properties

Exceptions
StandardException:
Thrown on error
See Also
org.apache.derby.iapi.sql.conn.LanguageConnectionFactory
bootServiceModuleback to summary
private static Object bootServiceModule(final boolean create, final Object serviceModule, final String factoryInterface, final Properties properties) throws StandardException

Must be private so that user code can't call this entry point.

canSupportback to summary
public boolean canSupport(Properties startParams)

Implements org.apache.derby.iapi.services.monitor.ModuleSupportable.canSupport.

Doc from org.apache.derby.iapi.services.monitor.ModuleSupportable.canSupport.

See if this implementation can support any attributes that are listed in properties. This call may be made on a newly created instance before the boot() method has been called, or after the boot method has been called for a running module.

The module can check for attributes in the properties to see if it can fulfill the required behaviour. E.g. the raw store may define an attribute called RawStore.Recoverable. If a temporary raw store is required the property RawStore.recoverable=false would be added to the properties before calling bootServiceModule. If a raw store cannot support this attribute its canSupport method would return null. Also see the Monitor class's prologue to see how the identifier is used in looking up properties.
Actually a better way maybe to have properties of the form RawStore.Attributes.mandatory=recoverable,smallfootprint and RawStore.Attributes.requested=oltp,fast

Returns:boolean

true if this instance can be used, false otherwise.

getConstantActionFactoryback to summary
public GenericConstantActionFactory getConstantActionFactory()

Get the factory for constant actions.

Returns:GenericConstantActionFactory

the factory for constant actions.

getIndexableRowback to summary
public ExecIndexRow getIndexableRow(int numColumns)

Implements org.apache.derby.iapi.sql.execute.ExecutionFactory.getIndexableRow.

Doc from org.apache.derby.iapi.sql.execute.ExecutionFactory.getIndexableRow.

This returns an indexable row

getIndexableRowback to summary
public ExecIndexRow getIndexableRow(ExecRow valueRow)

Implements org.apache.derby.iapi.sql.execute.ExecutionFactory.getIndexableRow.

Doc from org.apache.derby.iapi.sql.execute.ExecutionFactory.getIndexableRow.

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)

Implements org.apache.derby.iapi.sql.execute.ExecutionFactory.getQualifier.

Doc from org.apache.derby.iapi.sql.execute.ExecutionFactory.getQualifier.

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

See Also
ExecutionFactory#getQualifier
getResultColumnDescriptorback to summary
public ResultColumnDescriptor getResultColumnDescriptor(ResultColumnDescriptor compileRCD)

Implements org.apache.derby.iapi.sql.execute.ExecutionFactory.getResultColumnDescriptor.

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)

Implements org.apache.derby.iapi.sql.execute.ExecutionFactory.getResultDescription.

Make a result description

getResultSetFactoryback to summary
public ResultSetFactory getResultSetFactory()

Implements org.apache.derby.iapi.sql.execute.ExecutionFactory.getResultSetFactory.

Factories are generic and can be used by all connections. We defer instantiation until needed to reduce boot time. We may instantiate too many instances in rare multi-user situation, but consistency will be maintained and at some point, usually always, we will have 1 and only 1 instance of each factory because assignment is atomic.

Returns:ResultSetFactory

Doc from org.apache.derby.iapi.sql.execute.ExecutionFactory.getResultSetFactory.

the result set factory for this database.

getResultSetStatisticsFactoryback to summary
public ResultSetStatisticsFactory getResultSetStatisticsFactory() throws StandardException

Implements org.apache.derby.iapi.sql.execute.ExecutionFactory.getResultSetStatisticsFactory.

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

Implements org.apache.derby.iapi.sql.execute.ExecutionFactory.getRowChanger.

Doc from org.apache.derby.iapi.sql.execute.ExecutionFactory.getRowChanger.

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
See Also
ExecutionFactory#getRowChanger
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

Implements org.apache.derby.iapi.sql.execute.ExecutionFactory.getRowChanger.

Doc from org.apache.derby.iapi.sql.execute.ExecutionFactory.getRowChanger.

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
See Also
ExecutionFactory#getRowChanger
getScanQualifierback to summary
public ScanQualifier[][] getScanQualifier(int numQualifiers)

Implements org.apache.derby.iapi.sql.execute.ExecutionFactory.getScanQualifier.

Doc from org.apache.derby.iapi.sql.execute.ExecutionFactory.getScanQualifier.

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

Parameters
numQualifiers:int

The number of ScanQualifiers to get.

getTriggerExecutionContextback to summary
pack-priv InternalTriggerExecutionContext getTriggerExecutionContext(LanguageConnectionContext lcc, ConnectionContext cc, String statementText, int dmlType, UUID targetTableId, String targetTableName, Vector<AutoincrementCounter> aiCounters) throws StandardException

Get a trigger execution context

Exceptions
StandardException:
Thrown on error
getValueRowback to summary
public ExecRow getValueRow(int numColumns)

Implements org.apache.derby.iapi.sql.execute.ExecutionFactory.getValueRow.

Doc from org.apache.derby.iapi.sql.execute.ExecutionFactory.getValueRow.

This returns a new row that is storable but not indexable

getXPLAINFactoryback to summary
public XPLAINFactoryIF getXPLAINFactory() throws StandardException

Implements org.apache.derby.iapi.sql.execute.ExecutionFactory.getXPLAINFactory.

Get the XPLAINFactory from this ExecutionContext.

Returns:XPLAINFactoryIF

The XPLAINFactory associated with this ExecutionContext

Exceptions
StandardException:
Thrown on error
newExecutionContextback to summary
public ExecutionContext newExecutionContext(ContextManager cm)

Implements org.apache.derby.iapi.sql.execute.ExecutionFactory.newExecutionContext.

We want a dependency 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

Doc from org.apache.derby.iapi.sql.execute.ExecutionFactory.newExecutionContext.

the context manager

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

Implements org.apache.derby.iapi.sql.execute.ExecutionFactory.releaseScanQualifier.

Doc from org.apache.derby.iapi.sql.execute.ExecutionFactory.releaseScanQualifier.

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

See Also
ExecutionFactory#releaseScanQualifier
stopback to summary
public void stop()

Implements org.apache.derby.iapi.services.monitor.ModuleControl.stop.

Doc from org.apache.derby.iapi.services.monitor.ModuleControl.stop.

Stop the module. The module may be found via a findModule() method until some time after this method returns. Therefore the factory must be prepared to reject requests to it once it has been stopped. In addition other modules may cache a reference to the module and make requests of it after it has been stopped, these requests should be rejected as well.