public FileSpecificLabelSchemas call()

in src/main/java/com/amazonaws/services/neptune/propertygraph/io/ExportPropertyGraphTask.java [66:104]


    public FileSpecificLabelSchemas call() {

        FileSpecificLabelSchemas fileSpecificLabelSchemas = new FileSpecificLabelSchemas();

        CountingHandler handler = new CountingHandler(
                new ExportPGTaskHandler(
                        fileSpecificLabelSchemas,
                        graphElementSchemas,
                        targetConfig,
                        writerFactory,
                        labelWriters,
                        graphClient,
                        status,
                        index,
                        labelsFilter
                ));

        try {
            while (status.allowContinue()) {
                Range range = rangeFactory.nextRange();
                if (range.isEmpty()) {
                    status.halt();
                } else {
                    graphClient.queryForValues(handler, range, labelsFilter, gremlinFilters, graphElementSchemas);
                    if (range.sizeExceeds(handler.numberProcessed()) || rangeFactory.isExhausted()) {
                        status.halt();
                    }
                }
            }
        } finally {
            try {
                handler.close();
            } catch (Exception e) {
                logger.error("Error while closing handler", e);
            }
        }

        return fileSpecificLabelSchemas;
    }