use of org.neo4j.consistency.checking.CheckDecorator in project neo4j by neo4j.
the class FullCheck method execute.
ConsistencySummaryStatistics execute(DirectStoreAccess stores, Log log, Monitor reportMonitor) throws ConsistencyCheckIncompleteException {
ConsistencySummaryStatistics summary = new ConsistencySummaryStatistics();
InconsistencyReport report = new InconsistencyReport(new InconsistencyMessageLogger(log), summary);
OwnerCheck ownerCheck = new OwnerCheck(checkPropertyOwners);
CountsBuilderDecorator countsBuilder = new CountsBuilderDecorator(stores.nativeStores());
CheckDecorator decorator = new CheckDecorator.ChainCheckDecorator(ownerCheck, countsBuilder);
CacheAccess cacheAccess = new DefaultCacheAccess(statistics.getCounts(), threads);
RecordAccess records = recordAccess(stores.nativeStores(), cacheAccess);
execute(stores, decorator, records, report, cacheAccess, reportMonitor);
ownerCheck.scanForOrphanChains(progressFactory);
if (checkGraph) {
CountsAccessor countsAccessor = stores.nativeStores().getCounts();
if (countsAccessor instanceof CountsTracker) {
CountsTracker tracker = (CountsTracker) countsAccessor;
try {
tracker.start();
} catch (Exception e) {
// let's hope it was already started :)
}
}
countsBuilder.checkCounts(countsAccessor, new ConsistencyReporter(records, report), progressFactory);
}
if (!summary.isConsistent()) {
log.warn("Inconsistencies found: " + summary);
}
return summary;
}
Aggregations