use of org.neo4j.causalclustering.catchup.storecopy.TemporaryStoreDirectory in project neo4j by neo4j.
the class StartStopLoad method assertStoreConsistent.
private void assertStoreConsistent(String storeDir, KernelExtensions kernelExtensions) {
File fromDirectory = new File(storeDir);
File parent = fromDirectory.getParentFile();
try (TemporaryStoreDirectory storeDirectory = new TemporaryStoreDirectory(fs, pageCache, parent);
PageCache pageCache = StandalonePageCacheFactory.createPageCache(fs)) {
fs.copyRecursively(fromDirectory, storeDirectory.storeDir());
new CopiedStoreRecovery(Config.defaults(), kernelExtensions.listFactories(), pageCache).recoverCopiedStore(storeDirectory.storeDir());
ConsistencyCheckService.Result result = runConsistencyCheckTool(new String[] { storeDir });
if (!result.isSuccessful()) {
throw new RuntimeException("Not consistent database in " + storeDir);
}
} catch (Throwable e) {
throw new RuntimeException("Failed to run CC on " + storeDir, e);
}
}
Aggregations