final int size = indexName.length() ;
if ( ( size != 3 ) && ( size != 4 ) ) throw new AtlasException("Unsupported size.") ;
final RecordFactory recordFactory ;
if ( size == 3 ) {
recordFactory = new RecordFactory(SystemTDB.LenIndexTripleRecord, 0) ;
} else {
recordFactory = new RecordFactory(SystemTDB.LenIndexQuadRecord, 0) ;
}
int order = BPlusTreeParams.calcOrder(SystemTDB.BlockSize, recordFactory) ;
BPlusTreeParams bptParams = new BPlusTreeParams(order, recordFactory) ;
int readCacheSize = 10 ;
int writeCacheSize = 100 ;
FileSet destination = new FileSet(location, indexName) ;
BlockMgr blkMgrNodes = BlockMgrFactory.create(destination, Names.bptExtTree, SystemTDB.BlockSize, readCacheSize, writeCacheSize) ;
BlockMgr blkMgrRecords = BlockMgrFactory.create(destination, Names.bptExtRecords, SystemTDB.BlockSize, readCacheSize, writeCacheSize) ;
cmdLog.info("Index: creating " + indexName + " index...") ;
final ProgressLogger monitor = new ProgressLogger(cmdLog, "records to " + indexName, BulkLoader.DataTickPoint,BulkLoader.superTick) ;
monitor.start() ;
Transform<Tuple<Long>, Record> transformTuple2Record = new Transform<Tuple<Long>, Record>() {
@Override public Record convert(Tuple<Long> tuple) {
Record record = recordFactory.create() ;
for ( int i = 0; i < size; i++ ) {
Bytes.setLong(tuple.get(i), record.getKey(), i * SystemTDB.SizeOfLong) ;
}
monitor.tick() ;
return record ;