String indexOrder = indexName2 ;
String label = indexName1+" => "+indexName2 ;
if ( true )
{
TupleIndex index1 = IndexFactory.openTupleIndex(location1, indexName1, primary, indexName1, 10, 10, keyLength, valueLength) ;
TupleIndex index2 = IndexFactory.openTupleIndex(location2, indexName2, primary, indexOrder, 10, 10, keyLength, valueLength) ;
tupleIndexCopy(index1, index2, label) ;
index1.close() ;
index2.close() ;
}
else
{
// BPT -> BPT copy with reordering (hardcoded)
RangeIndex index1 = IndexFactory.openBPT(location1, indexName1, 10, 10, keyLength, valueLength) ;
// Unlikely to be metafile for destination.
keyLength = index1.getRecordFactory().keyLength() ;
valueLength = index1.getRecordFactory().valueLength() ;
RangeIndex index2 = IndexFactory.openBPT(location2, indexName2, 10000, 10000, keyLength, valueLength) ;
bptCopy(index1, index2, label) ;
index1.close() ;
index2.close() ;
}
}