use of org.neo4j.kernel.impl.pagecache.ConfiguringPageCacheFactory in project neo4j by neo4j.
the class IndexCheckingSelectorTest method checkIndexesWithoutValuesWithNodeChecker.
@Test
void checkIndexesWithoutValuesWithNodeChecker() throws Exception {
try (Transaction tx = db.beginTx()) {
Node node = tx.createNode(label1);
node.setProperty(property1, "value");
tx.commit();
}
try (Transaction tx = db.beginTx()) {
tx.execute("CREATE FULLTEXT INDEX FOR (n:Label1) ON EACH [n.property1]");
tx.commit();
}
dbms.shutdown();
Config config = defaults(GraphDatabaseSettings.logs_directory, layout.databaseDirectory());
JobScheduler jobScheduler = JobSchedulerFactory.createInitialisedScheduler();
ConfiguringPageCacheFactory pageCacheFactory = new ConfiguringPageCacheFactory(fs, config, NULL, NullLog.getInstance(), jobScheduler, Clocks.nanoClock(), new MemoryPools(config.get(memory_tracking)));
PageCache pageCache = pageCacheFactory.getOrCreatePageCache();
ConsistencyCheckService.Result result;
try {
result = new ConsistencyCheckService().runFullConsistencyCheck(layout, config, NONE, nullLogProvider(), fs, pageCache, debugContext, layout.databaseDirectory(), DEFAULT, NULL, INSTANCE);
} finally {
pageCache.close();
jobScheduler.close();
}
assertTrue(result.isSuccessful());
assertThat(output.toString()).contains("IndexChecker[entityType:NODE,indexesToCheck:1]").containsPattern("NodeChecker\\[highId:.,indexesToCheck:0\\]");
}
use of org.neo4j.kernel.impl.pagecache.ConfiguringPageCacheFactory in project neo4j by neo4j.
the class ConsistencyCheckService method runFullConsistencyCheck.
public Result runFullConsistencyCheck(DatabaseLayout databaseLayout, Config config, ProgressMonitorFactory progressFactory, LogProvider logProvider, FileSystemAbstraction fileSystem, boolean verbose, Path reportDir, ConsistencyFlags consistencyFlags) throws ConsistencyCheckIncompleteException {
Log log = logProvider.getLog(getClass());
JobScheduler jobScheduler = JobSchedulerFactory.createInitialisedScheduler();
var pageCacheTracer = PageCacheTracer.NULL;
var memoryTracker = EmptyMemoryTracker.INSTANCE;
ConfiguringPageCacheFactory pageCacheFactory = new ConfiguringPageCacheFactory(fileSystem, config, pageCacheTracer, logProvider.getLog(PageCache.class), jobScheduler, Clocks.nanoClock(), new MemoryPools(config.get(memory_tracking)));
PageCache pageCache = pageCacheFactory.getOrCreatePageCache();
try {
return runFullConsistencyCheck(databaseLayout, config, progressFactory, logProvider, fileSystem, pageCache, verbose, reportDir, consistencyFlags, pageCacheTracer, memoryTracker);
} finally {
try {
pageCache.close();
} catch (Exception e) {
log.error("Failure during shutdown of the page cache", e);
}
try {
jobScheduler.close();
} catch (Exception e) {
log.error("Failure during shutdown of the job scheduler", e);
}
}
}
Aggregations