Package org.infinispan.stream.impl.tx
Class TxDistributedCacheStream<Original,R,K,V>
- java.lang.Object
-
- org.infinispan.stream.impl.AbstractCacheStream<Original,R,Stream<R>,CacheStream<R>>
-
- org.infinispan.stream.impl.DistributedCacheStream<Original,R>
-
- org.infinispan.stream.impl.tx.TxDistributedCacheStream<Original,R,K,V>
-
- Type Parameters:
Original
- original stream typeR
- the type of streamK
- the type of context entry keyV
- the type of context entry value
- All Implemented Interfaces:
AutoCloseable
,BaseStream<R,Stream<R>>
,Stream<R>
,BaseCacheStream<R,Stream<R>>
,CacheStream<R>
public class TxDistributedCacheStream<Original,R,K,V> extends DistributedCacheStream<Original,R>
A distributed cache stream that also utilizes transactional awareness. Basically this adds functionality to take items from the local tx context and add them to the local stream that is produced to enable our stream to operate upon entries in the context that don't map to our segments that are normally ignored in a distributed stream.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.infinispan.stream.impl.AbstractCacheStream
AbstractCacheStream.MapOpsExternalizer
-
Nested classes/interfaces inherited from interface org.infinispan.BaseCacheStream
BaseCacheStream.SegmentCompletionListener
-
Nested classes/interfaces inherited from interface java.util.stream.Stream
Stream.Builder<T extends Object>
-
-
Field Summary
-
Fields inherited from class org.infinispan.stream.impl.AbstractCacheStream
closeRunnable, csm, distributedBatchSize, dm, executor, includeLoader, intermediateOperations, iteratorOperation, keyPartitioner, keysToFilter, parallel, parallelDistribution, partition, registry, rehashAware, segmentCompletionListener, segmentsToFilter, stateTransferLock, supplier, timeout, timeoutUnit, toKeyFunction
-
-
Constructor Summary
Constructors Constructor Description TxDistributedCacheStream(Address localAddress, boolean parallel, DistributionManager dm, Supplier<CacheStream<R>> supplier, TxClusterStreamManager<Original,K> csm, boolean includeLoader, int distributedBatchSize, Executor executor, ComponentRegistry registry, LocalTxInvocationContext ctx, Function<? super Original,?> toKeyFunction, Function<? super CacheEntry<K,V>,? extends Original> toOriginalFunction)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected DistributedDoubleCacheStream<Original>
doubleCacheStream()
protected DistributedIntCacheStream<Original>
intCacheStream()
protected DistributedLongCacheStream<Original>
longCacheStream()
protected Supplier<Stream<Original>>
supplierForSegments(ConsistentHash ch, org.infinispan.commons.util.IntSet targetSegments, Set<Object> excludedKeys, boolean primaryOnly)
IfusePrimary
is true the segments are the primary segments but only those that exist in targetSegments.-
Methods inherited from class org.infinispan.stream.impl.DistributedCacheStream
allMatch, anyMatch, collect, collect, count, disableRehashAware, distinct, distributedBatchSize, filter, filterKeys, filterKeySegments, filterKeySegments, findAny, findFirst, flatMap, flatMapToDouble, flatMapToInt, flatMapToLong, forEach, forEach, forEachOrdered, getLog, iterator, limit, map, mapToDouble, mapToInt, mapToLong, max, min, noneMatch, parallelDistribution, peek, reduce, reduce, reduce, segmentCompletionListener, sequentialDistribution, skip, sorted, sorted, spliterator, supplierStreamCast, timeout, toArray, toArray, unwrap
-
Methods inherited from class org.infinispan.stream.impl.AbstractCacheStream
addIntermediateOperation, addIntermediateOperation, addIntermediateOperationMap, close, composeWithExceptions, isParallel, isPrimaryOwner, nonNullKeyFunction, onClose, parallel, sequential, supplierForSegments, unordered
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.stream.BaseStream
close, isParallel
-
Methods inherited from interface org.infinispan.CacheStream
allMatch, anyMatch, collect, collect, collect, filter, flatMap, flatMapToDouble, flatMapToInt, flatMapToLong, forEach, forEach, map, mapToDouble, mapToInt, mapToLong, max, min, noneMatch, onClose, parallel, peek, reduce, reduce, reduce, sequential, sorted, toArray, unordered
-
-
-
-
Constructor Detail
-
TxDistributedCacheStream
public TxDistributedCacheStream(Address localAddress, boolean parallel, DistributionManager dm, Supplier<CacheStream<R>> supplier, TxClusterStreamManager<Original,K> csm, boolean includeLoader, int distributedBatchSize, Executor executor, ComponentRegistry registry, LocalTxInvocationContext ctx, Function<? super Original,?> toKeyFunction, Function<? super CacheEntry<K,V>,? extends Original> toOriginalFunction)
-
-
Method Detail
-
supplierForSegments
protected Supplier<Stream<Original>> supplierForSegments(ConsistentHash ch, org.infinispan.commons.util.IntSet targetSegments, Set<Object> excludedKeys, boolean primaryOnly)
Description copied from class:AbstractCacheStream
IfusePrimary
is true the segments are the primary segments but only those that exist in targetSegments. However ifusePrimary
is false thentargetSegments
must be provided and non null and this will be used specifically.- Overrides:
supplierForSegments
in classAbstractCacheStream<Original,R,Stream<R>,CacheStream<R>>
primaryOnly
- determines whether we should utilize the primary segments or not.- Returns:
-
doubleCacheStream
protected DistributedDoubleCacheStream<Original> doubleCacheStream()
- Overrides:
doubleCacheStream
in classDistributedCacheStream<Original,R>
-
longCacheStream
protected DistributedLongCacheStream<Original> longCacheStream()
- Overrides:
longCacheStream
in classDistributedCacheStream<Original,R>
-
intCacheStream
protected DistributedIntCacheStream<Original> intCacheStream()
- Overrides:
intCacheStream
in classDistributedCacheStream<Original,R>
-
-