use of jdbm.recman.CacheRecordManager in project qi4j-sdk by Qi4j.
the class JdbmEntityStoreMixin method initialize.
private void initialize() throws IOException {
String name = getDatabaseName();
Properties properties = getProperties();
recordManager = RecordManagerFactory.createRecordManager(name, properties);
serializer = DefaultSerializer.INSTANCE;
recordManager = new CacheRecordManager(recordManager, 1000, false);
long recid = recordManager.getNamedObject("index");
if (recid != 0) {
index = BTree.load(recordManager, recid);
} else {
ByteArrayComparator comparator = new ByteArrayComparator();
index = BTree.createInstance(recordManager, comparator, serializer, DefaultSerializer.INSTANCE, 16);
recordManager.setNamedObject("index", index.getRecid());
}
recordManager.commit();
}
Aggregations