Class IteratorHandler


  • public class IteratorHandler
    extends Object
    Handler for storing iterators between invocations so that remote node can request data in chunks.
    Since:
    9.2
    Author:
    wburns
    • Constructor Detail

      • IteratorHandler

        public IteratorHandler()
    • Method Detail

      • start

        public void start()
      • stop

        public void stop()
      • start

        public <Original,​E> IteratorHandler.OnCloseIterator<E> start​(Address origin,
                                                                           Supplier<Stream<Original>> streamSupplier,
                                                                           Iterable<org.infinispan.stream.impl.intops.IntermediateOperation> intOps,
                                                                           Object requestId)
        Starts an iteration process from the given stream that converts the stream to a subsequent stream using the given intermediate operations and then creates a managed iterator for the caller to subsequently retrieve.
        Type Parameters:
        Original - original stream type
        E - resulting type
        Parameters:
        streamSupplier - the supplied stream
        intOps - the intermediate operations to perform on the stream
        Returns:
        the id of the managed iterator
      • getIterator

        public <E> org.infinispan.commons.util.CloseableIterator<E> getIterator​(Object requestId)
      • openIterators

        public int openIterators()
        Returns how many iterators are currently open
        Returns:
        how many iterators are currently open
      • closeIterator

        public void closeIterator​(Address origin,
                                  Object requestId)
        Invoked to have handler forget about given iterator they requested. This should be invoked when an Iterator has been found to have completed Iterator.hasNext() is false or if the caller wishes to stop a given iteration early. If an iterator is fully iterated upon (ie. Iterator.hasNext() returns false, that invocation will also close resources related to the iterator.
        Parameters:
        requestId - the id of the iterator