* Rebuilds the indexes
*/
private void rebuildIndexes()
throws IOException, SQLException
{
DbTransaction xa = DbTransaction.create();
xa.setAutoCommit(true);
try {
TableIterator iter = createTableIterator();
iter.init(xa);
Column []columns = _row.getColumns();
while (iter.nextBlock()) {
iter.initRow();
byte []blockBuffer = iter.getBuffer();
while (iter.nextRow()) {
try {
long rowAddress = iter.getRowAddress();
int rowOffset = iter.getRowOffset();
for (int i = 0; i < columns.length; i++) {
Column column = columns[i];
/*
if (column.getIndex() != null)
System.out.println(Long.toHexString(iter.getBlock().getBlockId()) + ":" + Long.toHexString(rowAddress) + ":" + Long.toHexString(rowOffset) + ": " + column.getIndexKeyCompare().toString(blockBuffer, rowOffset + column.getColumnOffset(), column.getLength()));
*/
column.setIndex(xa, blockBuffer, rowOffset, rowAddress, null);
}
} catch (Exception e) {
log.log(Level.WARNING, e.toString(), e);
}
}
}
} finally {
xa.commit();
}
}