use of org.openstreetmap.atlas.geography.atlas.items.complex.ComplexEntity in project atlas-checks by osmlab.
the class IntegrityCheckSparkJob method executeChecks.
/**
* Executes all {@link BaseCheck}s on the given {@link Atlas}. Each check runs in a separate
* thread. The checks go over all {@link AtlasEntity}s and {@link Relation}s.
* {@link ComplexEntity}s can be processed by using the appropriate {@link Finder} and adding
* them to the {@link Iterable} of objects.
*
* @param atlas
* the {@link Atlas} on which the checks will be run
* @param checksToRun
* the set of {@link BaseCheck}s to execute
* @param configuration
* {@link MapRouletteConfiguration} to create a new {@link MapRouletteClient}s
*/
@SuppressWarnings("rawtypes")
private static void executeChecks(final String country, final Atlas atlas, final Set<BaseCheck> checksToRun, final MapRouletteConfiguration configuration) {
final Pool checkExecutionPool = new Pool(checksToRun.size(), "Check execution pool", POOL_DURATION_BEFORE_KILL);
checksToRun.stream().filter(check -> check.validCheckForCountry(country)).forEach(check -> checkExecutionPool.queue(new RunnableCheck(country, check, new MultiIterable<>(atlas.items(), atlas.relations(), findComplexEntities(check, atlas)), MapRouletteClient.instance(configuration))));
checkExecutionPool.close();
}
Aggregations