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

pack-priv Class IndexSetChanger

extends Object
Class Inheritance
Imports
org.apache.derby.shared.common.sanity.SanityManager, org.apache.derby.shared.common.error.StandardException, org.apache.derby.iapi.sql.conn.LanguageConnectionContext, org.apache.derby.iapi.sql.dictionary.IndexRowGenerator, org.apache.derby.iapi.sql.execute.ExecRow, .ExecutionFactory, org.apache.derby.iapi.sql.Activation, org.apache.derby.iapi.store.access.ConglomerateController, .DynamicCompiledOpenConglomInfo, .StaticCompiledOpenConglomInfo, .TransactionController, org.apache.derby.iapi.types.RowLocation, org.apache.derby.iapi.services.io.FormatableBitSet

Perform Index maintenace associated with DML operations for a table's indexes.

Field Summary

Modifier and TypeField and Description
private final Activation
private static final int
pack-priv ConglomerateController
pack-priv FormatableBitSet
pack-priv boolean[]
pack-priv IndexChanger[]
pack-priv long[]
private DynamicCompiledOpenConglomInfo[]
pack-priv String[]
private StaticCompiledOpenConglomInfo[]
pack-priv IndexRowGenerator[]
private int
pack-priv boolean
private int
private static final int
pack-priv TemporaryRowHolderImpl
pack-priv TransactionController
private static final int
private int

Constructor Summary

AccessConstructor and Description
public
IndexSetChanger(IndexRowGenerator[]
the IndexRowGenerators for the table's indexes. We use positions in this array as local id's for indexes.
irgs
,
long[]
the conglomerate ids for the table's indexes. 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
,
String[] indexNames, ConglomerateController
a ConglomerateController for the base table.
baseCC
,
TransactionController
a TransactionController for managing temporary conglomerates
tc
,
int
The lock mode (granularity) for the indexes.
lockMode
,
FormatableBitSet
Map of columns read in. 1 based.
baseRowReadMap
,
int
Isolation level to use
isolationLevel
,
Activation
Current activation
activation
)

Create a new IndexSetChanger

Method Summary

Modifier and TypeMethod and Description
public void
close()

Close this IndexSetChanger.

public void
delete(ExecRow
the deleted row.
baseRow
,
RowLocation
the deleted row's base conglomerate location
baseRowLocation
)

Perform index maintenance associated with deleting a row from a table.

public void
finish()

Finish processing the changes for this IndexSetChanger.

public void
insert(ExecRow
the row.
baseRow
,
RowLocation
the row's base conglomerate location
baseRowLocation
)

Perform index maintenance associated with insering a row into a table.

public void
open(boolean[]
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.
fixOnUpdate
)

Open this IndexSetchanger.

private void
openIndexes(int
must be one of ALL_INDEXES or UPDATE_INDEXES.
whatToOpen
)

Open the indexes that must be fixed if they are not already open.

public void
setBaseCC(ConglomerateController
The heap's ConglomerateController.
baseCC
)

Propagate the heap's ConglomerateController to all of the underlying index changers.

public void
setRowHolder(TemporaryRowHolderImpl
the row holder
rowHolder
)

Set the row holder for all underlying changers to use.

public String
toString()

Overrides java.lang.Object.toString.

Create a string describing the state of this IndexSetChanger

public void
update(ExecRow
the old image of the row.
oldBaseRow
,
ExecRow
the new image of the row.
newBaseRow
,
RowLocation
the row's base conglomerate location
baseRowLocation
)

Perform index maintenance associated with updating a row in a table.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

activationback to summary
private final Activation activation
ALL_INDEXESback to summary
private static final int ALL_INDEXES
baseCCback to summary
pack-priv ConglomerateController baseCC
baseRowReadMapback to summary
pack-priv FormatableBitSet baseRowReadMap
fixOnUpdateback to summary
pack-priv boolean[] fixOnUpdate
indexChangersback to summary
pack-priv IndexChanger[] indexChangers
indexCIDSback to summary
pack-priv long[] indexCIDS
indexDCOCIsback to summary
private DynamicCompiledOpenConglomInfo[] indexDCOCIs
indexNamesback to summary
pack-priv String[] indexNames
indexSCOCIsback to summary
private StaticCompiledOpenConglomInfo[] indexSCOCIs
irgsback to summary
pack-priv IndexRowGenerator[] irgs
isolationLevelback to summary
private int isolationLevel
isOpenback to summary
pack-priv boolean isOpen
lockModeback to summary
private int lockMode
NO_INDEXESback to summary
private static final int NO_INDEXES
rowHolderback to summary
pack-priv TemporaryRowHolderImpl rowHolder
tcback to summary
pack-priv TransactionController tc
UPDATE_INDEXESback to summary
private static final int UPDATE_INDEXES
whatIsOpenback to summary
private int whatIsOpen

Constructor Detail

IndexSetChangerback to summary
public IndexSetChanger(IndexRowGenerator[] irgs, long[] indexCIDS, StaticCompiledOpenConglomInfo[] indexSCOCIs, DynamicCompiledOpenConglomInfo[] indexDCOCIs, String[] indexNames, ConglomerateController baseCC, TransactionController tc, int lockMode, FormatableBitSet baseRowReadMap, int isolationLevel, Activation activation) throws StandardException

Create a new IndexSetChanger

Parameters
irgs:IndexRowGenerator[]

the IndexRowGenerators for the table's indexes. We use positions in this array as local id's for indexes.

indexCIDS:long[]

the conglomerate ids for the table's indexes. 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].

baseCC:ConglomerateController

a ConglomerateController for the base table.

tc:TransactionController

a TransactionController for managing temporary conglomerates

lockMode:int

The lock mode (granularity) for the indexes.

baseRowReadMap:FormatableBitSet

Map of columns read in. 1 based.

isolationLevel:int

Isolation level to use

activation:Activation

Current activation

Exceptions
StandardException:
Thrown on error

Method Detail

closeback to summary
public void close() throws StandardException

Close this IndexSetChanger.

Exceptions
StandardException:
Thrown on error
deleteback to summary
public void delete(ExecRow baseRow, RowLocation baseRowLocation) throws StandardException

Perform index maintenance associated with deleting a row from a table.

Parameters
baseRow:ExecRow

the deleted row.

baseRowLocation:RowLocation

the deleted row's base conglomerate location

Exceptions
StandardException:
Thrown on error
finishback to summary
public void finish() throws StandardException

Finish processing the changes for this IndexSetChanger. This means doing the deferred inserts for updates of unique indexes.

Exceptions
StandardException:
Thrown on error
insertback to summary
public void insert(ExecRow baseRow, RowLocation baseRowLocation) throws StandardException

Perform index maintenance associated with insering a row into a table.

Parameters
baseRow:ExecRow

the row.

baseRowLocation:RowLocation

the row's base conglomerate location

Exceptions
StandardException:
Thrown on error
openback to summary
public void open(boolean[] fixOnUpdate) throws StandardException

Open this IndexSetchanger.

Parameters
fixOnUpdate:boolean[]

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.

Exceptions
StandardException:
Thrown on error
openIndexesback to summary
private void openIndexes(int whatToOpen) throws StandardException

Open the indexes that must be fixed if they are not already open.

Parameters
whatToOpen:int

must be one of ALL_INDEXES or UPDATE_INDEXES.

Exceptions
StandardException:
Thrown on error
setBaseCCback to summary
public void setBaseCC(ConglomerateController baseCC)

Propagate the heap's ConglomerateController to all of the underlying index changers.

Parameters
baseCC:ConglomerateController

The heap's ConglomerateController.

setRowHolderback to summary
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:TemporaryRowHolderImpl

the row holder

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Create a string describing the state of this IndexSetChanger

Returns:String

Doc from java.lang.Object.toString.

a string representation of the object

updateback to summary
public void update(ExecRow oldBaseRow, ExecRow newBaseRow, RowLocation baseRowLocation) throws StandardException

Perform index maintenance associated with updating a row in a table.

Parameters
oldBaseRow:ExecRow

the old image of the row.

newBaseRow:ExecRow

the new image of the row.

baseRowLocation:RowLocation

the row's base conglomerate location

Exceptions
StandardException:
Thrown on error