for (int i = 0; i < noOfDatabases; i++)
{
File f = FileSupport.createTempFile();
File treef = FileSupport.createTempFile();
File logf = FileSupport.createTempFile();
DatabaseBackend<String, String, Long> b = new HeapBackend<String, String>(new ReadWritableFileAdapter(f), false, StringSerializer.INSTANCE, StringSerializer.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<BigInteger> nr = new FileBackedNodeRepository<BigInteger, Long>(new ReadWritableFileAdapter(treef), false, 0, new FixedSizeNodeSizeStrategy(m_bTreeNodeSize), true, new FixedSizeBigIntegerNullSerializer(STRING_HASH_SIZE + 1), LongNullSerializer.INSTANCE, 4, 8192, null, lah);
if (m_bTreeLruNodeCacheSize > 0)
{
nr = new LruCacheNodeRepository<BigInteger, Long>(nr, m_bTreeLruNodeCacheSize);
}
BPlusTree<BigInteger, Long> btree = new BPlusTree<BigInteger, Long>(nr, lah);
// Only use 7 bits of the most significant byte when hashing to
// avoid collisions with the serialized null value
b = new BPlusTreeIndexBackend<String, String, BigInteger, Long>(b, false, btree, new StringToBigIntegerHasher(STRING_HASH_SIZE, 7), lah);
LoggingTransactionalDatabase<String, String, Long> db = new LoggingTransactionalDatabase<String, String, Long>(b, new ReadWritableFileAdapter(logf), StringSerializer.INSTANCE, StringSerializer.INSTANCE, lah);
m_dbFiles.put(System.identityHashCode(db), new File[] { f, treef, logf });
m_databases.add(db);
}
}