// Extract/derive information from the table descriptor
long[] conglomerateNumber = new long[cds.length];
ExecIndexRow[] indexRow = new ExecIndexRow[cds.length];
UUID[] objectUUID = new UUID[cds.length];
TransactionController tc = lcc.getTransactionExecute();
ConglomerateController heapCC =
tc.openConglomerate(td.getHeapConglomerateId(), false,
0,
TransactionController.MODE_RECORD,
asBackgroundTask
? TransactionController.ISOLATION_READ_UNCOMMITTED
: TransactionController.ISOLATION_REPEATABLE_READ
);
try
{
for (int i = 0; i < cds.length; i++)
{
if (!cds[i].isIndex())
{
conglomerateNumber[i] = -1;
continue;
}
conglomerateNumber[i] = cds[i].getConglomerateNumber();
objectUUID[i] = cds[i].getUUID();
indexRow[i] =
cds[i].getIndexDescriptor().getNullIndexRow(
td.getColumnDescriptorList(),
heapCC.newRowLocationTemplate());
}
}
finally
{
heapCC.close();
}
// [x][0] = conglomerate number, [x][1] = start time, [x][2] = stop time
long[][] scanTimes = new long[conglomerateNumber.length][3];
int sci = 0;
for (int indexNumber = 0;
indexNumber < conglomerateNumber.length;
indexNumber++)
{
if (conglomerateNumber[indexNumber] == -1)
continue;
// Check if daemon has been disabled.
if (asBackgroundTask) {
if (isShuttingDown()) {
break;
}
}
scanTimes[sci][0] = conglomerateNumber[indexNumber];
scanTimes[sci][1] = System.currentTimeMillis();
// Subtract one for the RowLocation added for indexes.
int numCols = indexRow[indexNumber].nColumns() - 1;
long[] cardinality = new long[numCols];
KeyComparator cmp = new KeyComparator(indexRow[indexNumber]);
/* Read uncommitted, with record locking. Actually CS store may
not hold record locks */
GroupFetchScanController gsc =
tc.openGroupFetchScan(
conglomerateNumber[indexNumber],
false, // hold
0,
TransactionController.MODE_RECORD, // locking
TransactionController.ISOLATION_READ_UNCOMMITTED,