use of org.apache.cassandra.index.sasi.utils.MappedBuffer in project cassandra by apache.
the class TokenTreeTest method buildTree.
private static TokenTree buildTree(TokenTreeBuilder builder) throws Exception {
builder.finish();
final File treeFile = FileUtils.createTempFile("token-tree-", "db");
treeFile.deleteOnExit();
try (SequentialWriter writer = new SequentialWriter(treeFile, DEFAULT_OPT)) {
builder.write(writer);
writer.sync();
}
final RandomAccessReader reader = RandomAccessReader.open(treeFile);
return new TokenTree(new MappedBuffer(reader));
}
Aggregations