class RowChangerImpl extends java.lang.Object implements RowChanger
Constructor and Description |
---|
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.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Close this RowChanger.
|
void |
deleteRow(ExecRow baseRow,
RowLocation baseRowLocation)
Delete a row from the table and perform associated index maintenance.
|
int |
findSelectedCol(int selectedCol)
Return what column no in the input ExecRow (cf nextBaseRow argument to
#updateRow) would correspond to selected column, if any.
|
void |
finish()
Finish processing the changes.
|
ConglomerateController |
getHeapConglomerateController()
Return the ConglomerateController from this RowChanger.
|
RowLocation |
insertRow(ExecRow baseRow,
boolean getRL)
Insert a row into the table and perform associated index maintenance.
|
void |
open(int lockMode)
Open this RowChanger.
|
void |
open(int lockMode,
boolean wait)
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) |
java.lang.String |
toString() |
void |
updateRow(ExecRow oldBaseRow,
ExecRow newBaseRow,
RowLocation baseRowLocation)
Update a row in the table and perform associated index maintenance.
|
boolean isOpen
boolean[] fixOnUpdate
long heapConglom
DynamicCompiledOpenConglomInfo heapDCOCI
StaticCompiledOpenConglomInfo heapSCOCI
long[] indexCIDS
DynamicCompiledOpenConglomInfo[] indexDCOCIs
StaticCompiledOpenConglomInfo[] indexSCOCIs
IndexRowGenerator[] irgs
private final Activation activation
TransactionController tc
FormatableBitSet changedColumnBitSet
FormatableBitSet baseRowReadList
private int[] baseRowReadMap
int[] changedColumnIds
TemporaryRowHolderImpl rowHolder
java.lang.String[] indexNames
private ConglomerateController baseCC
private RowLocation baseRowLocation
private IndexSetChanger isc
private DataValueDescriptor[] sparseRowArray
private int[] partialChangedColumnIds
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 errorpublic 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 open(int lockMode, boolean wait) throws StandardException
RowChanger
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)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.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 RowLocation insertRow(ExecRow baseRow, boolean getRL) throws StandardException
insertRow
in interface RowChanger
baseRow
- the row.getRL
- return a row location of the inserted rownull
.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
locationStandardException
- 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
locationStandardException
- 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)
public int findSelectedCol(int selectedCol)
RowChanger
findSelectedCol
in interface RowChanger
selectedCol
- the column number in the base table of a selected
column or -1 (if selected column is not a base table
column, e.g. i+4).public java.lang.String toString()
toString
in class java.lang.Object
Apache Derby V10.13 Internals - Copyright © 2004,2016 The Apache Software Foundation. All Rights Reserved.