Class RunListData
- Direct Known Subclasses:
BuildListTable,BuildTimeTrend
RunList as JSON.
Runs are expected newest first, ordered by Run.getTimeInMillis(), as RunList provides them.
A page holds matching runs strictly older than the olderThan cursor; the response's next is the cursor
for the following page, or null once there are no more runs.
Runs sharing a timestamp are never split across pages, so the cursor is an exact boundary.
A filter (such as runs related to a user) may reject many runs before a page is full,
so a page may be cut short once SCAN_BUDGET_MS has elapsed, in which case partial is set.
The cursor then covers every run examined, matching or not, and the client should request the rest of the page,
with limit set to the runs it still needs, until it has pageSize runs.
The budget starts at the first run older than the cursor, so that reaching the cursor does not use it up.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract voidorg.kohsuke.stapler.HttpResponseServes one page of runs.org.kohsuke.stapler.HttpResponseserve(Iterable<? extends Run<?, ?>> builds, Predicate<? super Run<?, ?>> filter, String olderThan, String limit) Serves one page of the runs matching a filter.
-
Field Details
-
PAGE_SIZE
public static int PAGE_SIZE -
SCAN_BUDGET_MS
public static long SCAN_BUDGET_MS
-
-
Constructor Details
-
RunListData
public RunListData()
-
-
Method Details
-
serve
public org.kohsuke.stapler.HttpResponse serve(Iterable<? extends Run<?, ?>> builds, @CheckForNull String olderThan, @CheckForNull String limit) Serves one page of runs.- Parameters:
builds- runs, newest firstolderThan- cursor from a previous page'snext, ornullfor the first page
-
serve
public org.kohsuke.stapler.HttpResponse serve(Iterable<? extends Run<?, ?>> builds, Predicate<? super Run<?, ?>> filter, @CheckForNull String olderThan, @CheckForNull String limit) Serves one page of the runs matching a filter.- Parameters:
builds- runs, newest first, not yet filtered, so that the scan budget covers the runs the filter rejectsfilter- selects the runs to includeolderThan- cursor from a previous page'snext, ornullfor the first pagelimit- the runs still needed to fill a page cut short, ornullfor a whole page
-
calculate
-