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
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractCacheStream(Address localAddress, boolean parallel, DistributionManager dm, InvocationContext ctx, Supplier<CacheStream<Original>> supplier, boolean includeLoader, int distributedBatchSize, Executor executor, ComponentRegistry registry, Function<? super Original,?> toKeyFunction)protectedAbstractCacheStream(AbstractCacheStream<Original,T,S,S2> other)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voidaddIntermediateOperation(Queue<IntermediateOperation> intermediateOperations, IntermediateOperation<T,S,?,?> intermediateOperation)protected S2addIntermediateOperation(IntermediateOperation<T,S,T,S> intermediateOperation)protected voidaddIntermediateOperationMap(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 LoggetLog()booleanisParallel()protected booleanisPrimaryOwner(ConsistentHash ch, Object key)S2onClose(Runnable closeHandler)S2parallel()S2sequential()S2unordered()protected abstract S2unwrap()-
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 Detail
-
intermediateOperations
protected final Queue<IntermediateOperation> intermediateOperations
-
localAddress
protected final Address localAddress
-
dm
protected final DistributionManager dm
-
supplier
protected final Supplier<CacheStream<Original>> supplier
-
cpm
protected final ClusterPublisherManager cpm
-
executor
protected final Executor executor
-
registry
protected final ComponentRegistry registry
-
partition
protected final PartitionHandlingManager partition
-
keyPartitioner
protected final KeyPartitioner keyPartitioner
-
stateTransferLock
protected final StateTransferLock stateTransferLock
-
includeLoader
protected final boolean includeLoader
-
invocationContext
protected final InvocationContext invocationContext
-
closeRunnable
protected Runnable closeRunnable
-
parallelDistribution
protected Boolean parallelDistribution
-
parallel
protected boolean parallel
-
rehashAware
protected boolean rehashAware
-
keysToFilter
protected Set<?> keysToFilter
-
segmentsToFilter
protected org.infinispan.commons.util.IntSet segmentsToFilter
-
distributedBatchSize
protected int distributedBatchSize
-
segmentCompletionListener
protected Consumer<Supplier<PrimitiveIterator.OfInt>> segmentCompletionListener
-
iteratorOperation
protected org.infinispan.stream.impl.AbstractCacheStream.IteratorOperation iteratorOperation
-
timeout
protected long timeout
-
timeoutUnit
protected TimeUnit timeoutUnit
-
-
Constructor Detail
-
AbstractCacheStream
protected AbstractCacheStream(Address localAddress, boolean parallel, DistributionManager dm, InvocationContext ctx, Supplier<CacheStream<Original>> supplier, boolean includeLoader, int distributedBatchSize, Executor executor, ComponentRegistry registry, Function<? super Original,?> toKeyFunction)
-
AbstractCacheStream
protected AbstractCacheStream(AbstractCacheStream<Original,T,S,S2> other)
-
-
Method Detail
-
getLog
protected abstract Log getLog()
-
addIntermediateOperation
protected S2 addIntermediateOperation(IntermediateOperation<T,S,T,S> intermediateOperation)
-
addIntermediateOperationMap
protected void addIntermediateOperationMap(IntermediateOperation<T,S,?,?> intermediateOperation)
-
addIntermediateOperation
protected void addIntermediateOperation(Queue<IntermediateOperation> intermediateOperations, IntermediateOperation<T,S,?,?> intermediateOperation)
-
unwrap
protected abstract S2 unwrap()
-
isParallel
public boolean isParallel()
- Specified by:
isParallelin interfaceBaseStream<Original,T>
-
sequential
public S2 sequential()
- Specified by:
sequentialin interfaceBaseStream<Original,T>
-
parallel
public S2 parallel()
- Specified by:
parallelin interfaceBaseStream<Original,T>
-
unordered
public S2 unordered()
- Specified by:
unorderedin interfaceBaseStream<Original,T>
-
onClose
public S2 onClose(Runnable closeHandler)
- Specified by:
onClosein interfaceBaseStream<Original,T>
-
close
public void close()
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceBaseStream<Original,T>
-
isPrimaryOwner
protected boolean isPrimaryOwner(ConsistentHash ch, Object key)
-
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.
-
-