/** * Returns the targetSize, initializing it via the supplied * size estimate if not already initialized. */ protected final long getTargetSize(long sizeEstimate) { long s; return ((s = targetSize) != 0 ? s : (targetSize = suggestTargetSize(sizeEstimate))); }
/** * Returns the targetSize, initializing it via the supplied * size estimate if not already initialized. */ protected final long getTargetSize(long sizeEstimate) { long s; return ((s = targetSize) != 0 ? s : (targetSize = suggestTargetSize(sizeEstimate))); }
SizedCollectorTask(Spliterator<P_IN> spliterator, PipelineHelper<P_OUT> helper, int arrayLength) { this.spliterator = spliterator; this.helper = helper; this.targetSize = AbstractTask.suggestTargetSize(spliterator.estimateSize()); this.offset = 0; this.length = arrayLength; }
SizedCollectorTask(Spliterator<P_IN> spliterator, PipelineHelper<P_OUT> helper, int arrayLength) { this.spliterator = spliterator; this.helper = helper; this.targetSize = AbstractTask.suggestTargetSize(spliterator.estimateSize()); this.offset = 0; this.length = arrayLength; }
protected ForEachOrderedTask(PipelineHelper<T> helper, Spliterator<S> spliterator, Sink<T> action) { super(null); this.helper = helper; this.spliterator = spliterator; this.targetSize = AbstractTask.suggestTargetSize(spliterator.estimateSize()); // Size map to avoid concurrent re-sizes this.completionMap = new ConcurrentHashMap<>(Math.max(16, AbstractTask.getLeafTarget() << 1), 0.75f, ForkJoinPool.getCommonPoolParallelism() + 1); this.action = action; this.leftPredecessor = null; }
protected ForEachOrderedTask(PipelineHelper<T> helper, Spliterator<S> spliterator, Sink<T> action) { super(null); this.helper = helper; this.spliterator = spliterator; this.targetSize = AbstractTask.suggestTargetSize(spliterator.estimateSize()); // Size map to avoid concurrent re-sizes this.completionMap = new ConcurrentHashMap<>(Math.max(16, AbstractTask.getLeafTarget() << 1), 0.75f, ForkJoinPool.getCommonPoolParallelism() + 1); this.action = action; this.leftPredecessor = null; }
long sizeEstimate = rightSplit.estimateSize(), sizeThreshold; if ((sizeThreshold = targetSize) == 0L) { targetSize = sizeThreshold = AbstractTask.suggestTargetSize(sizeEstimate);
long sizeEstimate = rightSplit.estimateSize(), sizeThreshold; if ((sizeThreshold = targetSize) == 0L) { targetSize = sizeThreshold = AbstractTask.suggestTargetSize(sizeEstimate);