|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.derby.impl.sql.execute.RowChangerImpl
Perform row at a time DML operations of tables and maintain indexes.
Constructor Summary | |
RowChangerImpl(long heapConglom,
StaticCompiledOpenConglomInfo heapSCOCI,
DynamicCompiledOpenConglomInfo heapDCOCI,
IndexRowGenerator[] irgs,
long[] indexCIDS,
StaticCompiledOpenConglomInfo[] indexSCOCIs,
DynamicCompiledOpenConglomInfo[] indexDCOCIs,
int numberOfColumns,
int[] changedColumnIdsInput,
TransactionController tc,
FormatableBitSet baseRowReadList,
int[] baseRowReadMap,
Activation activation)
Create a new RowChanger for performing update and delete operations based on partial before and after rows. |
Method Summary | |
void |
close()
Close this RowChanger. |
void |
deleteRow(ExecRow baseRow,
RowLocation baseRowLocation)
Delete a row from the table and perform associated index maintenance. |
void |
finish()
Finish processing the changes. |
ConglomerateController |
getHeapConglomerateController()
Return the ConglomerateController from this RowChanger. |
void |
insertRow(ExecRow baseRow)
Insert a row into the table and perform associated index maintenance. |
void |
open(int lockMode)
Open this RowChanger. |
void |
openForUpdate(boolean[] fixOnUpdate,
int lockMode,
boolean wait)
Open this RowChanger to avoid fixing indexes that do not change during update operations. |
void |
setIndexNames(java.lang.String[] indexNames)
Sets the index names of the tables indices. |
void |
setRowHolder(TemporaryRowHolder rowHolder)
Set the row holder for this changer to use. |
private int[] |
sortArray(int[] input)
|
void |
updateRow(ExecRow oldBaseRow,
ExecRow newBaseRow,
RowLocation baseRowLocation)
Update a row in the table and perform associated index maintenance. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
boolean isOpen
boolean[] fixOnUpdate
long heapConglom
DynamicCompiledOpenConglomInfo heapDCOCI
StaticCompiledOpenConglomInfo heapSCOCI
long[] indexCIDS
DynamicCompiledOpenConglomInfo[] indexDCOCIs
StaticCompiledOpenConglomInfo[] indexSCOCIs
IndexRowGenerator[] irgs
Activation activation
TransactionController tc
FormatableBitSet changedColumnBitSet
FormatableBitSet baseRowReadList
protected int[] baseRowReadMap
int[] changedColumnIds
TemporaryRowHolderImpl rowHolder
java.lang.String[] indexNames
protected ConglomerateController baseCC
protected RowLocation baseRowLocation
IndexSetChanger isc
private DataValueDescriptor[] sparseRowArray
private int[] partialChangedColumnIds
Constructor Detail |
public RowChangerImpl(long heapConglom, StaticCompiledOpenConglomInfo heapSCOCI, DynamicCompiledOpenConglomInfo heapDCOCI, IndexRowGenerator[] irgs, long[] indexCIDS, StaticCompiledOpenConglomInfo[] indexSCOCIs, DynamicCompiledOpenConglomInfo[] indexDCOCIs, int numberOfColumns, int[] changedColumnIdsInput, TransactionController tc, FormatableBitSet baseRowReadList, int[] baseRowReadMap, Activation activation) throws StandardException
heapConglom
- Conglomerate # for the heapheapSCOCI
- SCOCI for heap.heapDCOCI
- DCOCI for heapirgs
- 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
- the conglomerateids for the table's idexes.
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].numberOfColumns
- Number of columns in partial write row.changedColumnIdsInput
- array of 1 based ints indicating the columns
to be updated. Only used for updatestc
- the transaction controllerbaseRowReadList
- bit set of columns read from base row. 1 based.baseRowReadMap
- BaseRowReadMap[heapColId]->ReadRowColumnId. (0 based)
StandardException
- Thrown on errorMethod Detail |
public void setRowHolder(TemporaryRowHolder rowHolder)
setRowHolder
in interface RowChanger
rowHolder
- the TemporaryRowHolderpublic void setIndexNames(java.lang.String[] indexNames)
RowChanger
setIndexNames
in interface RowChanger
indexNames
- Names of all the indices on this table.RowChanger.setIndexNames(java.lang.String[])
public void open(int lockMode) throws StandardException
Note to avoid the cost of fixing indexes that do not change during update operations use openForUpdate().
open
in interface RowChanger
lockMode
- The lock mode to use
(row or table, see TransactionController)
StandardException
- thrown on failure to convertpublic void openForUpdate(boolean[] fixOnUpdate, int lockMode, boolean wait) throws StandardException
openForUpdate
in interface RowChanger
fixOnUpdate
- fixOnUpdat[ix] == true ==> fix index 'ix' on
an update operation.lockMode
- The lock mode to use
(row or table, see TransactionController)wait
- If true, then the caller wants to wait for locks. False will be
when we using a nested user xaction - we want to timeout right away
if the parent holds the lock. (bug 4821)
StandardException
- thrown on failure to convertpublic void insertRow(ExecRow baseRow) throws StandardException
insertRow
in interface RowChanger
baseRow
- the row.
StandardException
- Thrown on errorpublic void deleteRow(ExecRow baseRow, RowLocation baseRowLocation) throws StandardException
deleteRow
in interface RowChanger
baseRow
- the row.baseRowLocation
- the row's base conglomerate
location
StandardException
- Thrown on errorpublic void updateRow(ExecRow oldBaseRow, ExecRow newBaseRow, RowLocation baseRowLocation) throws StandardException
updateRow
in interface RowChanger
oldBaseRow
- the old image of the row.newBaseRow
- the new image of the row.baseRowLocation
- the row's base conglomerate
location
StandardException
- Thrown on errorpublic void finish() throws StandardException
finish
in interface RowChanger
StandardException
- Thrown on errorpublic void close() throws StandardException
close
in interface RowChanger
StandardException
- Thrown on errorpublic ConglomerateController getHeapConglomerateController()
RowChanger
getHeapConglomerateController
in interface RowChanger
RowChanger.getHeapConglomerateController()
private int[] sortArray(int[] input)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |