public static <T, BT extends Procedure<? super T>> void forEach( Iterable<T> iterable, ProcedureFactory<BT> procedureFactory, Combiner<BT> combiner, int batchSize, Executor executor) { ParallelIterate.forEach(iterable, procedureFactory, combiner, batchSize, ParallelIterate.calculateTaskCount(iterable, batchSize), executor); }
public static <T> Combiner<T> passThru() { return new PassThruCombiner<>(); } }
/** * Same effect as {@link Iterate#groupBy(Iterable, Function)}, * but executed in parallel batches, and writing output into a SynchronizedPutFastListMultimap. */ public static <K, V, R extends MutableMultimap<K, V>> MutableMultimap<K, V> groupBy( Iterable<V> iterable, Function<? super V, ? extends K> function, R concurrentMultimap, int batchSize) { return ParallelIterate.groupBy(iterable, function, concurrentMultimap, batchSize, ParallelIterate.EXECUTOR_SERVICE); }
public static <T, BT extends Procedure<? super T>> void forEach( Iterable<T> iterable, BT procedure, int minForkSize, int taskCount, Executor executor) { ParallelIterate.forEach( iterable, new PassThruProcedureFactory<>(procedure), new PassThruCombiner<>(), minForkSize, taskCount, executor); }
/** * Returns a brand new ExecutorService using the specified poolName and uses the optional property named * to set the maximum thread pool size. The same poolName may be used more than * once resulting in multiple pools with the same name. */ public static ExecutorService newPooledExecutor(String poolName, boolean useDaemonThreads) { return ParallelIterate.newPooledExecutor(ParallelIterate.getDefaultMaxThreadPoolSize(), poolName, useDaemonThreads); }
public ObjectIntProcedureFJTaskRunner(Combiner<BT> newCombiner, int taskCount) { this(newCombiner, taskCount, ObjectIntProcedureFJTaskRunner.buildQueue(newCombiner, taskCount), ObjectIntProcedureFJTaskRunner.buildCountDownLatch(newCombiner, taskCount)); }
public static <T, BT extends Procedure<? super T>> void forEach( Iterable<T> iterable, ProcedureFactory<BT> procedureFactory, Combiner<BT> combiner) { ParallelIterate.forEach(iterable, procedureFactory, combiner, ParallelIterate.EXECUTOR_SERVICE); }
@Override public SumByBigIntegerProcedure<T, V> create() { return new SumByBigIntegerProcedure<>(this.groupBy, this.function); } }
public static <T, V> Collection<V> flatCollect( Iterable<T> iterable, Function<? super T, Collection<V>> function, boolean allowReorderedResult) { return ParallelIterate.flatCollect(iterable, function, null, allowReorderedResult); }
/** * Same effect as {@link Iterate#count(Iterable, Predicate)}, but executed in parallel batches. * * @return The number of elements which satisfy the predicate. */ public static <T> int count(Iterable<T> iterable, Predicate<? super T> predicate) { return ParallelIterate.count(iterable, predicate, ParallelIterate.DEFAULT_MIN_FORK_SIZE, ParallelIterate.EXECUTOR_SERVICE); }
@Override public SumByLongProcedure<T, V> create() { return new SumByLongProcedure<>(this.groupBy, this.function); } }
@Override public SumByIntProcedure<T, V> create() { return new SumByIntProcedure<>(this.groupBy, this.function); } }
@Override public SumByBigDecimalProcedure<T, V> create() { return new SumByBigDecimalProcedure<>(this.groupBy, this.function); } }
@Override public SumByFloatProcedure<T, V> create() { return new SumByFloatProcedure<>(this.groupBy, this.function); } }
public static <T, BT extends Procedure<? super T>> void forEach( Iterable<T> iterable, BT procedure, int minForkSize, int taskCount, Executor executor) { ParallelIterate.forEach( iterable, new PassThruProcedureFactory<>(procedure), new PassThruCombiner<>(), minForkSize, taskCount, executor); }
/** * Returns a brand new ExecutorService using the specified poolName and uses the optional property named * to set the maximum thread pool size. The same poolName may be used more than * once resulting in multiple pools with the same name. */ public static ExecutorService newPooledExecutor(String poolName, boolean useDaemonThreads) { return ParallelIterate.newPooledExecutor(ParallelIterate.getDefaultMaxThreadPoolSize(), poolName, useDaemonThreads); }
public static <T> Combiner<T> passThru() { return new PassThruCombiner<>(); } }
/** * Same effect as {@link Iterate#groupBy(Iterable, Function)}, * but executed in parallel batches, and writing output into a SynchronizedPutFastListMultimap. */ public static <K, V> MutableMultimap<K, V> groupBy( Iterable<V> iterable, Function<? super V, ? extends K> function, int batchSize) { return ParallelIterate.groupBy(iterable, function, batchSize, ParallelIterate.EXECUTOR_SERVICE); }
@Override public SumByBigIntegerProcedure<T, V> create() { return new SumByBigIntegerProcedure<>(this.groupBy, this.function); } }
/** * Same effect as {@link Iterate#groupBy(Iterable, Function)}, * but executed in parallel batches, and writing output into a SynchronizedPutFastListMultimap. */ public static <K, V, R extends MutableMultimap<K, V>> MutableMultimap<K, V> groupBy( Iterable<V> iterable, Function<? super V, ? extends K> function, R concurrentMultimap) { return ParallelIterate.groupBy(iterable, function, concurrentMultimap, ParallelIterate.DEFAULT_MIN_FORK_SIZE); }