Skip to content

Commit

Permalink
Re: NationalSecurityAgency#879 Indicate whether we ar returning less …
Browse files Browse the repository at this point in the history
…than the requested page size
  • Loading branch information
plainolneesh committed May 11, 2021
1 parent 5ba372b commit b1498b3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Expand Up @@ -357,7 +357,7 @@ public QueryWizardStep3Response showQueryWizardStep3(@Required("logicName") @Pat
* @ResponseHeader X-OperationTimeInMS time spent on the server performing the operation, does not account for network or result serialization
* @ResponseHeader X-query-page-number page number returned by this call
* @ResponseHeader X-query-last-page if true then there are no more pages for this query, caller should call close()
* @ResponseHeader X-Partial-Results true if the page contains less than the requested number of results
* @ResponseHeader X-Partial-Results true if the page contains less than the requested number of resultsz
*
* @HTTP 200 success
* @HTTP 204 success and no results
Expand Down
Expand Up @@ -212,12 +212,17 @@ public ResultsPage next() throws Exception {
log.info("Query requested page size had been reached, aborting query.next call");
break;
}
//if the number of results returned less than requested, then break out
if (currentPageCount < this.logic.getMaxPageSize()) {
log.info("Query requested page size returned less than requested, aborting query.next call");
break;
}
// if the logic had a max page size and we have reached that, then break out
if (this.logic.getMaxPageSize() > 0 && currentPageCount >= this.logic.getMaxPageSize()) {
log.info("Query logic max page size has been reached, aborting query.next call");
break;
}
// if the logic had a page byte trigger and we have readed that, then break out
// if the logic had a page byte trigger and we have reached that, then break out
if (this.logic.getPageByteTrigger() > 0 && currentPageBytes >= this.logic.getPageByteTrigger()) {
log.info("Query logic max page byte trigger has been reached, aborting query.next call");
hitPageByteTrigger = true;
Expand Down

0 comments on commit b1498b3

Please sign in to comment.