Class IndexSetChanger
- java.lang.Object
-
- org.apache.derby.impl.sql.execute.IndexSetChanger
-
class IndexSetChanger extends java.lang.ObjectPerform Index maintenace associated with DML operations for a table's indexes.
-
-
Field Summary
Fields Modifier and Type Field Description private Activationactivationprivate static intALL_INDEXES(package private) ConglomerateControllerbaseCC(package private) FormatableBitSetbaseRowReadMap(package private) boolean[]fixOnUpdate(package private) IndexChanger[]indexChangers(package private) long[]indexCIDSprivate DynamicCompiledOpenConglomInfo[]indexDCOCIs(package private) java.lang.String[]indexNamesprivate StaticCompiledOpenConglomInfo[]indexSCOCIs(package private) IndexRowGenerator[]irgsprivate intisolationLevel(package private) booleanisOpenprivate intlockModeprivate static intNO_INDEXES(package private) TemporaryRowHolderImplrowHolder(package private) TransactionControllertcprivate static intUPDATE_INDEXESprivate intwhatIsOpen
-
Constructor Summary
Constructors Constructor Description IndexSetChanger(IndexRowGenerator[] irgs, long[] indexCIDS, StaticCompiledOpenConglomInfo[] indexSCOCIs, DynamicCompiledOpenConglomInfo[] indexDCOCIs, java.lang.String[] indexNames, ConglomerateController baseCC, TransactionController tc, int lockMode, FormatableBitSet baseRowReadMap, int isolationLevel, Activation activation)Create a new IndexSetChanger
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Close this IndexSetChanger.voiddelete(ExecRow baseRow, RowLocation baseRowLocation)Perform index maintenance associated with deleting a row from a table.voidfinish()Finish processing the changes for this IndexSetChanger.voidinsert(ExecRow baseRow, RowLocation baseRowLocation)Perform index maintenance associated with insering a row into a table.voidopen(boolean[] fixOnUpdate)Open this IndexSetchanger.private voidopenIndexes(int whatToOpen)Open the indexes that must be fixed if they are not already open.voidsetBaseCC(ConglomerateController baseCC)Propagate the heap's ConglomerateController to all of the underlying index changers.voidsetRowHolder(TemporaryRowHolderImpl rowHolder)Set the row holder for all underlying changers to use.java.lang.StringtoString()Create a string describing the state of this IndexSetChangervoidupdate(ExecRow oldBaseRow, ExecRow newBaseRow, RowLocation baseRowLocation)Perform index maintenance associated with updating a row in a table.
-
-
-
Field Detail
-
irgs
IndexRowGenerator[] irgs
-
indexCIDS
long[] indexCIDS
-
indexDCOCIs
private DynamicCompiledOpenConglomInfo[] indexDCOCIs
-
indexSCOCIs
private StaticCompiledOpenConglomInfo[] indexSCOCIs
-
indexNames
java.lang.String[] indexNames
-
baseCC
ConglomerateController baseCC
-
baseRowReadMap
FormatableBitSet baseRowReadMap
-
tc
TransactionController tc
-
rowHolder
TemporaryRowHolderImpl rowHolder
-
indexChangers
IndexChanger[] indexChangers
-
lockMode
private int lockMode
-
fixOnUpdate
boolean[] fixOnUpdate
-
isOpen
boolean isOpen
-
NO_INDEXES
private static final int NO_INDEXES
- See Also:
- Constant Field Values
-
UPDATE_INDEXES
private static final int UPDATE_INDEXES
- See Also:
- Constant Field Values
-
ALL_INDEXES
private static final int ALL_INDEXES
- See Also:
- Constant Field Values
-
whatIsOpen
private int whatIsOpen
-
isolationLevel
private int isolationLevel
-
activation
private final Activation activation
-
-
Constructor Detail
-
IndexSetChanger
public IndexSetChanger(IndexRowGenerator[] irgs, long[] indexCIDS, StaticCompiledOpenConglomInfo[] indexSCOCIs, DynamicCompiledOpenConglomInfo[] indexDCOCIs, java.lang.String[] indexNames, ConglomerateController baseCC, TransactionController tc, int lockMode, FormatableBitSet baseRowReadMap, int isolationLevel, Activation activation) throws StandardException
Create a new IndexSetChanger- Parameters:
irgs- the IndexRowGenerators for the table's indexes. We use positions in this array as local id's for indexes.indexCIDS- the conglomerate ids for the table's indexes. 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].baseCC- a ConglomerateController for the base table.tc- a TransactionController for managing temporary conglomerateslockMode- The lock mode (granularity) for the indexes.baseRowReadMap- Map of columns read in. 1 based.isolationLevel- Isolation level to useactivation- Current activation- Throws:
StandardException- Thrown on error
-
-
Method Detail
-
open
public void open(boolean[] fixOnUpdate) throws StandardExceptionOpen this IndexSetchanger.- Parameters:
fixOnUpdate- indicates which indexes to correct due to an update. The entries in this array must be in the same order as the entries in the irgs array that was passed to the constructor.- Throws:
StandardException- Thrown on error
-
setRowHolder
public void setRowHolder(TemporaryRowHolderImpl rowHolder)
Set the row holder for all underlying changers to use. If the row holder is set, underlying changers wont bother saving copies of rows needed for deferred processing. Also, it will never close the passed in rowHolder.- Parameters:
rowHolder- the row holder
-
openIndexes
private void openIndexes(int whatToOpen) throws StandardExceptionOpen the indexes that must be fixed if they are not already open.- Parameters:
whatToOpen- must be one of ALL_INDEXES or UPDATE_INDEXES.- Throws:
StandardException- Thrown on error
-
delete
public void delete(ExecRow baseRow, RowLocation baseRowLocation) throws StandardException
Perform index maintenance associated with deleting a row from a table.- Parameters:
baseRow- the deleted row.baseRowLocation- the deleted row's base conglomerate location- Throws:
StandardException- Thrown on error
-
insert
public void insert(ExecRow baseRow, RowLocation baseRowLocation) throws StandardException
Perform index maintenance associated with insering a row into a table.- Parameters:
baseRow- the row.baseRowLocation- the row's base conglomerate location- Throws:
StandardException- Thrown on error
-
update
public void update(ExecRow oldBaseRow, ExecRow newBaseRow, RowLocation baseRowLocation) throws StandardException
Perform index maintenance associated with updating a row in a table.- Parameters:
oldBaseRow- the old image of the row.newBaseRow- the new image of the row.baseRowLocation- the row's base conglomerate location- Throws:
StandardException- Thrown on error
-
setBaseCC
public void setBaseCC(ConglomerateController baseCC)
Propagate the heap's ConglomerateController to all of the underlying index changers.- Parameters:
baseCC- The heap's ConglomerateController.
-
finish
public void finish() throws StandardExceptionFinish processing the changes for this IndexSetChanger. This means doing the deferred inserts for updates of unique indexes.- Throws:
StandardException- Thrown on error
-
close
public void close() throws StandardExceptionClose this IndexSetChanger.- Throws:
StandardException- Thrown on error
-
toString
public java.lang.String toString()
Create a string describing the state of this IndexSetChanger- Overrides:
toStringin classjava.lang.Object
-
-