Class PageableIterable<T>

java.lang.Object
com.datastax.astra.client.model.PageableIterable<T>
Type Parameters:
T - type of the document used in the associated collection.
All Implemented Interfaces:
Closeable, AutoCloseable
Direct Known Subclasses:
DistinctIterable, FindIterable

public abstract class PageableIterable<T> extends Object implements Closeable
Helping Iteration on Pages and Documents for DataApi.
  • Field Details

    • collection

      protected Collection<T> collection
      Reference to the collection in use.
    • totalItemProcessed

      protected final AtomicInteger totalItemProcessed
      Check host many has been processed (skip and limit support)
    • active

      protected boolean active
      The iterable is active and progressing on the results.
    • exhausted

      protected boolean exhausted
      the Iterator is exhausted
    • currentPage

      protected Page<T> currentPage
      The current page in use.
    • currentPageAvailable

      protected int currentPageAvailable
      Number of items still available to retrieve in this page.
    • filter

      protected Filter filter
      Original command, we will edit it to iterate on pages.
    • options

      protected FindOptions options
      Original command, we will edit it to iterate on pages.
  • Constructor Details

    • PageableIterable

      protected PageableIterable()
      Default constructor.
  • Method Details

    • fetchNextPage

      public boolean fetchNextPage()
      Fetch the next page if the result.
      Returns:
      if a new page has been found.
    • getSortVector

      public Optional<float[]> getSortVector()
      Get current page sort Vector When available.
      Returns:
      sortVector if asked in previous request and iterator is still active.
    • close

      public void close()
      When no more items available.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable