class IngestCleanupEligibilityService {

    public void checkChildUnitsFromOtherIngests(String ingestOperationId, CleanupReportManager cleanupReportManager)
        throws ProcessingStatusException {

        try (MetaDataClient client = metaDataClientFactory.getClient()) {

            SelectMultiQuery query = new SelectMultiQuery();
            query.addUsedProjection(VitamFieldsHelper.id());
            query.addQueries(eq(VitamFieldsHelper.initialOperation(), ingestOperationId));

            ScrollSpliterator<JsonNode> scrollRequest = ScrollSpliteratorHelper
                .createUnitScrollSplitIterator(client, query, VitamConfiguration.getBatchSize());

            try (BufferedConsumer<String> bufferedConsumer = new BufferedConsumer<>(VitamConfiguration.getBatchSize(),
                ids -> checkChildUnitsFromOtherIngests(ingestOperationId, cleanupReportManager, ids))) {

                scrollRequest.forEachRemaining(
                    entry -> bufferedConsumer.appendEntry(entry.get(VitamFieldsHelper.id()).asText()));
            }

        } catch (InvalidParseOperationException | InvalidCreateOperationException e) {
            throw new ProcessingStatusException(StatusCode.FATAL, "Could not checks unit updates", e);
        }
    }

    public  IngestCleanupEligibilityService(MetaDataClientFactory metaDataClientFactory,
        LogbookOperationsClientFactory logbookOperationsClientFactory);

}