Skip to content

Add read and write optional enum sets methods to stream input and output#17556

Merged
dbwiddis merged 9 commits intoopensearch-project:mainfrom
q-andy:stream-optional-enumset
Mar 13, 2025
Merged

Add read and write optional enum sets methods to stream input and output#17556
dbwiddis merged 9 commits intoopensearch-project:mainfrom
q-andy:stream-optional-enumset

Conversation

@q-andy
Copy link
Copy Markdown
Contributor

@q-andy q-andy commented Mar 7, 2025

Description

In some plugins there are use cases to read and write optional EnumSets to and from StreamOutput/StreamInput, similar to existing readOptionalStringCollection/writeOptionalStringList methods.

Currently this is done with plugin specific private helper methods, but since this functionality is common to multiple plugins and we are planning on building similar systems for geospatial and search relevance lab plugins, it may be more elegant to consolidate them in core. Examples:

Related Issues

n/a

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.

Signed-off-by: Andy Qin <qinandy@amazon.com>
Signed-off-by: Andy Qin <qinandy@amazon.com>
@q-andy q-andy force-pushed the stream-optional-enumset branch from b386dbb to 2087291 Compare March 7, 2025 23:55
Signed-off-by: Andy Qin <qinandy@amazon.com>
@q-andy q-andy force-pushed the stream-optional-enumset branch from 8df906d to ad0c5ce Compare March 7, 2025 23:57
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 8, 2025

❌ Gradle check result for ad0c5ce: 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?

Signed-off-by: Andy Qin <qinandy@amazon.com>
@q-andy q-andy force-pushed the stream-optional-enumset branch from bf3a8f5 to f65cfc8 Compare March 9, 2025 23:43
@q-andy
Copy link
Copy Markdown
Contributor Author

q-andy commented Mar 9, 2025

@dbwiddis thanks for the review, I added unit tests to the BaseStreamTests in core so all the StreamInput implementations should inherit tests as well

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 9, 2025

❌ Gradle check result for f65cfc8: 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?

Signed-off-by: Andy Qin <qinandy@amazon.com>
@q-andy q-andy force-pushed the stream-optional-enumset branch from f65cfc8 to 9ff9553 Compare March 9, 2025 23:59
@github-actions
Copy link
Copy Markdown
Contributor

❌ Gradle check result for 9ff9553: 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?

Copy link
Copy Markdown
Member

@dbwiddis dbwiddis left a comment

Choose a reason for hiding this comment

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

LGTM pending changelog

@dbwiddis
Copy link
Copy Markdown
Member

DCO failing, looks like no email address:

Commit sha: 78de87a, Author: Andy Qin, Committer: Andy Qin; The sign-off is missing.

@github-actions
Copy link
Copy Markdown
Contributor

❕ Gradle check result for 78de87a: UNSTABLE

  • TEST FAILURES:
      1 org.opensearch.snapshots.DedicatedClusterSnapshotRestoreIT.testSnapshotWithStuckNode

Please review all flaky tests that succeeded after retry and create an issue if one does not already exist to track the flaky failure.

@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 11, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 72.38%. Comparing base (2ee8660) to head (221f397).
Report is 3 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main   #17556      +/-   ##
============================================
- Coverage     72.43%   72.38%   -0.05%     
- Complexity    65694    65719      +25     
============================================
  Files          5311     5311              
  Lines        304937   304945       +8     
  Branches      44226    44226              
============================================
- Hits         220872   220745     -127     
- Misses        65912    66061     +149     
+ Partials      18153    18139      -14     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Signed-off-by: Andy Qin <qinandy@amazon.com>
@q-andy q-andy force-pushed the stream-optional-enumset branch from 78de87a to 221f397 Compare March 11, 2025 21:12
@github-actions
Copy link
Copy Markdown
Contributor

❌ Gradle check result for 221f397: 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?

@github-actions
Copy link
Copy Markdown
Contributor

❕ Gradle check result for 221f397: UNSTABLE

  • TEST FAILURES:
      1 org.opensearch.snapshots.DedicatedClusterSnapshotRestoreIT.testSnapshotWithStuckNode

Please review all flaky tests that succeeded after retry and create an issue if one does not already exist to track the flaky failure.

@dbwiddis dbwiddis merged commit e306d51 into opensearch-project:main Mar 13, 2025
32 checks passed
vinaykpud pushed a commit to vinaykpud/OpenSearch that referenced this pull request Mar 18, 2025
…put (opensearch-project#17556)

* Add read and write optional enum sets to stream

Signed-off-by: Andy Qin <qinandy@amazon.com>

* Only write set if it is non-empty

Signed-off-by: Andy Qin <qinandy@amazon.com>

* Update javadoc

Signed-off-by: Andy Qin <qinandy@amazon.com>

* Read false presence flag as empty set

Co-authored-by: Daniel Widdis <widdis@gmail.com>
Signed-off-by: Andy <qinandy@amazon.com>

* Update javadoc

Signed-off-by: Andy Qin <qinandy@amazon.com>

* Add unit tests

Signed-off-by: Andy Qin <qinandy@amazon.com>

* Fix typos

Signed-off-by: Andy Qin <qinandy@amazon.com>

* Update changelog

Signed-off-by: Andy Qin <qinandy@amazon.com>

---------

Signed-off-by: Andy Qin <qinandy@amazon.com>
Signed-off-by: Andy <qinandy@amazon.com>
Co-authored-by: Daniel Widdis <widdis@gmail.com>
Signed-off-by: Vinay Krishna Pudyodu <vinkrish.neo@gmail.com>
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.

2 participants