DBObject id = new BasicDBObject("_id", "root");
state = journals.findOne(id, null, primaryPreferred());
if (state == null) {
SegmentWriter writer = new SegmentWriter(store);
RecordId head = writer.writeNode(root).getRecordId();
writer.flush();
state = new BasicDBObject(of(
"_id", "root",
"head", head.toString()));
try {