use of org.neo4j.index.internal.gbptree.GBPTreeBootstrapper in project neo4j by neo4j.
the class ConsistencyCheckWithCorruptGBPTreeIT method corruptIndexes.
private List<Path> corruptIndexes(FileSystemAbstraction fs, DatabaseReadOnlyChecker readOnlyChecker, CorruptionInject corruptionInject, LayoutBootstrapper layoutBootstrapper, Path... targetFiles) throws Exception {
List<Path> treeFiles = new ArrayList<>();
try (JobScheduler jobScheduler = createInitialisedScheduler();
GBPTreeBootstrapper bootstrapper = new GBPTreeBootstrapper(fs, jobScheduler, layoutBootstrapper, readOnlyChecker, NULL)) {
for (Path file : targetFiles) {
GBPTreeBootstrapper.Bootstrap bootstrap = bootstrapper.bootstrapTree(file, NO_FLUSH_ON_CLOSE);
if (bootstrap.isTree()) {
treeFiles.add(file);
try (GBPTree<?, ?> gbpTree = bootstrap.getTree()) {
InspectingVisitor<?, ?> visitor = gbpTree.visit(new InspectingVisitor<>(), CursorContext.NULL);
corruptionInject.corrupt(gbpTree, visitor.get());
}
}
}
}
return treeFiles;
}
Aggregations