Class IteratorHandler

  • public class IteratorHandler
    extends Object
    Handler for storing iterators between invocations so that remote node can request data in chunks.
    • 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<> 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
        streamSupplier - the supplied stream
        intOps - the intermediate operations to perform on the stream
        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
        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.
        requestId - the id of the iterator