Package at.jku.ssw.fp.sect08_2
Class ReduceTaskWithLogging<V>
- java.lang.Object
-
- java.util.concurrent.ForkJoinTask<V>
-
- java.util.concurrent.RecursiveTask<V>
-
- at.jku.ssw.fp.sect08_2.ReduceTaskWithLogging<V>
-
- Type Parameters:
V
- the type of values processed
- All Implemented Interfaces:
Serializable
,Future<V>
class ReduceTaskWithLogging<V> extends RecursiveTask<V>
Task for simulating the reduce operation of parallel streams including log information.- Author:
- Herbert Prähofer
-
-
Field Summary
Fields Modifier and Type Field Description (package private) BinaryOperator<V>
accu
(package private) BinaryOperator<V>
comb
(package private) V
identity
(package private) V
result
(package private) Spliterator<V>
spliterator
private static int
THRESHOLD
-
Constructor Summary
Constructors Constructor Description ReduceTaskWithLogging(Spliterator<V> spliterator, V identity, BinaryOperator<V> accu, BinaryOperator<V> comb)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected V
compute()
-
Methods inherited from class java.util.concurrent.RecursiveTask
exec, getRawResult, setRawResult
-
Methods inherited from class java.util.concurrent.ForkJoinTask
adapt, adapt, adapt, cancel, compareAndSetForkJoinTaskTag, complete, completeExceptionally, fork, get, get, getException, getForkJoinTaskTag, getPool, getQueuedTaskCount, getSurplusQueuedTaskCount, helpQuiesce, inForkJoinPool, invoke, invokeAll, invokeAll, invokeAll, isCancelled, isCompletedAbnormally, isCompletedNormally, isDone, join, peekNextLocalTask, pollNextLocalTask, pollSubmission, pollTask, quietlyComplete, quietlyInvoke, quietlyJoin, reinitialize, setForkJoinTaskTag, tryUnfork
-
-
-
-
Field Detail
-
THRESHOLD
private static final int THRESHOLD
- See Also:
- Constant Field Values
-
spliterator
final Spliterator<V> spliterator
-
identity
final V identity
-
accu
final BinaryOperator<V> accu
-
comb
final BinaryOperator<V> comb
-
result
V result
-
-
Constructor Detail
-
ReduceTaskWithLogging
public ReduceTaskWithLogging(Spliterator<V> spliterator, V identity, BinaryOperator<V> accu, BinaryOperator<V> comb)
-
-
Method Detail
-
compute
protected V compute()
- Specified by:
compute
in classRecursiveTask<V>
-
-