Class Paginator
java.lang.Object
org.apache.drill.exec.store.http.paginator.Paginator
- Direct Known Subclasses:
IndexPaginator
,OffsetPaginator
,PagePaginator
This class is the abstraction for the Paginator class. There are
different pagination methods, however, all essentially require the query
engine to generate URLs to retrieve the next batch of data and also
to determine whether the URL has more data.
The Offset and Page paginators work either with a limit or without, but function
slightly differently. If a limit is specified and pushed down, the paginator will
generate a list of URLs with the appropriate pagination parameters. In the future
this could be parallelized, however in the V1 all these requests are run in series.
-
Field Summary
Modifier and TypeFieldDescriptionprotected okhttp3.HttpUrl.Builder
protected final int
protected final HttpPaginatorConfig.PaginatorMethod
protected final int
protected boolean
-
Constructor Summary
ConstructorDescriptionPaginator
(okhttp3.HttpUrl.Builder builder, HttpPaginatorConfig.PaginatorMethod mode, int pageSize, int limit) -
Method Summary
Modifier and TypeMethodDescriptiongetMode()
int
void
This method is used in pagination queries when no limit is present.void
setBuilder
(okhttp3.HttpUrl.Builder builder) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Iterator
forEachRemaining, hasNext, next, remove
-
Field Details
-
pageSize
protected final int pageSize -
MODE
-
limit
protected final int limit -
partialPageReceived
protected boolean partialPageReceived -
builder
protected okhttp3.HttpUrl.Builder builder
-
-
Constructor Details
-
Paginator
public Paginator(okhttp3.HttpUrl.Builder builder, HttpPaginatorConfig.PaginatorMethod mode, int pageSize, int limit)
-
-
Method Details
-
setBuilder
public void setBuilder(okhttp3.HttpUrl.Builder builder) -
notifyPartialPage
public void notifyPartialPage()This method is used in pagination queries when no limit is present. The intended flow is that if no limit is present, if the batch reader encounters a page which has less data than the page size, the batch reader should call this method to stop the Paginator from generating additional URLs to call. In the event that the API simply runs out of data, the reader will return false anyway and the pagination will stop. -
getPageSize
public int getPageSize() -
getMode
-