private void buildNodeTableBPTreeIndex() { try { // Node table B+Tree index (i.e. node2id.dat/idn) log.info( "Node Table (3/3): building node table B+Tree index (i.e. node2id.dat and node2id.idn files)..."); final ProgressLogger monitor03 = new ProgressLogger( log, "records for node table (3/3) phase", BulkLoader.DataTickPoint, BulkLoader.superTick); monitor03.start(); String path = dsg.getLocation().getDirectoryPath(); new File(path, "node2id.dat").delete(); new File(path, "node2id.idn").delete(); final RecordFactory recordFactory = new RecordFactory(LenNodeHash, SizeOfNodeId); Transform<Pair<byte[], byte[]>, Record> transformPair2Record = new Transform<Pair<byte[], byte[]>, Record>() { @Override public Record convert(Pair<byte[], byte[]> pair) { monitor03.tick(); return recordFactory.create(pair.getLeft(), pair.getRight()); } }; int order = BPlusTreeParams.calcOrder(SystemTDB.BlockSize, recordFactory); BPlusTreeParams bptParams = new BPlusTreeParams(order, recordFactory); int readCacheSize = 10; int writeCacheSize = 100; FileSet destination = new FileSet(dsg.getLocation(), Names.indexNode2Id); BlockMgr blkMgrNodes = BlockMgrFactory.create( destination, Names.bptExtTree, SystemTDB.BlockSize, readCacheSize, writeCacheSize); BlockMgr blkMgrRecords = BlockMgrFactory.create( destination, Names.bptExtRecords, SystemTDB.BlockSize, readCacheSize, writeCacheSize); Iterator<Record> iter2 = Iter.iter(sdb03.iterator()).map(transformPair2Record); BPlusTree bpt2 = BPlusTreeRewriter.packIntoBPlusTree( iter2, bptParams, recordFactory, blkMgrNodes, blkMgrRecords); bpt2.sync(); ProgressLogger.print(log, monitor03); } finally { sdb03.close(); sdb03 = null; } }