Class 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.
    • Field Detail

      • listener

        protected final org.infinispan.stream.impl.PartitionAwareClusterStreamManager.PartitionListener listener
      • cache

        protected Cache<?,​?> cache
    • Constructor Detail

      • PartitionAwareClusterStreamManager

        public PartitionAwareClusterStreamManager()
    • Method Detail

      • 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: ClusterStreamManager
        Performs the remote stream operation without rehash awareness.
        Specified by:
        remoteStreamOperation in interface ClusterStreamManager<Original,​K>
        Overrides:
        remoteStreamOperation in class ClusterStreamManagerImpl<Original,​K>
        Type Parameters:
        R - the type of response
        Parameters:
        parallelDistribution - whether or not parallel distribution is enabled
        parallelStream - whether or not the stream is paralllel
        ch - the consistent hash to use when determining segment ownership
        segments - the segments that this request should utilize
        keysToInclude - which keys to include in the request
        keysToExclude - which keys to exclude in the request
        includeLoader - whether or not to use a loader
        entryStream - whether the remote stream should be an entry or key stream
        operation - the actual operation to perform
        callback - the callback to collect individual node results
        earlyTerminatePredicate - 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: ClusterStreamManager
        Key tracking remote operation that doesn't have rehash enabled.
        Specified by:
        remoteStreamOperation in interface ClusterStreamManager<Original,​K>
        Overrides:
        remoteStreamOperation in class ClusterStreamManagerImpl<Original,​K>
        Type Parameters:
        R - the type of response
        Parameters:
        parallelDistribution - whether or not parallel distribution is enabled
        parallelStream - whether or not the stream is paralllel
        ch - the consistent hash to use when determining segment ownership
        segments - the segments that this request should utilize
        keysToInclude - which keys to include in the request
        keysToExclude - which keys to exclude in the request
        includeLoader - whether or not to use a loader
        entryStream - whether the remote stream should be an entry or key stream
        operation - the actual operation to perform
        callback - 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: ClusterStreamManager
        Performs the remote stream operation with rehash awareness.
        Specified by:
        remoteStreamOperationRehashAware in interface ClusterStreamManager<Original,​K>
        Overrides:
        remoteStreamOperationRehashAware in class ClusterStreamManagerImpl<Original,​K>
        Type Parameters:
        R - the type of response
        Parameters:
        parallelDistribution - whether or not parallel distribution is enabled
        parallelStream - whether or not the stream is paralllel
        ch - the consistent hash to use when determining segment ownership
        segments - the segments that this request should utilize
        keysToInclude - which keys to include in the request
        keysToExclude - which keys to exclude in the request
        includeLoader - whether or not to use a loader
        entryStream - whether the remote stream should be an entry or key stream
        operation - the actual operation to perform
        callback - the callback to collect individual node results
        earlyTerminatePredicate - 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: ClusterStreamManager
        Key tracking remote operation that has rehash enabled
        Specified by:
        remoteStreamOperationRehashAware in interface ClusterStreamManager<Original,​K>
        Overrides:
        remoteStreamOperationRehashAware in class ClusterStreamManagerImpl<Original,​K>
        Parameters:
        parallelDistribution - whether or not parallel distribution is enabled
        parallelStream - whether or not the stream is paralllel
        ch - the consistent hash to use when determining segment ownership
        segments - the segments that this request should utilize
        keysToInclude - which keys to include in the request
        keysToExclude - which keys to exclude in the request
        includeLoader - whether or not to use a loader
        entryStream - whether the remote stream should be an entry or key stream
        operation - the actual operation to perform
        callback - the callback to collect individual node results
        Returns:
        the operation id to be used for further calls