Class RecordCursorIterator<T>

    • Method Detail

      • hasNext

        public boolean hasNext()
        Synchronously check whether there are more records available from the cursor.
        Specified by:
        hasNext in interface AsyncIterator<T>
        Specified by:
        hasNext in interface Iterator<T>
        Returns:
        true if next() would return a record and false otherwise
      • next

        @Nullable
        public T next()
        Return the next value. May only be called after the future from onHasNext() has completed to true (or equivalently after hasNext() has returned true).
        Specified by:
        next in interface AsyncIterator<T>
        Specified by:
        next in interface Iterator<T>
        Returns:
        the next value
      • getContinuation

        @Nullable
        public byte[] getContinuation()
        Get a byte string that can be used to continue a query after the last record returned. Returns null if the underlying source is completely exhausted, independent of any limit passed to the cursor creator. Since such creators generally accept null to mean no continuation, that is, start from the beginning, one must check for null from getContinuation() to keep from starting over. Result is not always defined if called before the onHasNext() has been called, before the returned future has completed, or after it has completed to true but before next() has been called. That is, a continuation is only guaranteed when called "between" records from a while (hasNext) next loop or after its end. If configured to do so, an IllegalContinuationAccessChecker will be used to throw an exception if a continuation is accessed at the wrong time.
        Returns:
        opaque byte array denoting where the cursor should pick up. This can be passed back into a new cursor of the same type, with all other parameters remaining the same.
      • getNoNextReason

        @Nonnull
        public RecordCursor.NoNextReason getNoNextReason()
        Get the reason that the cursor has reached the end and returned false for hasNext(). If hasNext was not called or returned true last time, the result is undefined and may be an exception.
        Returns:
        the reason that the cursor stopped