for (int i = 0; i < noOfDatabases; i++)
{
File f = FileSupport.createTempFile();
File treef = FileSupport.createTempFile();
File logf = FileSupport.createTempFile();
DatabaseBackend<Integer, Long, Long> b = new ConstantRecordSizeHeapBackend<Integer, Long>(new ReadWritableFileAdapter(f), false, IntegerSerializer.INSTANCE, LongSerializer.INSTANCE, 0, 8192, lah);
// Maximum pointer needed: approx 1,000,000 * node size
// approx: 1,000,000 * 20 = 20,000,000 < 4294967296 =
// 2 ^ (4 * 8). i.e pointer size = 4 bytes
NodeRepository<Integer> nr = new FileBackedNodeRepository<Integer, Long>(new ReadWritableFileAdapter(treef), false, 0, new FixedSizeNodeSizeStrategy(m_bTreeNodeSize), true, IntegerNullSerializer.INSTANCE, LongSerializer.INSTANCE, 4, 8192, null, lah);
if (m_bTreeLruNodeCacheSize > 0)
{
nr = new LruCacheNodeRepository<Integer, Long>(nr, m_bTreeLruNodeCacheSize);
}
BPlusTree<Integer, Long> btree = new BPlusTree<Integer, Long>(nr, lah);
b = new BPlusTreeIndexBackend<Integer, Long, Integer, Long>(b, false, btree, IntegerToIntegerHasher.INSTANCE, lah);
LoggingTransactionalDatabase<Integer, Long, Long> db = new LoggingTransactionalDatabase<Integer, Long, Long>(b, new ReadWritableFileAdapter(logf), IntegerSerializer.INSTANCE, LongSerializer.INSTANCE, lah);
m_dbFiles.put(System.identityHashCode(db), new File[] { f, treef, logf });
m_databases.add(db);
}
}