K
- key type of the supplied streampublic class ForEachIntOperation<K> extends BaseTerminalOperation implements KeyTrackingTerminalOperation<K,Integer,K>
IntStream
. Note this means it is an implied map intermediate operation.KeyTrackingTerminalOperation.IntermediateCollector<C>
intermediateOperations, supplier
Constructor and Description |
---|
ForEachIntOperation(Iterable<IntermediateOperation> intermediateOperations,
Supplier<Stream<CacheEntry>> supplier,
int batchSize,
IntConsumer consumer) |
Modifier and Type | Method and Description |
---|---|
int |
getBatchSize() |
IntConsumer |
getConsumer() |
void |
handleInjection(ComponentRegistry registry)
Handles injection of components for various intermediate and this operation.
|
boolean |
lostSegment(boolean stopIfLost)
This method will be invoked when the operation is known to be performing on a given set of segments
and this node no longer owns 1 or many of them.
|
List<Integer> |
performOperation(KeyTrackingTerminalOperation.IntermediateCollector<Collection<Integer>> response)
Invoked when a key aware operation is desired without rehash being enabled.
|
Collection<CacheEntry<K,K>> |
performOperationRehashAware(KeyTrackingTerminalOperation.IntermediateCollector<Collection<CacheEntry<K,K>>> response)
Invoked when a key and rehash aware operation is desired.
|
getIntermediateOperations, setSupplier
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
setSupplier
public ForEachIntOperation(Iterable<IntermediateOperation> intermediateOperations, Supplier<Stream<CacheEntry>> supplier, int batchSize, IntConsumer consumer)
public boolean lostSegment(boolean stopIfLost)
SegmentAwareOperation
lostSegment
in interface SegmentAwareOperation
stopIfLost
- argument to tell the operation that if this segment affects that it should not
perform any more operations if possible as all segments have been lost.public List<Integer> performOperation(KeyTrackingTerminalOperation.IntermediateCollector<Collection<Integer>> response)
KeyTrackingTerminalOperation
performOperation
in interface KeyTrackingTerminalOperation<K,Integer,K>
response
- the collector that will be called back for any intermediate resultspublic Collection<CacheEntry<K,K>> performOperationRehashAware(KeyTrackingTerminalOperation.IntermediateCollector<Collection<CacheEntry<K,K>>> response)
KeyTrackingTerminalOperation
performOperationRehashAware
in interface KeyTrackingTerminalOperation<K,Integer,K>
response
- the collector that will be called back for any intermediate resultspublic int getBatchSize()
public IntConsumer getConsumer()
public void handleInjection(ComponentRegistry registry)
KeyTrackingTerminalOperation
handleInjection
in interface KeyTrackingTerminalOperation<K,Integer,K>
handleInjection
in class BaseTerminalOperation
registry
- component registry to useCopyright © 2022 JBoss, a division of Red Hat. All rights reserved.