Class StreamExecutorHelper


  • public class StreamExecutorHelper
    extends Object
    • Constructor Detail

      • StreamExecutorHelper

        public StreamExecutorHelper()
    • Method Detail

      • submitAllAndAwaitAggregatingExceptions

        public static <T> Collection<T> submitAllAndAwaitAggregatingExceptions​(List<? extends Callable<T>> tasks,
                                                                               String threadsName)
                                                                        throws IOException
        Takes a list of Callables and executes them returning the results as a list. The method waits for the return of every task even if one of them throws an exception. If any exception happens it will be thrown, wrapped into an IOException, and other following exceptions will be added as `addSuppressed` to the original exception
        Type Parameters:
        T - the response type
        Parameters:
        tasks - the list of callables to be executed
        threadsName - name to be used by the SolrNamedThreadFactory
        Returns:
        results collection
        Throws:
        IOException - in case any exceptions happened