use of org.apache.jackrabbit.oak.segment.SegmentWriter in project jackrabbit-oak by apache.
the class FileStore method initialNode.
@Nonnull
private Supplier<RecordId> initialNode() {
return new Supplier<RecordId>() {
@Override
public RecordId get() {
try {
SegmentWriter writer = segmentWriterBuilder("init").build(FileStore.this);
NodeBuilder builder = EMPTY_NODE.builder();
builder.setChildNode("root", EMPTY_NODE);
SegmentNodeState node = writer.writeNode(builder.getNodeState());
writer.flush();
return node.getRecordId();
} catch (IOException e) {
String msg = "Failed to write initial node";
log.error(msg, e);
throw new IllegalStateException(msg, e);
}
}
};
}
Aggregations