Class IntermediateDoubleCacheStream
- All Implemented Interfaces:
- AutoCloseable,- BaseStream<Double,,- DoubleStream> - DoubleStream,- BaseCacheStream<Double,,- DoubleStream> - DoubleCacheStream
- 
Nested Class SummaryNested classes/interfaces inherited from interface org.infinispan.BaseCacheStreamBaseCacheStream.SegmentCompletionListenerNested classes/interfaces inherited from interface java.util.stream.DoubleStreamDoubleStream.Builder, DoubleStream.DoubleMapMultiConsumer
- 
Constructor SummaryConstructorsConstructorDescriptionIntermediateDoubleCacheStream(BaseCacheStream remoteStream, IntermediateType type, org.infinispan.stream.impl.local.LocalDoubleCacheStream localDoubleStream, org.infinispan.stream.impl.IntermediateCacheStreamSupplier supplier) IntermediateDoubleCacheStream(DistributedDoubleCacheStream remoteStream) 
- 
Method SummaryModifier and TypeMethodDescriptionbooleanallMatch(DoublePredicate predicate) booleananyMatch(DoublePredicate predicate) average()boxed()voidclose()<R> Rcollect(Supplier<R> supplier, ObjDoubleConsumer<R> accumulator, BiConsumer<R, R> combiner) longcount()Disables tracking of rehash events that could occur to the underlying cache.distinct()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.filter(DoublePredicate predicate) filterKeys(Set<?> keys) Filters which entries are returned by only returning ones that map to the given key.filterKeySegments(IntSet segments) Filters which entries are returned by what segment they are present in.findAny()flatMap(DoubleFunction<? extends DoubleStream> mapper) voidforEach(DoubleConsumer action) <K,V> void forEach(ObjDoubleConsumer<Cache<K, V>> action) Same asDoubleStream.forEach(DoubleConsumer)except that it takes anObjDoubleConsumerthat provides access to the underlyingCachethat is backing this stream.voidforEachOrdered(DoubleConsumer action) booleaniterator()limit(long maxSize) map(DoubleUnaryOperator mapper) mapToInt(DoubleToIntFunction mapper) mapToLong(DoubleToLongFunction mapper) <U> CacheStream<U> mapToObj(DoubleFunction<? extends U> mapper) max()min()booleannoneMatch(DoublePredicate predicate) parallel()This would enable sending requests to all other remote nodes when a terminal operator is performed.peek(DoubleConsumer action) doublereduce(double identity, DoubleBinaryOperator op) Allows registration of a segment completion listener that is notified when a segment has completed processing.This would disable sending requests to all other remote nodes compared to one at a time.skip(long n) sorted()doublesum()Sets a given time to wait for a remote operation to respond by.double[]toArray()Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.infinispan.DoubleCacheStreamallMatch, anyMatch, collect, filter, flatMap, forEach, forEach, map, mapToInt, mapToLong, mapToObj, noneMatch, peek, reduce, reduceMethods inherited from interface java.util.stream.DoubleStreamdropWhile, mapMulti, takeWhile
- 
Constructor Details- 
IntermediateDoubleCacheStream
- 
IntermediateDoubleCacheStreampublic IntermediateDoubleCacheStream(BaseCacheStream remoteStream, IntermediateType type, org.infinispan.stream.impl.local.LocalDoubleCacheStream localDoubleStream, org.infinispan.stream.impl.IntermediateCacheStreamSupplier supplier) 
 
- 
- 
Method Details- 
sequentialDistributionDescription copied from interface:DoubleCacheStreamThis would disable sending requests to all other remote nodes compared to one at a time. This can reduce memory pressure on the originator node at the cost of performance.Parallel distribution is enabled by default except for CacheStream.iterator()andCacheStream.spliterator()- Specified by:
- sequentialDistributionin interface- BaseCacheStream<Double,- DoubleStream> 
- Specified by:
- sequentialDistributionin interface- DoubleCacheStream
- Returns:
- a stream with parallel distribution disabled.
 
- 
parallelDistributionDescription copied from interface:BaseCacheStreamThis would enable sending requests to all other remote nodes when a terminal operator is performed. This requires additional overhead as it must process results concurrently from various nodes, but should perform faster in the majority of cases.Parallel distribution is enabled by default except for CacheStream.iterator()andCacheStream.spliterator()- Specified by:
- parallelDistributionin interface- BaseCacheStream<Double,- DoubleStream> 
- Specified by:
- parallelDistributionin interface- DoubleCacheStream
- Returns:
- a stream with parallel distribution enabled.
 
- 
filterKeySegmentsDescription copied from interface:BaseCacheStreamFilters which entries are returned by what segment they are present in. This method can be substantially more efficient than using a regularCacheStream.filter(Predicate)method as this can control what nodes are asked for data and what entries are read from the underlying CacheStore if present.- Specified by:
- filterKeySegmentsin interface- BaseCacheStream<Double,- DoubleStream> 
- Parameters:
- segments- The segments to use for this stream operation. Any segments not in this set will be ignored.
- Returns:
- a stream with the segments filtered.
 
- 
filterKeysDescription copied from interface:DoubleCacheStreamFilters which entries are returned by only returning ones that map to the given key. This method will be faster than a regularCacheStream.filter(Predicate)if the filter is holding references to the same keys.- Specified by:
- filterKeysin interface- BaseCacheStream<Double,- DoubleStream> 
- Specified by:
- filterKeysin interface- DoubleCacheStream
- Parameters:
- keys- The keys that this stream will only operate on.
- Returns:
- a stream with the keys filtered.
 
- 
distributedBatchSizeDescription copied from interface:DoubleCacheStreamControls how many keys are returned from a remote node when using a stream terminal operation with a distributed cache to back this stream. This value is ignored when terminal operators that don't track keys are used. Key tracking terminal operators areCacheStream.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. - Specified by:
- distributedBatchSizein interface- BaseCacheStream<Double,- DoubleStream> 
- Specified by:
- distributedBatchSizein interface- DoubleCacheStream
- Parameters:
- batchSize- The size of each batch. This defaults to the state transfer chunk size.
- Returns:
- a stream with the batch size updated
 
- 
segmentCompletionListenerpublic DoubleCacheStream segmentCompletionListener(BaseCacheStream.SegmentCompletionListener listener) Description copied from interface:DoubleCacheStreamAllows registration of a segment completion listener that is notified when a segment has completed processing. If the terminal operator has a short circuit this listener may never be called.This 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 seeCacheStream.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.- Specified by:
- segmentCompletionListenerin interface- BaseCacheStream<Double,- DoubleStream> 
- Specified by:
- segmentCompletionListenerin interface- DoubleCacheStream
- Parameters:
- listener- The listener that will be called back as segments are completed.
- Returns:
- a stream with the listener registered.
 
- 
disableRehashAwareDescription copied from interface:DoubleCacheStreamDisables tracking of rehash events that could occur to the underlying cache. If a rehash event occurs while a terminal operation is being performed it is possible for some values that are in the cache to not be found. Note that you will never have an entry duplicated when rehash awareness is disabled, only lost values.Most 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. - Specified by:
- disableRehashAwarein interface- BaseCacheStream<Double,- DoubleStream> 
- Specified by:
- disableRehashAwarein interface- DoubleCacheStream
- Returns:
- a stream with rehash awareness disabled.
 
- 
timeoutDescription copied from interface:DoubleCacheStreamSets a given time to wait for a remote operation to respond by. This timeout does nothing if the terminal operation does not go remote.If a timeout does occur then a TimeoutExceptionis thrown from the terminal operation invoking thread or on the next call to theIteratororSpliterator.Note that if a rehash occurs this timeout value is reset for the subsequent retry if rehash aware is enabled. - Specified by:
- timeoutin interface- BaseCacheStream<Double,- DoubleStream> 
- Specified by:
- timeoutin interface- DoubleCacheStream
- Parameters:
- timeout- the maximum time to wait
- unit- the time unit of the timeout argument
- Returns:
- a stream with the timeout set
 
- 
isParallelpublic boolean isParallel()- Specified by:
- isParallelin interface- BaseStream<Double,- DoubleStream> 
 
- 
sortedDescription copied from interface:DoubleCacheStream- Specified by:
- sortedin interface- DoubleCacheStream
- Specified by:
- sortedin interface- DoubleStream
- Returns:
- the new cache double stream
 
- 
limitDescription copied from interface:DoubleCacheStream- Specified by:
- limitin interface- DoubleCacheStream
- Specified by:
- limitin interface- DoubleStream
- Returns:
- the new cache double stream
 
- 
skipDescription copied from interface:DoubleCacheStream- Specified by:
- skipin interface- DoubleCacheStream
- Specified by:
- skipin interface- DoubleStream
- Returns:
- the new cache double stream
 
- 
peekDescription copied from interface:DoubleCacheStream- Specified by:
- peekin interface- DoubleCacheStream
- Specified by:
- peekin interface- DoubleStream
- Returns:
- the new cache double stream
 
- 
distinctDescription copied from interface:DoubleCacheStream- Specified by:
- distinctin interface- DoubleCacheStream
- Specified by:
- distinctin interface- DoubleStream
- Returns:
- the new cache double stream
 
- 
filterDescription copied from interface:DoubleCacheStream- Specified by:
- filterin interface- DoubleCacheStream
- Specified by:
- filterin interface- DoubleStream
- Returns:
- the new cache double stream
 
- 
mapDescription copied from interface:DoubleCacheStream- Specified by:
- mapin interface- DoubleCacheStream
- Specified by:
- mapin interface- DoubleStream
- Returns:
- the new cache double stream
 
- 
mapToObjDescription copied from interface:DoubleCacheStream- Specified by:
- mapToObjin interface- DoubleCacheStream
- Specified by:
- mapToObjin interface- DoubleStream
- Returns:
- the new cache stream
 
- 
mapToIntDescription copied from interface:DoubleCacheStream- Specified by:
- mapToIntin interface- DoubleCacheStream
- Specified by:
- mapToIntin interface- DoubleStream
- Returns:
- the new cache int stream
 
- 
mapToLongDescription copied from interface:DoubleCacheStream- Specified by:
- mapToLongin interface- DoubleCacheStream
- Specified by:
- mapToLongin interface- DoubleStream
- Returns:
- the new cache long stream
 
- 
flatMapDescription copied from interface:DoubleCacheStream- Specified by:
- flatMapin interface- DoubleCacheStream
- Specified by:
- flatMapin interface- DoubleStream
- Returns:
- the new cache double stream
 
- 
parallelDescription copied from interface:DoubleCacheStream- Specified by:
- parallelin interface- BaseStream<Double,- DoubleStream> 
- Specified by:
- parallelin interface- DoubleCacheStream
- Specified by:
- parallelin interface- DoubleStream
- Returns:
- a parallel cache double stream
 
- 
iterator- Specified by:
- iteratorin interface- BaseStream<Double,- DoubleStream> 
- Specified by:
- iteratorin interface- DoubleStream
 
- 
spliterator- Specified by:
- spliteratorin interface- BaseStream<Double,- DoubleStream> 
- Specified by:
- spliteratorin interface- DoubleStream
 
- 
sequentialDescription copied from interface:DoubleCacheStream- Specified by:
- sequentialin interface- BaseStream<Double,- DoubleStream> 
- Specified by:
- sequentialin interface- DoubleCacheStream
- Specified by:
- sequentialin interface- DoubleStream
- Returns:
- a sequential cache double stream
 
- 
unorderedDescription copied from interface:DoubleCacheStream- Specified by:
- unorderedin interface- BaseStream<Double,- DoubleStream> 
- Specified by:
- unorderedin interface- DoubleCacheStream
- Returns:
- an unordered cache double stream
 
- 
forEach- Specified by:
- forEachin interface- DoubleStream
 
- 
forEachDescription copied from interface:DoubleCacheStreamSame asDoubleStream.forEach(DoubleConsumer)except that it takes anObjDoubleConsumerthat provides access to the underlyingCachethat is backing this stream.Note that the CacheAwareinterface is not supported for injection using this method as the cache is provided in the consumer directly.- Specified by:
- forEachin interface- DoubleCacheStream
- Type Parameters:
- K- key type of the cache
- V- value type of the cache
- Parameters:
- action- consumer to be ran for each element in the stream
 
- 
forEachOrdered- Specified by:
- forEachOrderedin interface- DoubleStream
 
- 
toArraypublic double[] toArray()- Specified by:
- toArrayin interface- DoubleStream
 
- 
reduce- Specified by:
- reducein interface- DoubleStream
 
- 
reduce- Specified by:
- reducein interface- DoubleStream
 
- 
collectpublic <R> R collect(Supplier<R> supplier, ObjDoubleConsumer<R> accumulator, BiConsumer<R, R> combiner) - Specified by:
- collectin interface- DoubleStream
 
- 
sumpublic double sum()- Specified by:
- sumin interface- DoubleStream
 
- 
min- Specified by:
- minin interface- DoubleStream
 
- 
max- Specified by:
- maxin interface- DoubleStream
 
- 
countpublic long count()- Specified by:
- countin interface- DoubleStream
 
- 
average- Specified by:
- averagein interface- DoubleStream
 
- 
summaryStatistics- Specified by:
- summaryStatisticsin interface- DoubleStream
 
- 
anyMatch- Specified by:
- anyMatchin interface- DoubleStream
 
- 
allMatch- Specified by:
- allMatchin interface- DoubleStream
 
- 
noneMatch- Specified by:
- noneMatchin interface- DoubleStream
 
- 
findFirst- Specified by:
- findFirstin interface- DoubleStream
 
- 
findAny- Specified by:
- findAnyin interface- DoubleStream
 
- 
boxedDescription copied from interface:DoubleCacheStream- Specified by:
- boxedin interface- DoubleCacheStream
- Specified by:
- boxedin interface- DoubleStream
- Returns:
- the new cache stream containing doubles
 
- 
onCloseDescription copied from interface:DoubleCacheStream- Specified by:
- onClosein interface- BaseStream<Double,- DoubleStream> 
- Specified by:
- onClosein interface- DoubleCacheStream
- Returns:
- a cache double stream with the handler applied
 
- 
closepublic void close()- Specified by:
- closein interface- AutoCloseable
- Specified by:
- closein interface- BaseStream<Double,- DoubleStream> 
 
 
-