|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.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 | |
private boolean |
computedStreamStorableHeapColIds
|
private CatalogRowFactory |
crf
|
private ExecutionFactory |
executionFactory
|
private long |
heapConglomerate
|
private boolean |
heapSet
|
private IndexInfoImpl[] |
indexes
|
private java.lang.String |
name
|
private int |
numIndexesSet
|
private int[] |
streamStorableHeapColIds
|
private UUID |
uuid
|
| Fields inherited from interface org.apache.derby.iapi.sql.dictionary.TabInfo |
ROWNOTDUPLICATE |
| Constructor Summary | |
TabInfoImpl(CatalogRowFactory crf)
Constructor |
|
| Method Summary | |
int |
deleteRow(TransactionController tc,
ExecIndexRow key,
int indexNumber)
LOCKING: row locking if there there is a key |
int |
deleteRows(TransactionController tc,
ExecIndexRow startKey,
int startOp,
Qualifier[][] qualifier,
TupleFilter filter,
ExecIndexRow stopKey,
int stopOp,
int indexNumber)
LOCKING: row locking if there is both a start and stop key; otherwise table locking |
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. |
CatalogRowFactory |
getCatalogRowFactory()
Get the CatalogRowFactory for this TabInfo. |
java.util.Properties |
getCreateHeapProperties()
Get the Properties associated with creating the heap. |
java.util.Properties |
getCreateIndexProperties(int indexNumber)
Get the Properties associated with creating the specified index. |
long |
getHeapConglomerate()
Get the conglomerate for the heap. |
int |
getIndexColumnCount(int indexNumber)
Get the column count for the specified index number. |
long |
getIndexConglomerate(int indexID)
Get the conglomerate for the specified index. |
java.lang.String |
getIndexName(int indexId)
Get the index name. |
private ExecIndexRow |
getIndexRowFromHeapRow(IndexRowGenerator irg,
RowLocation rl,
ExecRow heapRow)
Get an index row based on a row from the heap. |
IndexRowGenerator |
getIndexRowGenerator(int indexNumber)
Get the IndexRowGenerator for the specified index number. |
int |
getNumberOfIndexes()
Get the number of indexes on this catalog. |
ExecRow |
getRow(TransactionController tc,
ConglomerateController heapCC,
ExecIndexRow key,
int indexNumber)
Given a key row, return the first matching heap row. |
ExecRow |
getRow(TransactionController tc,
ExecIndexRow key,
int indexNumber)
Given a key row, return the first matching heap row. |
private RowChanger |
getRowChanger(TransactionController tc,
int[] changedCols,
ExecRow baseRow)
Gets a row changer for this catalog. |
private ExecRow |
getRowInternal(TransactionController tc,
ConglomerateController heapCC,
ExecIndexRow key,
int indexNumber,
RowLocation[] rl)
|
RowLocation |
getRowLocation(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)
|
java.lang.String |
getTableName()
Get the table name. |
int |
insertRow(ExecRow row,
LanguageConnectionContext lcc)
Inserts a base row into a catalog and inserts all the corresponding index rows. |
int |
insertRow(ExecRow row,
TransactionController tc,
boolean wait)
Inserts a base row into a catalog and inserts all the corresponding index rows. |
RowLocation |
insertRowAndFetchRowLocation(ExecRow row,
TransactionController tc)
Inserts a base row into a catalog and inserts all the corresponding index rows. |
int |
insertRowList(ExecRow[] rowList,
TransactionController tc)
Inserts a list of base rows into a catalog and inserts all the corresponding index rows. |
private int |
insertRowListImpl(ExecRow[] rowList,
TransactionController tc,
RowLocation[] rowLocationOut,
boolean wait)
Insert logic to insert a list of rows into a table. |
boolean |
isComplete()
Is the TabInfo fully initialized. |
boolean |
isIndexUnique(int indexNumber)
Return whether or not this index is declared unique |
void |
setBaseColumnPosition(int indexNumber,
int colNumber,
int baseColumnPosition)
Set 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. |
void |
setHeapConglomerate(long heapConglomerate)
Set the heap conglomerate for the TabInfo. |
void |
setIndexConglomerate(ConglomerateDescriptor cd)
Set the index conglomerate for the table. |
void |
setIndexConglomerate(int index,
long indexConglomerate)
Set the index conglomerate for the table. |
void |
setIndexName(int indexID,
java.lang.String indexName)
Set the index name for the specified indexID |
void |
setIndexRowGenerator(int indexNumber,
IndexRowGenerator irg)
Set the IndexRowGenerator for the specified index number. |
java.lang.String |
toString()
|
int |
truncate(TransactionController tc)
Delete all the rows from the table. |
void |
updateRow(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. |
void |
updateRow(ExecIndexRow key,
ExecRow[] newRows,
int indexNumber,
boolean[] indicesToUpdate,
int[] colsToUpdate,
TransactionController tc,
boolean wait)
Updates a set of base rows in a catalog with the same key on an index and updates all the corresponding index rows. |
void |
updateRow(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. |
void |
updateRow(ExecIndexRow key,
ExecRow newRow,
int indexNumber,
boolean[] indicesToUpdate,
int[] colsToUpdate,
TransactionController tc,
boolean wait)
Updates a base row in a catalog and updates all the corresponding index rows. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
private IndexInfoImpl[] indexes
private java.lang.String name
private long heapConglomerate
private int numIndexesSet
private boolean heapSet
private UUID uuid
private CatalogRowFactory crf
private ExecutionFactory executionFactory
private boolean computedStreamStorableHeapColIds
private int[] streamStorableHeapColIds
| Constructor Detail |
public TabInfoImpl(CatalogRowFactory crf)
crf - the associated CatalogRowFactory| Method Detail |
public long getHeapConglomerate()
TabInfo
getHeapConglomerate in interface TabInfoTabInfo.getHeapConglomerate()public void setHeapConglomerate(long heapConglomerate)
TabInfo
setHeapConglomerate in interface TabInfoheapConglomerate - The new heap conglomerate.
TabInfo.setHeapConglomerate(long)public long getIndexConglomerate(int indexID)
TabInfo
getIndexConglomerate in interface TabInfoTabInfo.getIndexConglomerate(int)
public void setIndexConglomerate(int index,
long indexConglomerate)
TabInfo
setIndexConglomerate in interface TabInfoindex - Index number for index for tableindexConglomerate - The conglomerate for that index
TabInfo.setIndexConglomerate(int, long)public void setIndexConglomerate(ConglomerateDescriptor cd)
TabInfo
setIndexConglomerate in interface TabInfocd - The ConglomerateDescriptor for one of the index
for this table.
public java.lang.String getTableName()
TabInfo
getTableName in interface TabInfoTabInfo.getTableName()public java.lang.String getIndexName(int indexId)
TabInfo
getIndexName in interface TabInfoindexId - Index number for index for table
TabInfo.getIndexName(int)
public void setIndexName(int indexID,
java.lang.String indexName)
TabInfo
setIndexName in interface TabInfoindexID - Index number for index for tableindexName - The name for that index IDTabInfo.setIndexName(int, java.lang.String)public CatalogRowFactory getCatalogRowFactory()
TabInfo
getCatalogRowFactory in interface TabInfoTabInfo.getCatalogRowFactory()public boolean isComplete()
TabInfo
isComplete in interface TabInfoTabInfo.isComplete()public int getIndexColumnCount(int indexNumber)
TabInfo
getIndexColumnCount in interface TabInfoindexNumber - The index number.
TabInfo.getIndexColumnCount(int)public IndexRowGenerator getIndexRowGenerator(int indexNumber)
TabInfo
getIndexRowGenerator in interface TabInfoindexNumber - The index number.
TabInfo.getIndexRowGenerator(int)
public void setIndexRowGenerator(int indexNumber,
IndexRowGenerator irg)
TabInfo
setIndexRowGenerator in interface TabInfoindexNumber - The index number.irg - The IndexRowGenerator for the specified index number.
TabInfo.setIndexRowGenerator(int, org.apache.derby.iapi.sql.dictionary.IndexRowGenerator)public int getNumberOfIndexes()
TabInfo
getNumberOfIndexes in interface TabInfoTabInfo.getNumberOfIndexes()
public int getBaseColumnPosition(int indexNumber,
int colNumber)
TabInfo
getBaseColumnPosition in interface TabInfoindexNumber - The index numbercolNumber - The column number within the index
TabInfo.getBaseColumnPosition(int, int)
public void setBaseColumnPosition(int indexNumber,
int colNumber,
int baseColumnPosition)
TabInfo
setBaseColumnPosition in interface TabInfoindexNumber - The index numbercolNumber - The column number within the index
TabInfo.setBaseColumnPosition(int, int, int)public boolean isIndexUnique(int indexNumber)
TabInfo
isIndexUnique in interface TabInfoindexNumber - The index number
TabInfo.isIndexUnique(int)
public int insertRow(ExecRow row,
TransactionController tc,
boolean wait)
throws StandardException
insertRow in interface TabInforow - row to inserttc - transactionwait - to wait on lock or quickly TIMEOUT
StandardException - Thrown on failure
public int insertRow(ExecRow row,
LanguageConnectionContext lcc)
throws StandardException
insertRow in interface TabInforow - row to insertlcc - language state variable
StandardException - Thrown on failure
public RowLocation insertRowAndFetchRowLocation(ExecRow row,
TransactionController tc)
throws StandardException
TabInfo
insertRowAndFetchRowLocation in interface TabInfotc - transaction controller
StandardException - Thrown on failureTabInfo.insertRowAndFetchRowLocation(org.apache.derby.iapi.sql.execute.ExecRow, org.apache.derby.iapi.store.access.TransactionController)
public int insertRowList(ExecRow[] rowList,
TransactionController tc)
throws StandardException
insertRowList in interface TabInforowList - List of rows to inserttc - transaction controller
StandardException - Thrown on failure
private int insertRowListImpl(ExecRow[] rowList,
TransactionController tc,
RowLocation[] rowLocationOut,
boolean wait)
throws StandardException
rowList - the list of rows to inserttc - transaction controllerrowLocationOut - on output rowLocationOut[0] is set to the
last RowLocation inserted.wait - to wait on lock or quickly TIMEOUT
StandardException
public int truncate(TransactionController tc)
throws StandardException
TabInfoLOCKING: exclusive TABLE locking
truncate in interface TabInfotc - transaction controller
StandardException - Thrown on failureTabInfo.truncate(org.apache.derby.iapi.store.access.TransactionController)
public int deleteRow(TransactionController tc,
ExecIndexRow key,
int indexNumber)
throws StandardException
deleteRow in interface TabInfotc - transaction controllerkey - key to delete by.indexNumber - Key is appropriate for this index.
StandardException - Thrown on failureTabInfo.deleteRow(org.apache.derby.iapi.store.access.TransactionController, org.apache.derby.iapi.sql.execute.ExecIndexRow, int)
public int deleteRows(TransactionController tc,
ExecIndexRow startKey,
int startOp,
Qualifier[][] qualifier,
TupleFilter filter,
ExecIndexRow stopKey,
int stopOp,
int indexNumber)
throws StandardException
deleteRows in interface TabInfotc - transaction controllerstartKey - key to start the scan.startOp - operation to start the scan.stopKey - key to start the scan.qualifier - a qualifier for the scan.filter - filter on base rowsstopOp - operation to start the scan.indexNumber - Key is appropriate for this index.
StandardException - Thrown on failureTabInfo.deleteRows(org.apache.derby.iapi.store.access.TransactionController, org.apache.derby.iapi.sql.execute.ExecIndexRow, int, org.apache.derby.iapi.store.access.Qualifier[][], org.apache.derby.iapi.sql.execute.TupleFilter, org.apache.derby.iapi.sql.execute.ExecIndexRow, int, int)
public ExecRow getRow(TransactionController tc,
ExecIndexRow key,
int indexNumber)
throws StandardException
TabInfoLOCKING: shared row locking.
getRow in interface TabInfotc - transaction controllerkey - key to read by.indexNumber - Key is appropriate for this index.
StandardException - Thrown on failureTabInfo.getRow(org.apache.derby.iapi.store.access.TransactionController, org.apache.derby.iapi.sql.execute.ExecIndexRow, int)
public RowLocation getRowLocation(TransactionController tc,
ExecIndexRow key,
int indexNumber)
throws StandardException
getRowLocation in interface TabInfotc - Transaction Controller to use.key - Index Row to search in the index.indexNumber - Identifies the index to use.
StandardException - thrown on failure.DataDictionaryImpl.computeRowLocation(TransactionController, TableDescriptor, String)
public ExecRow getRow(TransactionController tc,
ConglomerateController heapCC,
ExecIndexRow key,
int indexNumber)
throws StandardException
TabInfoLOCKING: shared row locking.
getRow in interface TabInfotc - transaction controllerheapCC - heap to look inkey - key to read by.indexNumber - Key is appropriate for this index.
StandardException - Thrown on failureTabInfo.getRow(org.apache.derby.iapi.store.access.TransactionController, org.apache.derby.iapi.sql.execute.ExecIndexRow, int)
private ExecRow getRowInternal(TransactionController tc,
ConglomerateController heapCC,
ExecIndexRow key,
int indexNumber,
RowLocation[] rl)
throws StandardException
StandardException - Thrown on failureTabInfo.getRow(org.apache.derby.iapi.store.access.TransactionController, org.apache.derby.iapi.sql.execute.ExecIndexRow, int)
public void updateRow(ExecIndexRow key,
ExecRow newRow,
int indexNumber,
boolean[] indicesToUpdate,
int[] colsToUpdate,
TransactionController tc)
throws StandardException
updateRow in interface TabInfokey - 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
StandardException - Thrown on failure
public void updateRow(ExecIndexRow key,
ExecRow newRow,
int indexNumber,
boolean[] indicesToUpdate,
int[] colsToUpdate,
TransactionController tc,
boolean wait)
throws StandardException
updateRow in interface TabInfokey - 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 controllerwait - 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
public void updateRow(ExecIndexRow key,
ExecRow[] newRows,
int indexNumber,
boolean[] indicesToUpdate,
int[] colsToUpdate,
TransactionController tc)
throws StandardException
updateRow in interface TabInfokey - 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
StandardException - Thrown on failure
public void updateRow(ExecIndexRow key,
ExecRow[] newRows,
int indexNumber,
boolean[] indicesToUpdate,
int[] colsToUpdate,
TransactionController tc,
boolean wait)
throws StandardException
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 controllerwait - If true, then the caller wants to wait for locks. When
using a nested user xaction we want to timeout right away
if the parent holds the lock. (bug 4821)
StandardException - Thrown on failurepublic java.util.Properties getCreateHeapProperties()
getCreateHeapProperties in interface TabInfopublic java.util.Properties getCreateIndexProperties(int indexNumber)
getCreateIndexProperties in interface TabInfoindexNumber - The specified index number.
private RowChanger getRowChanger(TransactionController tc,
int[] changedCols,
ExecRow baseRow)
throws StandardException
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.
StandardException - Thrown on failure
private int[] getStreamStorableHeapColIds(ExecRow baseRow)
throws StandardException
StandardException
private ExecIndexRow getIndexRowFromHeapRow(IndexRowGenerator irg,
RowLocation rl,
ExecRow heapRow)
throws StandardException
irg - IndexRowGenerator to userl - RowLocation for heapheapRow - Row from the heap
StandardException - Thrown on errorpublic java.lang.String toString()
|
Built on Tue 2006-10-10 19:23:47+0200, from revision exported | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||