Search in sources :

Example 1 with IteratorExecutor

use of org.apache.gobblin.util.executors.IteratorExecutor in project incubator-gobblin by apache.

the class ConfigBasedDatasetsFinder method executeItertorExecutor.

protected void executeItertorExecutor(Iterator<Callable<Void>> callableIterator) throws IOException {
    try {
        IteratorExecutor<Void> executor = new IteratorExecutor<>(callableIterator, this.threadPoolSize, ExecutorsUtils.newDaemonThreadFactory(Optional.of(log), Optional.of(this.getClass().getSimpleName())));
        List<Either<Void, ExecutionException>> results = executor.executeAndGetResults();
        IteratorExecutor.logFailures(results, log, 10);
    } catch (InterruptedException ie) {
        throw new IOException("Dataset finder is interrupted.", ie);
    }
}
Also used : IteratorExecutor(org.apache.gobblin.util.executors.IteratorExecutor) Either(org.apache.gobblin.util.Either) IOException(java.io.IOException)

Aggregations

IOException (java.io.IOException)1 Either (org.apache.gobblin.util.Either)1 IteratorExecutor (org.apache.gobblin.util.executors.IteratorExecutor)1