Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(snomed.datastore): Adjust page size dynamically for streaming queries #1187

Merged
merged 12 commits into from
Jul 12, 2023

Conversation

apeteri
Copy link
Member

@apeteri apeteri commented Jul 10, 2023

The limit should never exceed the value of result_window configured for Elasticsearch.

...requested items is larger than the currently configured maximum
result window.
@apeteri apeteri self-assigned this Jul 10, 2023
@codecov
Copy link

codecov bot commented Jul 10, 2023

Codecov Report

Patch coverage: 69.83% and no project coverage change.

Comparison is base (10e0229) 64.01% compared to head (3ae1053) 64.01%.

Additional details and impacted files
@@            Coverage Diff            @@
##                8.x    #1187   +/-   ##
=========================================
  Coverage     64.01%   64.01%           
- Complexity    12805    12810    +5     
=========================================
  Files          1764     1765    +1     
  Lines         59773    59836   +63     
  Branches       5528     5529    +1     
=========================================
+ Hits          38264    38307   +43     
- Misses        19132    19151   +19     
- Partials       2377     2378    +1     
Impacted Files Coverage Δ
...wowl/core/conceptmap/ConceptMapCompareRequest.java 0.00% <0.00%> (ø)
...owl/core/request/SearchResourceRequestBuilder.java 91.89% <ø> (ø)
...ational/snowowl/snomed/core/cli/SnomedCommand.java 0.00% <0.00%> (ø)
...tastore/request/SnomedMemberOfFieldFixRequest.java 0.00% <0.00%> (ø)
...store/request/SnomedQueryMemberCreateDelegate.java 38.09% <0.00%> (-0.93%) ⬇️
...snomed/reasoner/request/OntologyExportRequest.java 0.00% <0.00%> (ø)
...astore/index/taxonomy/ReasonerTaxonomyBuilder.java 54.25% <60.00%> (ø)
...nowowl/snomed/reasoner/request/SaveJobRequest.java 36.75% <80.00%> (ø)
...m/b2international/index/es/EsDocumentSearcher.java 73.64% <100.00%> (-0.24%) ⬇️
...ional/snowowl/core/bundle/BundleDeleteRequest.java 100.00% <100.00%> (ø)
... and 20 more

... and 4 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

...first batch did not produce any results (eg. due to an impossible
"searchAfter" value).

In these cases remainingCount is equal to totalHitCount, but the "while"
loop exits immediately as there is no "next searchAfter" value to
extract.
Copy link
Member

@nagyo nagyo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@cmark cmark added the on hold label Jul 11, 2023
final Query<Data> query = Query.select(Data.class)
.where(Expressions.matchAll())
.limit(1000)
.limit(pageSize)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the purpose here was to actually page through the results with the page size of 1000, now we are going to fetch it in one go, right?

@@ -194,7 +194,7 @@ public <T> Hits<T> search(Query<T> query) throws IOException {
final boolean isLiveStreaming = !Strings.isNullOrEmpty(query.getSearchAfter());
if (isLocalStreaming) {
checkArgument(!isLiveStreaming, "Cannot use searchAfter when requesting more items (%s) than the configured result window (%s).", limit, resultWindow);
} else if (isLiveStreaming) {
} if (isLiveStreaming) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This block looks a bit weird.

@apeteri apeteri changed the title feat(snomed.datastore): Allow using searchAfter when the number of... feat(snomed.datastore): Adjust page size dynamically for streaming queries Jul 11, 2023
Copy link
Member

@cmark cmark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🥓

@cmark cmark added bug and removed on hold labels Jul 12, 2023
@cmark cmark merged commit 0e63d9c into 8.x Jul 12, 2023
@cmark cmark deleted the improvement/allow-local-streaming-with-limit branch July 12, 2023 07:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants