Package org.infinispan.stream.impl
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
Modifier and TypeFieldDescriptionprotected Runnable
protected final ClusterPublisherManager
protected int
protected final Executor
protected final long
protected final Queue
<org.infinispan.stream.impl.intops.IntermediateOperation> protected final InvocationContext
protected org.infinispan.stream.impl.AbstractCacheStream.IteratorOperation
protected final KeyPartitioner
protected Set
<?> protected final Address
protected boolean
protected Boolean
protected final PartitionHandlingManager
protected final ComponentRegistry
protected boolean
protected Consumer
<Supplier<PrimitiveIterator.OfInt>> protected IntSet
protected final org.infinispan.statetransfer.StateTransferLock
protected long
protected TimeUnit
-
Constructor Summary
ModifierConstructorDescriptionprotected
AbstractCacheStream
(Address localAddress, boolean parallel, InvocationContext ctx, long explicitFlags, int distributedBatchSize, Executor executor, ComponentRegistry registry, Function<? super Original, ?> toKeyFunction, ClusterPublisherManager<?, ?> clusterPublisherManager) protected
AbstractCacheStream
(AbstractCacheStream<Original, T, S, S2> other) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addIntermediateOperation
(Queue<org.infinispan.stream.impl.intops.IntermediateOperation> intermediateOperations, org.infinispan.stream.impl.intops.IntermediateOperation<T, S, ?, ?> intermediateOperation) protected S2
addIntermediateOperation
(org.infinispan.stream.impl.intops.IntermediateOperation<T, S, T, S> intermediateOperation) protected void
addIntermediateOperationMap
(org.infinispan.stream.impl.intops.IntermediateOperation<T, S, ?, ?> intermediateOperation) void
close()
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.Log
getLog()
boolean
protected boolean
isPrimaryOwner
(ConsistentHash ch, Object key) parallel()
protected abstract S2
unwrap()
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
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:
isParallel
in interfaceBaseStream<Original,
T>
-
sequential
- Specified by:
sequential
in interfaceBaseStream<Original,
T>
-
parallel
- Specified by:
parallel
in interfaceBaseStream<Original,
T>
-
unordered
- Specified by:
unordered
in interfaceBaseStream<Original,
T>
-
onClose
- Specified by:
onClose
in interfaceBaseStream<Original,
T>
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in 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.
-