public class IntermediateLongCacheStream extends Object implements LongCacheStream
LongStream.BuilderBaseCacheStream.SegmentCompletionListener| Constructor and Description |
|---|
IntermediateLongCacheStream(BaseCacheStream remoteStream,
IntermediateType type,
LocalLongCacheStream localLongStream,
org.infinispan.stream.impl.IntermediateCacheStreamSupplier supplier) |
IntermediateLongCacheStream(DistributedLongCacheStream remoteStream) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
allMatch(LongPredicate predicate) |
boolean |
anyMatch(LongPredicate predicate) |
DoubleCacheStream |
asDoubleStream() |
OptionalDouble |
average() |
CacheStream<Long> |
boxed() |
void |
close() |
<R> R |
collect(Supplier<R> supplier,
ObjLongConsumer<R> accumulator,
BiConsumer<R,R> combiner) |
long |
count() |
LongCacheStream |
disableRehashAware()
Disables tracking of rehash events that could occur to the underlying cache.
|
LongCacheStream |
distinct() |
LongCacheStream |
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.
|
LongCacheStream |
filter(LongPredicate predicate) |
LongCacheStream |
filterKeys(Set<?> keys)
Filters which entries are returned by only returning ones that map to the given key.
|
LongCacheStream |
filterKeySegments(IntSet segments)
Filters which entries are returned by what segment they are present in.
|
LongCacheStream |
filterKeySegments(Set<Integer> segments)
Filters which entries are returned by what segment they are present in.
|
OptionalLong |
findAny() |
OptionalLong |
findFirst() |
LongCacheStream |
flatMap(LongFunction<? extends LongStream> mapper) |
void |
forEach(LongConsumer action) |
<K,V> void |
forEach(ObjLongConsumer<Cache<K,V>> action)
Same as
LongStream.forEach(LongConsumer) except that it takes an ObjLongConsumer that
provides access to the underlying Cache that is backing this stream. |
void |
forEachOrdered(LongConsumer action) |
boolean |
isParallel() |
PrimitiveIterator.OfLong |
iterator() |
LongCacheStream |
limit(long maxSize) |
LongCacheStream |
map(LongUnaryOperator mapper) |
DoubleCacheStream |
mapToDouble(LongToDoubleFunction mapper) |
IntCacheStream |
mapToInt(LongToIntFunction mapper) |
<U> CacheStream<U> |
mapToObj(LongFunction<? extends U> mapper) |
OptionalLong |
max() |
OptionalLong |
min() |
boolean |
noneMatch(LongPredicate predicate) |
LongCacheStream |
onClose(Runnable closeHandler) |
LongCacheStream |
parallel() |
LongCacheStream |
parallelDistribution()
This would enable sending requests to all other remote nodes when a terminal operator is performed.
|
LongCacheStream |
peek(LongConsumer action) |
OptionalLong |
reduce(LongBinaryOperator op) |
long |
reduce(long identity,
LongBinaryOperator op) |
LongCacheStream |
segmentCompletionListener(BaseCacheStream.SegmentCompletionListener listener)
Allows registration of a segment completion listener that is notified when a segment has completed
processing.
|
LongCacheStream |
sequential() |
LongCacheStream |
sequentialDistribution()
This would disable sending requests to all other remote nodes compared to one at a time.
|
LongCacheStream |
skip(long n) |
LongCacheStream |
sorted() |
Spliterator.OfLong |
spliterator() |
long |
sum() |
LongSummaryStatistics |
summaryStatistics() |
LongCacheStream |
timeout(long timeout,
TimeUnit unit)
Sets a given time to wait for a remote operation to respond by.
|
long[] |
toArray() |
LongCacheStream |
unordered() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitallMatch, anyMatch, collect, filter, flatMap, forEach, forEach, map, mapToDouble, mapToInt, mapToObj, noneMatch, peek, reduce, reducebuilder, concat, empty, generate, iterate, of, of, range, rangeClosedpublic IntermediateLongCacheStream(DistributedLongCacheStream remoteStream)
public IntermediateLongCacheStream(BaseCacheStream remoteStream, IntermediateType type, LocalLongCacheStream localLongStream, org.infinispan.stream.impl.IntermediateCacheStreamSupplier supplier)
public LongCacheStream sequentialDistribution()
LongCacheStreamParallel distribution is enabled by default except for CacheStream.iterator() and
CacheStream.spliterator()
sequentialDistribution in interface BaseCacheStream<Long,LongStream>sequentialDistribution in interface LongCacheStreampublic LongCacheStream parallelDistribution()
BaseCacheStreamParallel distribution is enabled by default except for CacheStream.iterator() and
CacheStream.spliterator()
parallelDistribution in interface BaseCacheStream<Long,LongStream>parallelDistribution in interface LongCacheStreampublic LongCacheStream filterKeySegments(Set<Integer> segments)
LongCacheStreamCacheStream.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<Long,LongStream>filterKeySegments in interface LongCacheStreamsegments - The segments to use for this stream operation. Any segments not in this set will be ignored.public LongCacheStream 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<Long,LongStream>segments - The segments to use for this stream operation. Any segments not in this set will be ignored.public LongCacheStream filterKeys(Set<?> keys)
LongCacheStreamCacheStream.filter(Predicate) if the filter is holding references to the same
keys.filterKeys in interface BaseCacheStream<Long,LongStream>filterKeys in interface LongCacheStreamkeys - The keys that this stream will only operate on.public LongCacheStream distributedBatchSize(int batchSize)
LongCacheStreamCacheStream.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<Long,LongStream>distributedBatchSize in interface LongCacheStreambatchSize - The size of each batch. This defaults to the state transfer chunk size.public LongCacheStream segmentCompletionListener(BaseCacheStream.SegmentCompletionListener listener)
LongCacheStreamThis 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<Long,LongStream>segmentCompletionListener in interface LongCacheStreamlistener - The listener that will be called back as segments are completed.public LongCacheStream disableRehashAware()
LongCacheStreamMost 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<Long,LongStream>disableRehashAware in interface LongCacheStreampublic LongCacheStream timeout(long timeout, TimeUnit unit)
LongCacheStreamIf 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<Long,LongStream>timeout in interface LongCacheStreamtimeout - the maximum time to waitunit - the time unit of the timeout argumentpublic boolean isParallel()
isParallel in interface BaseStream<Long,LongStream>public LongCacheStream sorted()
LongCacheStreamsorted in interface LongStreamsorted in interface LongCacheStreampublic LongCacheStream limit(long maxSize)
LongCacheStreamlimit in interface LongStreamlimit in interface LongCacheStreampublic LongCacheStream skip(long n)
LongCacheStreamskip in interface LongStreamskip in interface LongCacheStreampublic LongCacheStream peek(LongConsumer action)
LongCacheStreampeek in interface LongStreampeek in interface LongCacheStreampublic LongCacheStream distinct()
LongCacheStreamdistinct in interface LongStreamdistinct in interface LongCacheStreampublic LongCacheStream filter(LongPredicate predicate)
LongCacheStreamfilter in interface LongStreamfilter in interface LongCacheStreampublic LongCacheStream map(LongUnaryOperator mapper)
LongCacheStreammap in interface LongStreammap in interface LongCacheStreampublic <U> CacheStream<U> mapToObj(LongFunction<? extends U> mapper)
LongCacheStreammapToObj in interface LongStreammapToObj in interface LongCacheStreampublic IntCacheStream mapToInt(LongToIntFunction mapper)
LongCacheStreammapToInt in interface LongStreammapToInt in interface LongCacheStreampublic DoubleCacheStream mapToDouble(LongToDoubleFunction mapper)
LongCacheStreammapToDouble in interface LongStreammapToDouble in interface LongCacheStreampublic LongCacheStream flatMap(LongFunction<? extends LongStream> mapper)
LongCacheStreamflatMap in interface LongStreamflatMap in interface LongCacheStreampublic LongCacheStream parallel()
LongCacheStreamparallel in interface BaseStream<Long,LongStream>parallel in interface LongStreamparallel in interface LongCacheStreampublic PrimitiveIterator.OfLong iterator()
iterator in interface BaseStream<Long,LongStream>iterator in interface LongStreampublic Spliterator.OfLong spliterator()
spliterator in interface BaseStream<Long,LongStream>spliterator in interface LongStreampublic LongCacheStream sequential()
LongCacheStreamsequential in interface BaseStream<Long,LongStream>sequential in interface LongStreamsequential in interface LongCacheStreampublic LongCacheStream unordered()
LongCacheStreamunordered in interface BaseStream<Long,LongStream>unordered in interface LongCacheStreampublic void forEach(LongConsumer action)
forEach in interface LongStreampublic <K,V> void forEach(ObjLongConsumer<Cache<K,V>> action)
LongCacheStreamLongStream.forEach(LongConsumer) except that it takes an ObjLongConsumer 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 LongCacheStreamK - key type of the cacheV - value type of the cacheaction - consumer to be ran for each element in the streampublic void forEachOrdered(LongConsumer action)
forEachOrdered in interface LongStreampublic long[] toArray()
toArray in interface LongStreampublic long reduce(long identity,
LongBinaryOperator op)
reduce in interface LongStreampublic OptionalLong reduce(LongBinaryOperator op)
reduce in interface LongStreampublic <R> R collect(Supplier<R> supplier, ObjLongConsumer<R> accumulator, BiConsumer<R,R> combiner)
collect in interface LongStreampublic long sum()
sum in interface LongStreampublic OptionalLong min()
min in interface LongStreampublic OptionalLong max()
max in interface LongStreampublic long count()
count in interface LongStreampublic OptionalDouble average()
average in interface LongStreampublic LongSummaryStatistics summaryStatistics()
summaryStatistics in interface LongStreampublic boolean anyMatch(LongPredicate predicate)
anyMatch in interface LongStreampublic boolean allMatch(LongPredicate predicate)
allMatch in interface LongStreampublic boolean noneMatch(LongPredicate predicate)
noneMatch in interface LongStreampublic OptionalLong findFirst()
findFirst in interface LongStreampublic OptionalLong findAny()
findAny in interface LongStreampublic CacheStream<Long> boxed()
LongCacheStreamboxed in interface LongStreamboxed in interface LongCacheStreampublic DoubleCacheStream asDoubleStream()
LongCacheStreamasDoubleStream in interface LongStreamasDoubleStream in interface LongCacheStreampublic LongCacheStream onClose(Runnable closeHandler)
LongCacheStreamonClose in interface BaseStream<Long,LongStream>onClose in interface LongCacheStreampublic void close()
close in interface AutoCloseableclose in interface BaseStream<Long,LongStream>Copyright © 2021 JBoss by Red Hat. All rights reserved.