Class AbstractCacheStream<Original, T, S extends BaseStream<T,S>, S2 extends S>
java.lang.Object
org.infinispan.stream.impl.AbstractCacheStream<Original,T,S,S2>
- Type Parameters:
Original- the original type of the underlying stream - normally CacheEntry or ObjectT- The type returned by the streamS- The stream interface
- All Implemented Interfaces:
AutoCloseable,BaseStream<T,S>
- Direct Known Subclasses:
DistributedCacheStream,DistributedDoubleCacheStream,DistributedIntCacheStream,DistributedLongCacheStream
public abstract class AbstractCacheStream<Original, T, S extends BaseStream<T,S>, S2 extends S>
extends Object
implements BaseStream<T,S>
Abstract stream that provides all of the common functionality required for all types of Streams including the various
primitive types.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Runnableprotected final ClusterPublisherManagerprotected intprotected final Executorprotected final longprotected final Queue<org.infinispan.stream.impl.intops.IntermediateOperation> protected final InvocationContextprotected org.infinispan.stream.impl.AbstractCacheStream.IteratorOperationprotected final KeyPartitionerprotected Set<?> protected final Addressprotected booleanprotected Booleanprotected final PartitionHandlingManagerprotected final ComponentRegistryprotected booleanprotected Consumer<Supplier<PrimitiveIterator.OfInt>> protected IntSetprotected final org.infinispan.statetransfer.StateTransferLockprotected longprotected TimeUnit -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractCacheStream(Address localAddress, boolean parallel, InvocationContext ctx, long explicitFlags, int distributedBatchSize, Executor executor, ComponentRegistry registry, Function<? super Original, ?> toKeyFunction, ClusterPublisherManager<?, ?> clusterPublisherManager) protectedAbstractCacheStream(AbstractCacheStream<Original, T, S, S2> other) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddIntermediateOperation(Queue<org.infinispan.stream.impl.intops.IntermediateOperation> intermediateOperations, org.infinispan.stream.impl.intops.IntermediateOperation<T, S, ?, ?> intermediateOperation) protected S2addIntermediateOperation(org.infinispan.stream.impl.intops.IntermediateOperation<T, S, T, S> intermediateOperation) protected voidaddIntermediateOperationMap(org.infinispan.stream.impl.intops.IntermediateOperation<T, S, ?, ?> intermediateOperation) voidclose()protected static Consumer<Supplier<PrimitiveIterator.OfInt>> composeWithExceptions(Consumer<Supplier<PrimitiveIterator.OfInt>> a, Consumer<Supplier<PrimitiveIterator.OfInt>> b) Given two SegmentCompletionListener, return a SegmentCompletionListener that executes both in sequence, even if the first throws an exception, and if both throw exceptions, add any exceptions thrown by the second as suppressed exceptions of the first.protected abstract org.infinispan.util.logging.LoggetLog()booleanprotected booleanisPrimaryOwner(ConsistentHash ch, Object key) parallel()protected abstract S2unwrap()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.stream.BaseStream
iterator, spliterator
-
Field Details
-
intermediateOperations
protected final Queue<org.infinispan.stream.impl.intops.IntermediateOperation> intermediateOperations -
localAddress
-
cpm
-
executor
-
registry
-
partition
-
keyPartitioner
-
stateTransferLock
protected final org.infinispan.statetransfer.StateTransferLock stateTransferLock -
explicitFlags
protected final long explicitFlags -
toKeyFunction
-
invocationContext
-
closeRunnable
-
parallelDistribution
-
parallel
protected boolean parallel -
rehashAware
protected boolean rehashAware -
keysToFilter
-
segmentsToFilter
-
distributedBatchSize
protected int distributedBatchSize -
segmentCompletionListener
-
iteratorOperation
protected org.infinispan.stream.impl.AbstractCacheStream.IteratorOperation iteratorOperation -
timeout
protected long timeout -
timeoutUnit
-
-
Constructor Details
-
AbstractCacheStream
protected AbstractCacheStream(Address localAddress, boolean parallel, InvocationContext ctx, long explicitFlags, int distributedBatchSize, Executor executor, ComponentRegistry registry, Function<? super Original, ?> toKeyFunction, ClusterPublisherManager<?, ?> clusterPublisherManager) -
AbstractCacheStream
-
-
Method Details
-
getLog
protected abstract org.infinispan.util.logging.Log getLog() -
addIntermediateOperation
-
addIntermediateOperationMap
-
addIntermediateOperation
-
unwrap
-
isParallel
public boolean isParallel()- Specified by:
isParallelin interfaceBaseStream<Original,T>
-
sequential
- Specified by:
sequentialin interfaceBaseStream<Original,T>
-
parallel
- Specified by:
parallelin interfaceBaseStream<Original,T>
-
unordered
- Specified by:
unorderedin interfaceBaseStream<Original,T>
-
onClose
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceBaseStream<Original,T>
-
isPrimaryOwner
-
composeWithExceptions
protected static Consumer<Supplier<PrimitiveIterator.OfInt>> composeWithExceptions(Consumer<Supplier<PrimitiveIterator.OfInt>> a, Consumer<Supplier<PrimitiveIterator.OfInt>> b) Given two SegmentCompletionListener, return a SegmentCompletionListener that executes both in sequence, even if the first throws an exception, and if both throw exceptions, add any exceptions thrown by the second as suppressed exceptions of the first.
-