Package org.infinispan.stream.impl
Class PartitionAwareClusterStreamManager<Original,K>
- java.lang.Object
-
- org.infinispan.stream.impl.ClusterStreamManagerImpl<Original,K>
-
- org.infinispan.stream.impl.PartitionAwareClusterStreamManager<Original,K>
-
- All Implemented Interfaces:
ClusterStreamManager<Original,K>
public class PartitionAwareClusterStreamManager<Original,K> extends ClusterStreamManagerImpl<Original,K>
Cluster stream manager that also pays attention to partition status and properly closes iterators and throws exceptions when the availability mode changes.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.infinispan.stream.impl.ClusterStreamManager
ClusterStreamManager.RemoteIteratorPublisher<K>, ClusterStreamManager.ResultsCallback<R>
-
-
Field Summary
Fields Modifier and Type Field Description protected Cache<?,?>cacheprotected Configurationconfigurationprotected org.infinispan.stream.impl.PartitionAwareClusterStreamManager.PartitionListenerlistener-
Fields inherited from class org.infinispan.stream.impl.ClusterStreamManagerImpl
currentlyRunning, factory, iteratorsRunning, localAddress, log, requestId, rpc, rpcOptions, trace
-
-
Constructor Summary
Constructors Constructor Description PartitionAwareClusterStreamManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanawaitCompletion(Object id, long time, TimeUnit unit)Awaits completion of the given request.<E> ClusterStreamManager.RemoteIteratorPublisher<E>remoteIterationPublisher(boolean parallelStream, Supplier<Map.Entry<Address,org.infinispan.commons.util.IntSet>> targets, Set<K> keysToInclude, IntFunction<Set<K>> keysToExclude, boolean includeLoader, boolean entryStream, Iterable<org.infinispan.stream.impl.intops.IntermediateOperation> intermediateOperations)<R> ObjectremoteStreamOperation(boolean parallelDistribution, boolean parallelStream, ConsistentHash ch, org.infinispan.commons.util.IntSet segments, Set<K> keysToInclude, Map<Integer,Set<K>> keysToExclude, boolean includeLoader, boolean entryStream, KeyTrackingTerminalOperation<Original,K,R> operation, ClusterStreamManager.ResultsCallback<Collection<R>> callback)Key tracking remote operation that doesn't have rehash enabled.<R> ObjectremoteStreamOperation(boolean parallelDistribution, boolean parallelStream, ConsistentHash ch, org.infinispan.commons.util.IntSet segments, Set<K> keysToInclude, Map<Integer,Set<K>> keysToExclude, boolean includeLoader, boolean entryStream, TerminalOperation<Original,R> operation, ClusterStreamManager.ResultsCallback<R> callback, Predicate<? super R> earlyTerminatePredicate)Performs the remote stream operation without rehash awareness.ObjectremoteStreamOperationRehashAware(boolean parallelDistribution, boolean parallelStream, ConsistentHash ch, org.infinispan.commons.util.IntSet segments, Set<K> keysToInclude, Map<Integer,Set<K>> keysToExclude, boolean includeLoader, boolean entryStream, KeyTrackingTerminalOperation<Original,K,?> operation, ClusterStreamManager.ResultsCallback<Collection<K>> callback)Key tracking remote operation that has rehash enabled<R> ObjectremoteStreamOperationRehashAware(boolean parallelDistribution, boolean parallelStream, ConsistentHash ch, org.infinispan.commons.util.IntSet segments, Set<K> keysToInclude, Map<Integer,Set<K>> keysToExclude, boolean includeLoader, boolean entryStream, TerminalOperation<Original,R> operation, ClusterStreamManager.ResultsCallback<R> callback, Predicate<? super R> earlyTerminatePredicate)Performs the remote stream operation with rehash awareness.voidstart()-
Methods inherited from class org.infinispan.stream.impl.ClusterStreamManagerImpl
forgetOperation, isComplete, markTrackerWithException, receiveResponse
-
-
-
-
Field Detail
-
listener
protected final org.infinispan.stream.impl.PartitionAwareClusterStreamManager.PartitionListener listener
-
cache
protected Cache<?,?> cache
-
configuration
protected Configuration configuration
-
-
Method Detail
-
start
public void start()
- Overrides:
startin classClusterStreamManagerImpl<Original,K>
-
awaitCompletion
public boolean awaitCompletion(Object id, long time, TimeUnit unit) throws InterruptedException
Description copied from interface:ClusterStreamManagerAwaits completion of the given request. Returns true when the request completes otherwise returns false after the time elapses- Specified by:
awaitCompletionin interfaceClusterStreamManager<Original,K>- Overrides:
awaitCompletionin classClusterStreamManagerImpl<Original,K>- Parameters:
id- the ide of the operation that was returned from the invocation - must be non nulltime- how long to wait before returning false - must be greater than 0unit- controls how long the time wait is- Returns:
- whether or not the request is complete
- Throws:
InterruptedException
-
remoteStreamOperation
public <R> Object remoteStreamOperation(boolean parallelDistribution, boolean parallelStream, ConsistentHash ch, org.infinispan.commons.util.IntSet segments, Set<K> keysToInclude, Map<Integer,Set<K>> keysToExclude, boolean includeLoader, boolean entryStream, TerminalOperation<Original,R> operation, ClusterStreamManager.ResultsCallback<R> callback, Predicate<? super R> earlyTerminatePredicate)
Description copied from interface:ClusterStreamManagerPerforms the remote stream operation without rehash awareness.- Specified by:
remoteStreamOperationin interfaceClusterStreamManager<Original,K>- Overrides:
remoteStreamOperationin classClusterStreamManagerImpl<Original,K>- Type Parameters:
R- the type of response- Parameters:
parallelDistribution- whether or not parallel distribution is enabledparallelStream- whether or not the stream is paralllelch- the consistent hash to use when determining segment ownershipsegments- the segments that this request should utilizekeysToInclude- which keys to include in the requestkeysToExclude- which keys to exclude in the requestincludeLoader- whether or not to use a loaderentryStream- whether the remote stream should be an entry or key streamoperation- the actual operation to performcallback- the callback to collect individual node resultsearlyTerminatePredicate- a predicate to determine if this operation should stop based on intermediate results- Returns:
- the operation id to be used for further calls
-
remoteStreamOperation
public <R> Object remoteStreamOperation(boolean parallelDistribution, boolean parallelStream, ConsistentHash ch, org.infinispan.commons.util.IntSet segments, Set<K> keysToInclude, Map<Integer,Set<K>> keysToExclude, boolean includeLoader, boolean entryStream, KeyTrackingTerminalOperation<Original,K,R> operation, ClusterStreamManager.ResultsCallback<Collection<R>> callback)
Description copied from interface:ClusterStreamManagerKey tracking remote operation that doesn't have rehash enabled.- Specified by:
remoteStreamOperationin interfaceClusterStreamManager<Original,K>- Overrides:
remoteStreamOperationin classClusterStreamManagerImpl<Original,K>- Type Parameters:
R- the type of response- Parameters:
parallelDistribution- whether or not parallel distribution is enabledparallelStream- whether or not the stream is paralllelch- the consistent hash to use when determining segment ownershipsegments- the segments that this request should utilizekeysToInclude- which keys to include in the requestkeysToExclude- which keys to exclude in the requestincludeLoader- whether or not to use a loaderentryStream- whether the remote stream should be an entry or key streamoperation- the actual operation to performcallback- the callback to collect individual node results- Returns:
- the operation id to be used for further calls
-
remoteStreamOperationRehashAware
public <R> Object remoteStreamOperationRehashAware(boolean parallelDistribution, boolean parallelStream, ConsistentHash ch, org.infinispan.commons.util.IntSet segments, Set<K> keysToInclude, Map<Integer,Set<K>> keysToExclude, boolean includeLoader, boolean entryStream, TerminalOperation<Original,R> operation, ClusterStreamManager.ResultsCallback<R> callback, Predicate<? super R> earlyTerminatePredicate)
Description copied from interface:ClusterStreamManagerPerforms the remote stream operation with rehash awareness.- Specified by:
remoteStreamOperationRehashAwarein interfaceClusterStreamManager<Original,K>- Overrides:
remoteStreamOperationRehashAwarein classClusterStreamManagerImpl<Original,K>- Type Parameters:
R- the type of response- Parameters:
parallelDistribution- whether or not parallel distribution is enabledparallelStream- whether or not the stream is paralllelch- the consistent hash to use when determining segment ownershipsegments- the segments that this request should utilizekeysToInclude- which keys to include in the requestkeysToExclude- which keys to exclude in the requestincludeLoader- whether or not to use a loaderentryStream- whether the remote stream should be an entry or key streamoperation- the actual operation to performcallback- the callback to collect individual node resultsearlyTerminatePredicate- a predicate to determine if this operation should stop based on intermediate results- Returns:
- the operation id to be used for further calls
-
remoteStreamOperationRehashAware
public Object remoteStreamOperationRehashAware(boolean parallelDistribution, boolean parallelStream, ConsistentHash ch, org.infinispan.commons.util.IntSet segments, Set<K> keysToInclude, Map<Integer,Set<K>> keysToExclude, boolean includeLoader, boolean entryStream, KeyTrackingTerminalOperation<Original,K,?> operation, ClusterStreamManager.ResultsCallback<Collection<K>> callback)
Description copied from interface:ClusterStreamManagerKey tracking remote operation that has rehash enabled- Specified by:
remoteStreamOperationRehashAwarein interfaceClusterStreamManager<Original,K>- Overrides:
remoteStreamOperationRehashAwarein classClusterStreamManagerImpl<Original,K>- Parameters:
parallelDistribution- whether or not parallel distribution is enabledparallelStream- whether or not the stream is paralllelch- the consistent hash to use when determining segment ownershipsegments- the segments that this request should utilizekeysToInclude- which keys to include in the requestkeysToExclude- which keys to exclude in the requestincludeLoader- whether or not to use a loaderentryStream- whether the remote stream should be an entry or key streamoperation- the actual operation to performcallback- the callback to collect individual node results- Returns:
- the operation id to be used for further calls
-
remoteIterationPublisher
public <E> ClusterStreamManager.RemoteIteratorPublisher<E> remoteIterationPublisher(boolean parallelStream, Supplier<Map.Entry<Address,org.infinispan.commons.util.IntSet>> targets, Set<K> keysToInclude, IntFunction<Set<K>> keysToExclude, boolean includeLoader, boolean entryStream, Iterable<org.infinispan.stream.impl.intops.IntermediateOperation> intermediateOperations)
- Specified by:
remoteIterationPublisherin interfaceClusterStreamManager<Original,K>- Overrides:
remoteIterationPublisherin classClusterStreamManagerImpl<Original,K>entryStream- whether the remote stream should be an entry or key stream- Returns:
-
-