Class TabInfoImpl
java.lang.Object
org.apache.derby.impl.sql.catalog.TabInfoImpl
A poor mans structure used in DataDictionaryImpl.java.
Used to save heapId, name pairs for non core tables.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanprivate final CatalogRowFactoryprivate longprivate booleanprivate IndexInfoImpl[]private int(package private) static final intROWNOTDUPLICATE is out of range for a row number.private int[] -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) intdeleteRow(TransactionController tc, ExecIndexRow key, int indexNumber) Given a key row, delete all matching heap rows and their index rows.(package private) intdeleteRow(TransactionController tc, ExecIndexRow key, int indexNumber, boolean wait) (package private) intdeleteRows(TransactionController tc, ExecIndexRow startKey, int startOp, Qualifier[][] qualifier, TupleFilter filter, ExecIndexRow stopKey, int stopOp, int indexNumber) Delete the set of rows defined by a scan on an index from the table.private intdeleteRows(TransactionController tc, ExecIndexRow startKey, int startOp, Qualifier[][] qualifier, TupleFilter filter, ExecIndexRow stopKey, int stopOp, int indexNumber, boolean wait) (package private) intgetBaseColumnPosition(int indexNumber, int colNumber) Get the base column position for a column within a catalog given the (0-based) index number for this catalog and the (0-based) column number for the column within the index.(package private) CatalogRowFactoryGet the CatalogRowFactory for this.(package private) PropertiesGet the Properties associated with creating the heap.(package private) PropertiesgetCreateIndexProperties(int indexNumber) Get the Properties associated with creating the specified index.(package private) longGet the conglomerate for the heap.(package private) intgetIndexColumnCount(int indexNumber) Get the column count for the specified index number.(package private) longgetIndexConglomerate(int indexID) Get the conglomerate for the specified index.(package private) StringgetIndexName(int indexId) Get the index name.private ExecIndexRowgetIndexRowFromHeapRow(IndexRowGenerator irg, RowLocation rl, ExecRow heapRow) Get an index row based on a row from the heap.(package private) IndexRowGeneratorgetIndexRowGenerator(int indexNumber) Get the IndexRowGenerator for the specified index number.(package private) intGet the number of indexes on this catalog.(package private) ExecRowgetRow(TransactionController tc, ExecIndexRow key, int indexNumber) Given a key row, return the first matching heap row.(package private) ExecRowgetRow(TransactionController tc, ConglomerateController heapCC, ExecIndexRow key, int indexNumber) Given a key row, return the first matching heap row.private RowChangergetRowChanger(TransactionController tc, int[] changedCols, ExecRow baseRow) Gets a row changer for this catalog.private ExecRowgetRowInternal(TransactionController tc, ConglomerateController heapCC, ExecIndexRow key, int indexNumber, RowLocation[] rl) (package private) RowLocationgetRowLocation(TransactionController tc, ExecIndexRow key, int indexNumber) Given an index row and index number return the RowLocation in the heap of the first matching row.private int[]getStreamStorableHeapColIds(ExecRow baseRow) (package private) StringGet the table name.(package private) intinsertRow(ExecRow row, TransactionController tc) Inserts a base row into a catalog and inserts all the corresponding index rows.(package private) intinsertRowList(ExecRow[] rowList, TransactionController tc) Inserts a list of base rows into a catalog and inserts all the corresponding index rows.private intinsertRowListImpl(ExecRow[] rowList, TransactionController tc, RowLocation[] rowLocationOut) Insert logic to insert a list of rows into a table.(package private) booleanIs this fully initialized.(package private) booleanisIndexUnique(int indexNumber) Return whether or not this index is declared unique(package private) voidsetHeapConglomerate(long heapConglomerate) Set the heap conglomerate for this.(package private) voidsetIndexConglomerate(int index, long indexConglomerate) Set the index conglomerate for the table.(package private) voidSet the index conglomerate for the table.(package private) voidsetIndexRowGenerator(int indexNumber, IndexRowGenerator irg) Set the IndexRowGenerator for the specified index number.toString()(package private) voidupdateRow(ExecIndexRow key, ExecRow[] newRows, int indexNumber, boolean[] indicesToUpdate, int[] colsToUpdate, TransactionController tc) Updates a set of base rows in a catalog with the same key on an index and updates all the corresponding index rows.(package private) voidupdateRow(ExecIndexRow key, ExecRow newRow, int indexNumber, boolean[] indicesToUpdate, int[] colsToUpdate, TransactionController tc) Updates a base row in a catalog and updates all the corresponding index rows.
-
Field Details
-
ROWNOTDUPLICATE
static final int ROWNOTDUPLICATEROWNOTDUPLICATE is out of range for a row number. If a return code does not equal this value, then it refers to the row that is a duplicate.- See Also:
-
indexes
-
heapConglomerate
private long heapConglomerate -
numIndexesSet
private int numIndexesSet -
heapSet
private boolean heapSet -
crf
-
computedStreamStorableHeapColIds
private boolean computedStreamStorableHeapColIds -
streamStorableHeapColIds
private int[] streamStorableHeapColIds
-
-
Constructor Details
-
TabInfoImpl
-
-
Method Details
-
getHeapConglomerate
long getHeapConglomerate()Get the conglomerate for the heap.- Returns:
- long The conglomerate for the heap.
-
setHeapConglomerate
void setHeapConglomerate(long heapConglomerate) Set the heap conglomerate for this.- Parameters:
heapConglomerate- The new heap conglomerate.
-
getIndexConglomerate
long getIndexConglomerate(int indexID) Get the conglomerate for the specified index.- Returns:
- long The conglomerate for the specified index.
-
setIndexConglomerate
void setIndexConglomerate(int index, long indexConglomerate) Set the index conglomerate for the table.- Parameters:
index- Index number for index for tableindexConglomerate- The conglomerate for that index
-
setIndexConglomerate
Set the index conglomerate for the table.- Parameters:
cd- The ConglomerateDescriptor for one of the index for this table.
-
getTableName
-
getIndexName
Get the index name.- Parameters:
indexId- Index number for index for table- Returns:
- String The index name.
-
getCatalogRowFactory
CatalogRowFactory getCatalogRowFactory()Get the CatalogRowFactory for this.- Returns:
- CatalogRowFactory The CatalogRowFactory for this.
-
isComplete
boolean isComplete()Is this fully initialized. (i.e., is all conglomerate info initialized)- Returns:
- boolean Whether or not this is fully initialized.
-
getIndexColumnCount
int getIndexColumnCount(int indexNumber) Get the column count for the specified index number.- Parameters:
indexNumber- The index number.- Returns:
- int The column count for the specified index.
-
getIndexRowGenerator
Get the IndexRowGenerator for the specified index number.- Parameters:
indexNumber- The index number.- Returns:
- IndexRowGenerator The IRG for the specified index number.
-
setIndexRowGenerator
Set the IndexRowGenerator for the specified index number.- Parameters:
indexNumber- The index number.irg- The IndexRowGenerator for the specified index number.
-
getNumberOfIndexes
int getNumberOfIndexes()Get the number of indexes on this catalog.- Returns:
- int The number of indexes on this catalog.
-
getBaseColumnPosition
int getBaseColumnPosition(int indexNumber, int colNumber) Get the base column position for a column within a catalog given the (0-based) index number for this catalog and the (0-based) column number for the column within the index.- Parameters:
indexNumber- The index numbercolNumber- The column number within the index- Returns:
- int The base column position for the column.
-
isIndexUnique
boolean isIndexUnique(int indexNumber) Return whether or not this index is declared unique- Parameters:
indexNumber- The index number- Returns:
- boolean Whether or not this index is declared unique
-
insertRow
Inserts a base row into a catalog and inserts all the corresponding index rows.- Parameters:
row- row to inserttc- transaction- Returns:
- row number (>= 0) if duplicate row inserted into an index ROWNOTDUPLICATE otherwise
- Throws:
StandardException- Thrown on failure
-
insertRowList
Inserts a list of base rows into a catalog and inserts all the corresponding index rows.- Parameters:
rowList- List of rows to inserttc- transaction controller- Returns:
- row number (>= 0) if duplicate row inserted into an index ROWNOTDUPLICATE otherwise
- Throws:
StandardException- Thrown on failure
-
insertRowListImpl
private int insertRowListImpl(ExecRow[] rowList, TransactionController tc, RowLocation[] rowLocationOut) throws StandardException Insert logic to insert a list of rows into a table. This logic has two odd features.- Returns an indication if any returned row was a duplicate.
- Returns the RowLocation of the last row inserted.
- Parameters:
rowList- the list of rows to inserttc- transaction controllerrowLocationOut- on output rowLocationOut[0] is set to the last RowLocation inserted.- Returns:
- row number (>= 0) if duplicate row inserted into an index ROWNOTDUPLICATE otherwise
- Throws:
StandardException
-
deleteRow
Given a key row, delete all matching heap rows and their index rows.LOCKING: row locking if there is a key; otherwise, table locking.
- Parameters:
tc- transaction controllerkey- key to delete by.indexNumber- Key is appropriate for this index.- Returns:
- the number of rows deleted. If key is not unique, this may be more than one.
- Throws:
StandardException- Thrown on failure
-
deleteRow
int deleteRow(TransactionController tc, ExecIndexRow key, int indexNumber, boolean wait) throws StandardException - Throws:
StandardException
-
deleteRows
int deleteRows(TransactionController tc, ExecIndexRow startKey, int startOp, Qualifier[][] qualifier, TupleFilter filter, ExecIndexRow stopKey, int stopOp, int indexNumber) throws StandardException Delete the set of rows defined by a scan on an index from the table. Most of the parameters are simply passed to TransactionController.openScan. Please refer to the TransactionController documentation for details.LOCKING: row locking if there is a start and a stop key; otherwise, table locking
- Parameters:
tc- transaction controllerstartKey- key to start the scan.startOp- operation to start the scan.qualifier- a qualifier for the scan.filter- filter on base rowsstopKey- key to start the scan.stopOp- operation to start the scan.indexNumber- Key is appropriate for this index.- Returns:
- the number of rows deleted.
- Throws:
StandardException- Thrown on failure- See Also:
-
deleteRows
private int deleteRows(TransactionController tc, ExecIndexRow startKey, int startOp, Qualifier[][] qualifier, TupleFilter filter, ExecIndexRow stopKey, int stopOp, int indexNumber, boolean wait) throws StandardException - Throws:
StandardException
-
getRow
ExecRow getRow(TransactionController tc, ExecIndexRow key, int indexNumber) throws StandardException Given a key row, return the first matching heap row.LOCKING: shared row locking.
- Parameters:
tc- transaction controllerkey- key to read by.indexNumber- Key is appropriate for this index.- Throws:
StandardException- Thrown on failure
-
getRowLocation
RowLocation getRowLocation(TransactionController tc, ExecIndexRow key, int indexNumber) throws StandardException Given an index row and index number return the RowLocation in the heap of the first matching row. Used by the autoincrement code to get the RowLocation in syscolumns given a <tablename, columname> pair.- Parameters:
tc- Transaction Controller to use.key- Index Row to search in the index.indexNumber- Identifies the index to use.- Throws:
StandardException- thrown on failure.- See Also:
-
getRow
ExecRow getRow(TransactionController tc, ConglomerateController heapCC, ExecIndexRow key, int indexNumber) throws StandardException Given a key row, return the first matching heap row.LOCKING: shared row locking.
- Parameters:
tc- transaction controllerheapCC- heap to look inkey- key to read by.indexNumber- Key is appropriate for this index.- Throws:
StandardException- Thrown on failure
-
getRowInternal
private ExecRow getRowInternal(TransactionController tc, ConglomerateController heapCC, ExecIndexRow key, int indexNumber, RowLocation[] rl) throws StandardException - Throws:
StandardException- Thrown on failure
-
updateRow
void updateRow(ExecIndexRow key, ExecRow newRow, int indexNumber, boolean[] indicesToUpdate, int[] colsToUpdate, TransactionController tc) throws StandardException Updates a base row in a catalog and updates all the corresponding index rows.- Parameters:
key- key rownewRow- new version of the rowindexNumber- index that key operatesindicesToUpdate- array of booleans, one for each index on the catalog. if a boolean is true, that means we must update the corresponding index because changes in the newRow affect it.colsToUpdate- array of ints indicating which columns (1 based) to update. If null, do all.tc- transaction controller- Throws:
StandardException- Thrown on failure
-
updateRow
void updateRow(ExecIndexRow key, ExecRow[] newRows, int indexNumber, boolean[] indicesToUpdate, int[] colsToUpdate, TransactionController tc) throws StandardException Updates a set of base rows in a catalog with the same key on an index and updates all the corresponding index rows.- Parameters:
key- key rownewRows- new version of the array of rowsindexNumber- index that key operatesindicesToUpdate- array of booleans, one for each index on the catalog. if a boolean is true, that means we must update the corresponding index because changes in the newRow affect it.colsToUpdate- array of ints indicating which columns (1 based) to update. If null, do all.tc- transaction controller- Throws:
StandardException- Thrown on failure
-
getCreateHeapProperties
Properties getCreateHeapProperties()Get the Properties associated with creating the heap.- Returns:
- The Properties associated with creating the heap.
-
getCreateIndexProperties
Get the Properties associated with creating the specified index.- Parameters:
indexNumber- The specified index number.- Returns:
- The Properties associated with creating the specified index.
-
getRowChanger
private RowChanger getRowChanger(TransactionController tc, int[] changedCols, ExecRow baseRow) throws StandardException Gets a row changer for this catalog.- Parameters:
tc- transaction controllerchangedCols- the columns to change (1 based), may be nullbaseRow- used to detemine column types at creation time only. The row changer does ***Not*** keep a referance to this row or change it in any way.- Returns:
- a row changer for this catalog.
- Throws:
StandardException- Thrown on failure
-
getStreamStorableHeapColIds
- Throws:
StandardException
-
getIndexRowFromHeapRow
private ExecIndexRow getIndexRowFromHeapRow(IndexRowGenerator irg, RowLocation rl, ExecRow heapRow) throws StandardException Get an index row based on a row from the heap.- Parameters:
irg- IndexRowGenerator to userl- RowLocation for heapheapRow- Row from the heap- Returns:
- ExecIndexRow Index row.
- Throws:
StandardException- Thrown on error
-
toString
-