public class IntermediateDoubleCacheStream extends Object implements DoubleCacheStream
DoubleStream.BuilderBaseCacheStream.SegmentCompletionListener| Constructor and Description |
|---|
IntermediateDoubleCacheStream(BaseCacheStream remoteStream,
IntermediateType type,
LocalDoubleCacheStream localDoubleStream,
org.infinispan.stream.impl.IntermediateCacheStreamSupplier supplier) |
IntermediateDoubleCacheStream(DistributedDoubleCacheStream remoteStream) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
allMatch(DoublePredicate predicate) |
boolean |
anyMatch(DoublePredicate predicate) |
OptionalDouble |
average() |
CacheStream<Double> |
boxed() |
void |
close() |
<R> R |
collect(Supplier<R> supplier,
ObjDoubleConsumer<R> accumulator,
BiConsumer<R,R> combiner) |
long |
count() |
DoubleCacheStream |
disableRehashAware()
Disables tracking of rehash events that could occur to the underlying cache.
|
DoubleCacheStream |
distinct() |
DoubleCacheStream |
distributedBatchSize(int batchSize)
Controls how many keys are returned from a remote node when using a stream terminal operation with a distributed
cache to back this stream.
|
DoubleCacheStream |
filter(DoublePredicate predicate) |
DoubleCacheStream |
filterKeys(Set<?> keys)
Filters which entries are returned by only returning ones that map to the given key.
|
DoubleCacheStream |
filterKeySegments(IntSet segments)
Filters which entries are returned by what segment they are present in.
|
DoubleCacheStream |
filterKeySegments(Set<Integer> segments)
Filters which entries are returned by what segment they are present in.
|
OptionalDouble |
findAny() |
OptionalDouble |
findFirst() |
DoubleCacheStream |
flatMap(DoubleFunction<? extends DoubleStream> mapper) |
void |
forEach(DoubleConsumer action) |
<K,V> void |
forEach(ObjDoubleConsumer<Cache<K,V>> action)
Same as
DoubleStream.forEach(DoubleConsumer) except that it takes an ObjDoubleConsumer that
provides access to the underlying Cache that is backing this stream. |
void |
forEachOrdered(DoubleConsumer action) |
boolean |
isParallel() |
PrimitiveIterator.OfDouble |
iterator() |
DoubleCacheStream |
limit(long maxSize) |
DoubleCacheStream |
map(DoubleUnaryOperator mapper) |
IntCacheStream |
mapToInt(DoubleToIntFunction mapper) |
LongCacheStream |
mapToLong(DoubleToLongFunction mapper) |
<U> CacheStream<U> |
mapToObj(DoubleFunction<? extends U> mapper) |
OptionalDouble |
max() |
OptionalDouble |
min() |
boolean |
noneMatch(DoublePredicate predicate) |
DoubleCacheStream |
onClose(Runnable closeHandler) |
DoubleCacheStream |
parallel() |
DoubleCacheStream |
parallelDistribution()
This would enable sending requests to all other remote nodes when a terminal operator is performed.
|
DoubleCacheStream |
peek(DoubleConsumer action) |
OptionalDouble |
reduce(DoubleBinaryOperator op) |
double |
reduce(double identity,
DoubleBinaryOperator op) |
DoubleCacheStream |
segmentCompletionListener(BaseCacheStream.SegmentCompletionListener listener)
Allows registration of a segment completion listener that is notified when a segment has completed
processing.
|
DoubleCacheStream |
sequential() |
DoubleCacheStream |
sequentialDistribution()
This would disable sending requests to all other remote nodes compared to one at a time.
|
DoubleCacheStream |
skip(long n) |
DoubleCacheStream |
sorted() |
Spliterator.OfDouble |
spliterator() |
double |
sum() |
DoubleSummaryStatistics |
summaryStatistics() |
DoubleCacheStream |
timeout(long timeout,
TimeUnit unit)
Sets a given time to wait for a remote operation to respond by.
|
double[] |
toArray() |
DoubleCacheStream |
unordered() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitpublic IntermediateDoubleCacheStream(DistributedDoubleCacheStream remoteStream)
public IntermediateDoubleCacheStream(BaseCacheStream remoteStream, IntermediateType type, LocalDoubleCacheStream localDoubleStream, org.infinispan.stream.impl.IntermediateCacheStreamSupplier supplier)
public DoubleCacheStream sequentialDistribution()
DoubleCacheStreamParallel distribution is enabled by default except for CacheStream.iterator() and
CacheStream.spliterator()
sequentialDistribution in interface BaseCacheStream<Double,DoubleStream>sequentialDistribution in interface DoubleCacheStreampublic DoubleCacheStream parallelDistribution()
BaseCacheStreamParallel distribution is enabled by default except for CacheStream.iterator() and
CacheStream.spliterator()
parallelDistribution in interface BaseCacheStream<Double,DoubleStream>parallelDistribution in interface DoubleCacheStreampublic DoubleCacheStream filterKeySegments(Set<Integer> segments)
DoubleCacheStreamCacheStream.filter(Predicate) method as this can control what nodes are
asked for data and what entries are read from the underlying CacheStore if present.filterKeySegments in interface BaseCacheStream<Double,DoubleStream>filterKeySegments in interface DoubleCacheStreamsegments - The segments to use for this stream operation. Any segments not in this set will be ignored.public DoubleCacheStream filterKeySegments(IntSet segments)
BaseCacheStreamCacheStream.filter(Predicate) method as this can control what nodes are
asked for data and what entries are read from the underlying CacheStore if present.filterKeySegments in interface BaseCacheStream<Double,DoubleStream>segments - The segments to use for this stream operation. Any segments not in this set will be ignored.public DoubleCacheStream filterKeys(Set<?> keys)
DoubleCacheStreamCacheStream.filter(Predicate) if the filter is holding references to the same
keys.filterKeys in interface BaseCacheStream<Double,DoubleStream>filterKeys in interface DoubleCacheStreamkeys - The keys that this stream will only operate on.public DoubleCacheStream distributedBatchSize(int batchSize)
DoubleCacheStreamCacheStream.iterator(), CacheStream.spliterator(),
CacheStream.forEach(Consumer). Please see those methods for additional information on how this value
may affect them.
This value may be used in the case of a a terminal operator that doesn't track keys if an intermediate
operation is performed that requires bringing keys locally to do computations. Examples of such intermediate
operations are CacheStream.sorted(), CacheStream.sorted(Comparator),
CacheStream.distinct(), CacheStream.limit(long), CacheStream.skip(long)
This value is always ignored when this stream is backed by a cache that is not distributed as all values are already local.
distributedBatchSize in interface BaseCacheStream<Double,DoubleStream>distributedBatchSize in interface DoubleCacheStreambatchSize - The size of each batch. This defaults to the state transfer chunk size.public DoubleCacheStream segmentCompletionListener(BaseCacheStream.SegmentCompletionListener listener)
DoubleCacheStreamThis method is designed for the sole purpose of use with the CacheStream.iterator() to allow for
a user to track completion of segments as they are returned from the iterator. Behavior of other methods
is not specified. Please see CacheStream.iterator() for more information.
Multiple listeners may be registered upon multiple invocations of this method. The ordering of notified listeners is not specified.
This is only used if this stream did not invoke BaseCacheStream.disableRehashAware() and has no
flat map based operations. If this is done no segments will be notified.
segmentCompletionListener in interface BaseCacheStream<Double,DoubleStream>segmentCompletionListener in interface DoubleCacheStreamlistener - The listener that will be called back as segments are completed.public DoubleCacheStream disableRehashAware()
DoubleCacheStreamMost terminal operations will run faster with rehash awareness disabled even without a rehash occuring. However if a rehash occurs with this disabled be prepared to possibly receive only a subset of values.
disableRehashAware in interface BaseCacheStream<Double,DoubleStream>disableRehashAware in interface DoubleCacheStreampublic DoubleCacheStream timeout(long timeout, TimeUnit unit)
DoubleCacheStreamIf a timeout does occur then a TimeoutException is thrown from the terminal
operation invoking thread or on the next call to the Iterator or Spliterator.
Note that if a rehash occurs this timeout value is reset for the subsequent retry if rehash aware is enabled.
timeout in interface BaseCacheStream<Double,DoubleStream>timeout in interface DoubleCacheStreamtimeout - the maximum time to waitunit - the time unit of the timeout argumentpublic boolean isParallel()
isParallel in interface BaseStream<Double,DoubleStream>public DoubleCacheStream sorted()
DoubleCacheStreamsorted in interface DoubleStreamsorted in interface DoubleCacheStreampublic DoubleCacheStream limit(long maxSize)
DoubleCacheStreamlimit in interface DoubleStreamlimit in interface DoubleCacheStreampublic DoubleCacheStream skip(long n)
DoubleCacheStreamskip in interface DoubleStreamskip in interface DoubleCacheStreampublic DoubleCacheStream peek(DoubleConsumer action)
DoubleCacheStreampeek in interface DoubleStreampeek in interface DoubleCacheStreampublic DoubleCacheStream distinct()
DoubleCacheStreamdistinct in interface DoubleStreamdistinct in interface DoubleCacheStreampublic DoubleCacheStream filter(DoublePredicate predicate)
DoubleCacheStreamfilter in interface DoubleStreamfilter in interface DoubleCacheStreampublic DoubleCacheStream map(DoubleUnaryOperator mapper)
DoubleCacheStreammap in interface DoubleStreammap in interface DoubleCacheStreampublic <U> CacheStream<U> mapToObj(DoubleFunction<? extends U> mapper)
DoubleCacheStreammapToObj in interface DoubleStreammapToObj in interface DoubleCacheStreampublic IntCacheStream mapToInt(DoubleToIntFunction mapper)
DoubleCacheStreammapToInt in interface DoubleStreammapToInt in interface DoubleCacheStreampublic LongCacheStream mapToLong(DoubleToLongFunction mapper)
DoubleCacheStreammapToLong in interface DoubleStreammapToLong in interface DoubleCacheStreampublic DoubleCacheStream flatMap(DoubleFunction<? extends DoubleStream> mapper)
DoubleCacheStreamflatMap in interface DoubleStreamflatMap in interface DoubleCacheStreampublic DoubleCacheStream parallel()
DoubleCacheStreamparallel in interface BaseStream<Double,DoubleStream>parallel in interface DoubleStreamparallel in interface DoubleCacheStreampublic PrimitiveIterator.OfDouble iterator()
iterator in interface BaseStream<Double,DoubleStream>iterator in interface DoubleStreampublic Spliterator.OfDouble spliterator()
spliterator in interface BaseStream<Double,DoubleStream>spliterator in interface DoubleStreampublic DoubleCacheStream sequential()
DoubleCacheStreamsequential in interface BaseStream<Double,DoubleStream>sequential in interface DoubleStreamsequential in interface DoubleCacheStreampublic DoubleCacheStream unordered()
DoubleCacheStreamunordered in interface BaseStream<Double,DoubleStream>unordered in interface DoubleCacheStreampublic void forEach(DoubleConsumer action)
forEach in interface DoubleStreampublic <K,V> void forEach(ObjDoubleConsumer<Cache<K,V>> action)
DoubleCacheStreamDoubleStream.forEach(DoubleConsumer) except that it takes an ObjDoubleConsumer that
provides access to the underlying Cache that is backing this stream.
Note that the CacheAware interface is not supported for injection using this method as the cache
is provided in the consumer directly.
forEach in interface DoubleCacheStreamK - key type of the cacheV - value type of the cacheaction - consumer to be ran for each element in the streampublic void forEachOrdered(DoubleConsumer action)
forEachOrdered in interface DoubleStreampublic double[] toArray()
toArray in interface DoubleStreampublic double reduce(double identity,
DoubleBinaryOperator op)
reduce in interface DoubleStreampublic OptionalDouble reduce(DoubleBinaryOperator op)
reduce in interface DoubleStreampublic <R> R collect(Supplier<R> supplier, ObjDoubleConsumer<R> accumulator, BiConsumer<R,R> combiner)
collect in interface DoubleStreampublic double sum()
sum in interface DoubleStreampublic OptionalDouble min()
min in interface DoubleStreampublic OptionalDouble max()
max in interface DoubleStreampublic long count()
count in interface DoubleStreampublic OptionalDouble average()
average in interface DoubleStreampublic DoubleSummaryStatistics summaryStatistics()
summaryStatistics in interface DoubleStreampublic boolean anyMatch(DoublePredicate predicate)
anyMatch in interface DoubleStreampublic boolean allMatch(DoublePredicate predicate)
allMatch in interface DoubleStreampublic boolean noneMatch(DoublePredicate predicate)
noneMatch in interface DoubleStreampublic OptionalDouble findFirst()
findFirst in interface DoubleStreampublic OptionalDouble findAny()
findAny in interface DoubleStreampublic CacheStream<Double> boxed()
DoubleCacheStreamboxed in interface DoubleStreamboxed in interface DoubleCacheStreampublic DoubleCacheStream onClose(Runnable closeHandler)
DoubleCacheStreamonClose in interface BaseStream<Double,DoubleStream>onClose in interface DoubleCacheStreampublic void close()
close in interface AutoCloseableclose in interface BaseStream<Double,DoubleStream>Copyright © 2022 JBoss by Red Hat. All rights reserved.