Skip to content

delegate getMin/getMax methods for ExitableTerms#20775

Open
HUSTERGS wants to merge 1 commit intoopensearch-project:mainfrom
HUSTERGS:delegate_terms
Open

delegate getMin/getMax methods for ExitableTerms#20775
HUSTERGS wants to merge 1 commit intoopensearch-project:mainfrom
HUSTERGS:delegate_terms

Conversation

@HUSTERGS
Copy link
Contributor

@HUSTERGS HUSTERGS commented Mar 4, 2026

Description

ExitableTerms should delegate getMin/getMax methods, or else the getMax() from

Terms terms = MultiTerms.getTerms(reader, fieldType.name());
if (terms == null) {
return null;
}
return terms.getMin() != null ? new MinAndMax<>(terms.getMin(), terms.getMax()) : null;

will call the default implementation, which is a slow path, and will get a flamegraph like below

image

Related Issues

Resolves #[Issue number to be closed when this PR is merged]

Check List

  • Functionality includes testing.
  • API changes companion pull request created, if applicable.
  • Public documentation issue/PR created, if applicable.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 4, 2026

PR Reviewer Guide 🔍

(Review updated until commit 2e85d39)

Here are some key observations to aid the review process:

🧪 No relevant tests
🔒 No security concerns identified
✅ No TODO sections
🔀 No multiple PR themes
⚡ Recommended focus areas for review

Missing Tests

The PR adds getMin() and getMax() delegation methods to ExitableTerms but includes no unit or integration tests to verify the delegation behavior or confirm the performance improvement. The checklist also acknowledges that functionality testing is not included.

@Override
public BytesRef getMin() throws IOException {
    return in.getMin();
}

@Override
public BytesRef getMax() throws IOException {
    return in.getMax();
}

Signed-off-by: gesong.samuel <gesong.samuel@bytedance.com>
@github-actions
Copy link
Contributor

github-actions bot commented Mar 4, 2026

Persistent review updated to latest commit 2e85d39

@github-actions
Copy link
Contributor

github-actions bot commented Mar 4, 2026

❌ Gradle check result for 2e85d39: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant