org.apache.derby.impl.sql.execute
Class CreateIndexConstantAction

java.lang.Object
  extended byorg.apache.derby.impl.sql.execute.GenericConstantAction
      extended byorg.apache.derby.impl.sql.execute.DDLConstantAction
          extended byorg.apache.derby.impl.sql.execute.DDLSingleTableConstantAction
              extended byorg.apache.derby.impl.sql.execute.IndexConstantAction
                  extended byorg.apache.derby.impl.sql.execute.CreateIndexConstantAction
All Implemented Interfaces:
ConstantAction

class CreateIndexConstantAction
extends IndexConstantAction

This class describes actions that are ALWAYS performed for a CREATE TABLE Statement at Execution time.

Author:
Jeff Lichtman Cribbed from from CreateTableConstantAction

Field Summary
private  java.lang.String[] columnNames
           
private  UUID conglomerateUUID
           
private  long conglomId
           
private  ExecRow indexTemplateRow
           
private  java.lang.String indexType
           
private  boolean[] isAscending
           
private  boolean isConstraint
           
private  java.util.Properties properties
           
private  boolean unique
           
 
Fields inherited from class org.apache.derby.impl.sql.execute.IndexConstantAction
indexName, schemaName, tableId, tableName
 
Fields inherited from interface org.apache.derby.iapi.sql.execute.ConstantAction
RUNTIMESTATISTICS, STATISTICSTIMING
 
Constructor Summary
(package private) CreateIndexConstantAction(boolean unique, java.lang.String indexType, java.lang.String schemaName, java.lang.String indexName, java.lang.String tableName, UUID tableId, long conglomId, java.lang.String[] columnNames, boolean[] isAscending, boolean isConstraint, UUID conglomerateUUID, java.util.Properties properties)
          Make the ConstantAction for a CREATE INDEX statement.
 
Method Summary
 void executeConstantAction(Activation activation)
          This is the guts of the Execution-time logic for CREATE INDEX.
(package private)  ExecRow getIndexTemplateRow()
           
private  RowLocationRetRowSource loadSorter(ExecRow[] baseRows, ExecIndexRow[] indexRows, TransactionController tc, GroupFetchScanController scan, long sortId, RowLocation[] rl)
          Scan the base conglomerate and insert the keys into a sorter, returning a rowSource on the sorter.
private  void statementExceptionCleanup(ScanController scan, ConglomerateController indexController)
          Do necessary clean up (close down controllers, etc.) before throwing a statement exception.
 java.lang.String toString()
           
 
Methods inherited from class org.apache.derby.impl.sql.execute.IndexConstantAction
getIndexName, modifiesTableId, setIndexName
 
Methods inherited from class org.apache.derby.impl.sql.execute.DDLConstantAction
constructToString, getAndCheckSchemaDescriptor, getSchemaDescriptorForCreate, lockTableForDDL, readExternal, upToDate, writeExternal
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

unique

private boolean unique

indexType

private java.lang.String indexType

conglomId

private long conglomId

columnNames

private java.lang.String[] columnNames

isAscending

private boolean[] isAscending

isConstraint

private boolean isConstraint

conglomerateUUID

private UUID conglomerateUUID

properties

private java.util.Properties properties

indexTemplateRow

private ExecRow indexTemplateRow
Constructor Detail

CreateIndexConstantAction

CreateIndexConstantAction(boolean unique,
                          java.lang.String indexType,
                          java.lang.String schemaName,
                          java.lang.String indexName,
                          java.lang.String tableName,
                          UUID tableId,
                          long conglomId,
                          java.lang.String[] columnNames,
                          boolean[] isAscending,
                          boolean isConstraint,
                          UUID conglomerateUUID,
                          java.util.Properties properties)
Make the ConstantAction for a CREATE INDEX statement.

Parameters:
unique - True means it will be a unique index
indexType - The type of index (BTREE, for example)
indexName - Name of the index
tableName - Name of table the index will be on
tableId - UUID of table
conglomId - Conglomerate ID of the index, if known in advance
columnNames - Names of the columns in the index, in order
isAscending - Array of booleans telling asc/desc on each column
isConstraint - TRUE if index is backing up a constraint, else FALSE
conglomerateUUID - ID of conglomerate
properties - The optional properties list associated with the index.
Method Detail

toString

public java.lang.String toString()

executeConstantAction

public void executeConstantAction(Activation activation)
                           throws StandardException
This is the guts of the Execution-time logic for CREATE INDEX.

Parameters:
activation - The execution environment for this constant action.
Throws:
StandardException - Thrown on failure
See Also:
ConstantAction.executeConstantAction(org.apache.derby.iapi.sql.Activation)

getIndexTemplateRow

ExecRow getIndexTemplateRow()

statementExceptionCleanup

private void statementExceptionCleanup(ScanController scan,
                                       ConglomerateController indexController)
                                throws StandardException
Do necessary clean up (close down controllers, etc.) before throwing a statement exception.

Parameters:
scan - ScanController for the heap
indexController - ConglomerateController for the index
Returns:
Nothing.
Throws:
StandardException

loadSorter

private RowLocationRetRowSource loadSorter(ExecRow[] baseRows,
                                           ExecIndexRow[] indexRows,
                                           TransactionController tc,
                                           GroupFetchScanController scan,
                                           long sortId,
                                           RowLocation[] rl)
                                    throws StandardException
Scan the base conglomerate and insert the keys into a sorter, returning a rowSource on the sorter.

Returns:
RowSource on the sorted index keys.
Throws:
StandardException - thrown on error

Built on Mon 2007-06-04 09:58:47+0400, from revision ???

Apache Derby V10.1 Engine Documentation - Copyright © 1997,2005 The Apache Software Foundation or its licensors, as applicable.