class GraphComputeServiceImpl implements GraphComputeService {

    @Override
    public GraphComputeResponse computeGraph(JsonNode queryDSL) throws MetaDataException {

        Integer tenant = VitamThreadUtils.getVitamSession().getTenantId();
        AtomicBoolean lock = lockers.get(tenant);
        boolean tryBuildGraph = lock.compareAndSet(false, true);

        if (!tryBuildGraph) {
            throw new MetaDataException("Compute graph process already in progress");
        }
        try {

            GraphComputeResponse response = new GraphComputeResponse();

            ScrollSpliterator<Set<String>> scroll = executeQuery(queryDSL);


            StreamSupport.stream(scroll, false).forEach(
                item -> {
                    GraphComputeResponse stats = computeGraph(MetadataCollections.UNIT, item, true, false);
                    response.increment(stats);
                });
            return response;
        } finally {
            lock.set(false);
        }

    }

    private  GraphComputeServiceImpl(
        VitamRepositoryProvider vitamRepositoryProvider,
        MetaDataImpl metaData,
        VitamCache<String, Document> cache,
        List<Integer> tenants);

}