public class IntermediateIntCacheStream extends Object implements IntCacheStream
IntStream.BuilderBaseCacheStream.SegmentCompletionListener| Constructor and Description |
|---|
IntermediateIntCacheStream(BaseCacheStream remoteStream,
IntermediateType type,
LocalIntCacheStream localIntStream,
org.infinispan.stream.impl.IntermediateCacheStreamSupplier supplier) |
IntermediateIntCacheStream(DistributedIntCacheStream remoteStream) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
allMatch(IntPredicate predicate) |
boolean |
anyMatch(IntPredicate predicate) |
DoubleCacheStream |
asDoubleStream() |
LongCacheStream |
asLongStream() |
OptionalDouble |
average() |
CacheStream<Integer> |
boxed() |
void |
close() |
<R> R |
collect(Supplier<R> supplier,
ObjIntConsumer<R> accumulator,
BiConsumer<R,R> combiner) |
long |
count() |
IntCacheStream |
disableRehashAware()
Disables tracking of rehash events that could occur to the underlying cache.
|
IntCacheStream |
distinct() |
IntCacheStream |
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.
|
IntCacheStream |
filter(IntPredicate predicate) |
IntCacheStream |
filterKeys(Set<?> keys)
Filters which entries are returned by only returning ones that map to the given key.
|
IntCacheStream |
filterKeySegments(IntSet segments)
Filters which entries are returned by what segment they are present in.
|
IntCacheStream |
filterKeySegments(Set<Integer> segments)
Filters which entries are returned by what segment they are present in.
|
OptionalInt |
findAny() |
OptionalInt |
findFirst() |
IntCacheStream |
flatMap(IntFunction<? extends IntStream> mapper) |
void |
forEach(IntConsumer action) |
<K,V> void |
forEach(ObjIntConsumer<Cache<K,V>> action)
Same as
IntStream.forEach(IntConsumer) except that it takes an ObjIntConsumer that
provides access to the underlying Cache that is backing this stream. |
void |
forEachOrdered(IntConsumer action) |
boolean |
isParallel() |
PrimitiveIterator.OfInt |
iterator() |
IntCacheStream |
limit(long maxSize) |
IntCacheStream |
map(IntUnaryOperator mapper) |
DoubleCacheStream |
mapToDouble(IntToDoubleFunction mapper) |
LongCacheStream |
mapToLong(IntToLongFunction mapper) |
<U> CacheStream<U> |
mapToObj(IntFunction<? extends U> mapper) |
OptionalInt |
max() |
OptionalInt |
min() |
boolean |
noneMatch(IntPredicate predicate) |
IntCacheStream |
onClose(Runnable closeHandler) |
IntCacheStream |
parallel() |
IntCacheStream |
parallelDistribution()
This would enable sending requests to all other remote nodes when a terminal operator is performed.
|
IntCacheStream |
peek(IntConsumer action) |
OptionalInt |
reduce(IntBinaryOperator op) |
int |
reduce(int identity,
IntBinaryOperator op) |
IntCacheStream |
segmentCompletionListener(BaseCacheStream.SegmentCompletionListener listener)
Allows registration of a segment completion listener that is notified when a segment has completed
processing.
|
IntCacheStream |
sequential() |
IntCacheStream |
sequentialDistribution()
This would disable sending requests to all other remote nodes compared to one at a time.
|
IntCacheStream |
skip(long n) |
IntCacheStream |
sorted() |
Spliterator.OfInt |
spliterator() |
int |
sum() |
IntSummaryStatistics |
summaryStatistics() |
IntCacheStream |
timeout(long timeout,
TimeUnit unit)
Sets a given time to wait for a remote operation to respond by.
|
int[] |
toArray() |
IntCacheStream |
unordered() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitpublic IntermediateIntCacheStream(DistributedIntCacheStream remoteStream)
public IntermediateIntCacheStream(BaseCacheStream remoteStream, IntermediateType type, LocalIntCacheStream localIntStream, org.infinispan.stream.impl.IntermediateCacheStreamSupplier supplier)
public IntCacheStream sequentialDistribution()
IntCacheStreamParallel distribution is enabled by default except for CacheStream.iterator() and
CacheStream.spliterator()
sequentialDistribution in interface BaseCacheStream<Integer,IntStream>sequentialDistribution in interface IntCacheStreampublic IntCacheStream parallelDistribution()
BaseCacheStreamParallel distribution is enabled by default except for CacheStream.iterator() and
CacheStream.spliterator()
parallelDistribution in interface BaseCacheStream<Integer,IntStream>parallelDistribution in interface IntCacheStreampublic IntCacheStream filterKeySegments(Set<Integer> segments)
IntCacheStreamCacheStream.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<Integer,IntStream>filterKeySegments in interface IntCacheStreamsegments - The segments to use for this stream operation. Any segments not in this set will be ignored.public IntCacheStream 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<Integer,IntStream>segments - The segments to use for this stream operation. Any segments not in this set will be ignored.public IntCacheStream filterKeys(Set<?> keys)
IntCacheStreamCacheStream.filter(Predicate) if the filter is holding references to the same
keys.filterKeys in interface BaseCacheStream<Integer,IntStream>filterKeys in interface IntCacheStreamkeys - The keys that this stream will only operate on.public IntCacheStream distributedBatchSize(int batchSize)
IntCacheStreamCacheStream.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<Integer,IntStream>distributedBatchSize in interface IntCacheStreambatchSize - The size of each batch. This defaults to the state transfer chunk size.public IntCacheStream segmentCompletionListener(BaseCacheStream.SegmentCompletionListener listener)
IntCacheStreamThis 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<Integer,IntStream>segmentCompletionListener in interface IntCacheStreamlistener - The listener that will be called back as segments are completed.public IntCacheStream disableRehashAware()
IntCacheStreamMost 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<Integer,IntStream>disableRehashAware in interface IntCacheStreampublic IntCacheStream timeout(long timeout, TimeUnit unit)
IntCacheStreamIf 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<Integer,IntStream>timeout in interface IntCacheStreamtimeout - the maximum time to waitunit - the time unit of the timeout argumentpublic boolean isParallel()
isParallel in interface BaseStream<Integer,IntStream>public IntCacheStream sorted()
IntCacheStreamsorted in interface IntStreamsorted in interface IntCacheStreampublic IntCacheStream limit(long maxSize)
IntCacheStreamlimit in interface IntStreamlimit in interface IntCacheStreampublic IntCacheStream skip(long n)
IntCacheStreamskip in interface IntStreamskip in interface IntCacheStreampublic IntCacheStream peek(IntConsumer action)
IntCacheStreampeek in interface IntStreampeek in interface IntCacheStreampublic IntCacheStream distinct()
IntCacheStreamdistinct in interface IntStreamdistinct in interface IntCacheStreampublic IntCacheStream filter(IntPredicate predicate)
IntCacheStreamfilter in interface IntStreamfilter in interface IntCacheStreampublic IntCacheStream map(IntUnaryOperator mapper)
IntCacheStreammap in interface IntStreammap in interface IntCacheStreampublic <U> CacheStream<U> mapToObj(IntFunction<? extends U> mapper)
IntCacheStreammapToObj in interface IntStreammapToObj in interface IntCacheStreampublic LongCacheStream mapToLong(IntToLongFunction mapper)
IntCacheStreammapToLong in interface IntStreammapToLong in interface IntCacheStreampublic DoubleCacheStream mapToDouble(IntToDoubleFunction mapper)
IntCacheStreammapToDouble in interface IntStreammapToDouble in interface IntCacheStreampublic IntCacheStream flatMap(IntFunction<? extends IntStream> mapper)
IntCacheStreamflatMap in interface IntStreamflatMap in interface IntCacheStreampublic IntCacheStream parallel()
IntCacheStreamparallel in interface BaseStream<Integer,IntStream>parallel in interface IntStreamparallel in interface IntCacheStreampublic PrimitiveIterator.OfInt iterator()
public Spliterator.OfInt spliterator()
spliterator in interface BaseStream<Integer,IntStream>spliterator in interface IntStreampublic IntCacheStream sequential()
IntCacheStreamsequential in interface BaseStream<Integer,IntStream>sequential in interface IntStreamsequential in interface IntCacheStreampublic IntCacheStream unordered()
IntCacheStreamunordered in interface BaseStream<Integer,IntStream>unordered in interface IntCacheStreampublic void forEach(IntConsumer action)
public <K,V> void forEach(ObjIntConsumer<Cache<K,V>> action)
IntCacheStreamIntStream.forEach(IntConsumer) except that it takes an ObjIntConsumer 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 IntCacheStreamK - key type of the cacheV - value type of the cacheaction - consumer to be ran for each element in the streampublic void forEachOrdered(IntConsumer action)
forEachOrdered in interface IntStreampublic int reduce(int identity,
IntBinaryOperator op)
public OptionalInt reduce(IntBinaryOperator op)
public <R> R collect(Supplier<R> supplier, ObjIntConsumer<R> accumulator, BiConsumer<R,R> combiner)
public OptionalInt min()
public OptionalInt max()
public OptionalDouble average()
public IntSummaryStatistics summaryStatistics()
summaryStatistics in interface IntStreampublic boolean anyMatch(IntPredicate predicate)
public boolean allMatch(IntPredicate predicate)
public boolean noneMatch(IntPredicate predicate)
public OptionalInt findFirst()
public OptionalInt findAny()
public CacheStream<Integer> boxed()
IntCacheStreamboxed in interface IntStreamboxed in interface IntCacheStreampublic DoubleCacheStream asDoubleStream()
IntCacheStreamasDoubleStream in interface IntStreamasDoubleStream in interface IntCacheStreampublic LongCacheStream asLongStream()
IntCacheStreamasLongStream in interface IntStreamasLongStream in interface IntCacheStreampublic IntCacheStream onClose(Runnable closeHandler)
IntCacheStreamonClose in interface BaseStream<Integer,IntStream>onClose in interface IntCacheStreampublic void close()
close in interface AutoCloseableclose in interface BaseStream<Integer,IntStream>Copyright © 2022 JBoss by Red Hat. All rights reserved.