int keyUnitLen = indexName.length() ;
int keyLength = keySubLen*keyUnitLen ;
int valueLength = 0 ;
RangeIndex rIndex = IndexFactory.openBPT(loc, indexName,
SystemTDB.BlockReadCacheSize,
SystemTDB.BlockWriteCacheSize,
keyLength, valueLength) ;
BPlusTree bpt = (BPlusTree)rIndex ;
if ( false )
{
System.out.println("---- Index structure") ;
bpt.dump() ;
}
if ( true )
{
System.out.println("---- Index contents") ;
Iterator<Record> iter = bpt.iterator() ;
if ( ! iter.hasNext() )
System.out.println("<<Empty>>") ;
for ( ; iter.hasNext() ; )
{
Record r = iter.next();
printRecord("", System.out, r, keyUnitLen) ;
}
}
// Check.
Iterator<Record> iterCheck = bpt.iterator() ;
Record r1 = null ;
int i = 0 ;
for ( ; iterCheck.hasNext() ; )
{
Record r2 = iterCheck.next();
i++ ;
if ( r1 != null )
{
if ( ! Record.keyLT(r1, r2) )
{
System.err.println("key error@ "+i) ;
printRecord(" ", System.err, r1, keyUnitLen) ;
printRecord(" ", System.err, r2, keyUnitLen) ;
}
}
r1 = r2 ;
}
if ( false )
{
// Dump in tuple order.
TupleIndex tupleIndex = new TupleIndexRecord(primary.length(), new ColumnMap(primary, indexName), indexName, rIndex.getRecordFactory(), rIndex) ;
if ( true )
{
System.out.println("---- Tuple contents") ;
Iterator<Tuple<NodeId>> iter2 = tupleIndex.all() ;
if ( ! iter2.hasNext() )