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

Expose RestController all handlers iterator. #11876

Merged
merged 3 commits into from
Jan 18, 2024

Conversation

dblock
Copy link
Member

@dblock dblock commented Jan 12, 2024

Description

Coming from #11843, expose just enough methods to be able to move that plugin implementation out of OpenSearch core.

  • Adds PathTrie#retrieveAll, an lazy-ish exhaustive iterator traversing the trie structure.
  • Make public MethodHandlers#getPath and getValidMethods.
  • Adds RestController#getAllHandlers() returning a method handlers iterator.

Related Issues

Check List

  • New functionality includes testing.
    • All tests pass
  • New functionality has been documented.
    • New functionality has javadoc added
  • Failing checks are inspected and point to the corresponding known issue(s) (See: Troubleshooting Failing Builds)
  • Commits are signed per the DCO using --signoff
  • Commit changes are listed out in CHANGELOG.md file (See: Changelog)
  • Public documentation issue/PR created

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.

Copy link
Contributor

github-actions bot commented Jan 12, 2024

Compatibility status:

Checks if related components are compatible with change 80063d9

Incompatible components

Incompatible components: [https:/opensearch-project/asynchronous-search.git, https:/opensearch-project/observability.git, https:/opensearch-project/performance-analyzer.git, https:/opensearch-project/reporting.git, https:/opensearch-project/performance-analyzer-rca.git, https:/opensearch-project/custom-codecs.git, https:/opensearch-project/sql.git, https:/opensearch-project/cross-cluster-replication.git]

Skipped components

Compatible components

Compatible components: [https:/opensearch-project/security-analytics.git, https:/opensearch-project/job-scheduler.git, https:/opensearch-project/opensearch-oci-object-storage.git, https:/opensearch-project/k-nn.git, https:/opensearch-project/common-utils.git, https:/opensearch-project/notifications.git, https:/opensearch-project/anomaly-detection.git, https:/opensearch-project/ml-commons.git, https:/opensearch-project/neural-search.git, https:/opensearch-project/security.git, https:/opensearch-project/geospatial.git, https:/opensearch-project/index-management.git, https:/opensearch-project/alerting.git]

Copy link
Contributor

❕ Gradle check result for 7f5349b: UNSTABLE

  • TEST FAILURES:
      2 org.opensearch.cluster.routing.allocation.decider.DiskThresholdDeciderIT.testIndexCreateBlockIsRemovedWhenAnyNodesNotExceedHighWatermarkWithAutoReleaseEnabled
      1 org.opensearch.remotestore.RemoteIndexPrimaryRelocationIT.testPrimaryRelocationWhileIndexing

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

Copy link

codecov bot commented Jan 12, 2024

Codecov Report

Attention: 4 lines in your changes are missing coverage. Please review.

Comparison is base (2f81c57) 71.33% compared to head (80063d9) 71.47%.
Report is 3 commits behind head on main.

Files Patch % Lines
...main/java/org/opensearch/common/path/PathTrie.java 78.94% 2 Missing and 2 partials ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main   #11876      +/-   ##
============================================
+ Coverage     71.33%   71.47%   +0.13%     
- Complexity    59362    59433      +71     
============================================
  Files          4923     4923              
  Lines        279189   279212      +23     
  Branches      40591    40595       +4     
============================================
+ Hits         199169   199560     +391     
+ Misses        63449    63032     -417     
- Partials      16571    16620      +49     

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

@dblock
Copy link
Member Author

dblock commented Jan 18, 2024

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

org.opensearch.search.sort.FieldSortIT.testSimpleSorts {p0={"search.concurrent_segment_search.enabled":"true"}}

#11929

Copy link
Contributor

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

@dblock
Copy link
Member Author

dblock commented Jan 18, 2024

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

#8947

Copy link
Contributor

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

@dblock
Copy link
Member Author

dblock commented Jan 18, 2024

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

#11933

Copy link
Contributor

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

@dblock
Copy link
Member Author

dblock commented Jan 18, 2024

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


> Task :plugins:transport-reactor-netty4:test
WARNING: Using incubator modules: jdk.incubator.vector

WARNING: A terminally deprecated method in java.lang.System has been called
WARNING: System::setSecurityManager has been called by org.gradle.api.internal.tasks.testing.worker.TestWorker (file:/home/ubuntu/.gradle/wrapper/dists/gradle-8.5-all/3zlzzgtsutfj0pbojr50n2l7z/gradle-8.5/lib/plugins/gradle-testing-****-8.5.jar)
WARNING: Please consider reporting this to the maintainers of org.gradle.api.internal.tasks.testing.worker.TestWorker
WARNING: System::setSecurityManager will be removed in a future release
Jan 18, 2024 8:27:54 PM sun.util.locale.provider.LocaleProviderAdapter <clinit>
WARNING: COMPAT locale provider will be removed in a future release

> Task :client:rest-high-level:asyncIntegTest
WARNING: Using incubator modules: jdk.incubator.vector

org.gradle.internal.remote.internal.ConnectException: Could not connect to server [ab4b7ead-95e2-434b-9d3f-1593704e0499 port:39181, addresses:[/127.0.0.1]]. Tried addresses: [/127.0.0.1].
	at org.gradle.internal.remote.internal.inet.TcpOutgoingConnector.connect(TcpOutgoingConnector.java:67)
	at org.gradle.internal.remote.internal.hub.MessageHubBackedClient.getConnection(MessageHubBackedClient.java:36)
	at org.gradle.process.internal.worker.child.SystemApplicationClassLoaderWorker.call(SystemApplicationClassLoaderWorker.java:103)
	at org.gradle.process.internal.worker.child.SystemApplicationClassLoaderWorker.call(SystemApplicationClassLoaderWorker.java:65)
	at worker.org.gradle.process.internal.worker.GradleWorkerMain.run(GradleWorkerMain.java:69)
	at worker.org.gradle.process.internal.worker.GradleWorkerMain.main(GradleWorkerMain.java:74)
Caused by: java.net.ConnectException: Connection refused
	at java.****/sun.nio.ch.Net.pollConnect(Native Method)
	at java.****/sun.nio.ch.Net.pollConnectNow(Net.java:682)
	at java.****/sun.nio.ch.SocketChannelImpl.finishTimedConnect(SocketChannelImpl.java:1191)
	at java.****/sun.nio.ch.SocketChannelImpl.blockingConnect(SocketChannelImpl.java:1233)
	at java.****/sun.nio.ch.SocketAdaptor.connect(SocketAdaptor.java:102)
	at org.gradle.internal.remote.internal.inet.TcpOutgoingConnector.tryConnect(TcpOutgoingConnector.java:81)
	at org.gradle.internal.remote.internal.inet.TcpOutgoingConnector.connect(TcpOutgoingConnector.java:54)
	... 5 more

#11935

Copy link
Contributor

❕ Gradle check result for 80063d9: UNSTABLE

  • TEST FAILURES:
      3 org.opensearch.cluster.routing.allocation.decider.DiskThresholdDeciderIT.testIndexCreateBlockIsRemovedWhenAnyNodesNotExceedHighWatermarkWithAutoReleaseEnabled

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

@dblock
Copy link
Member Author

dblock commented Jan 18, 2024

Not sure why "Minimum approval count" is still yellow. @reta @andrross care to re-approve?

@dblock dblock requested review from andrross and reta January 18, 2024 22:01
@andrross
Copy link
Member

Not sure why "Minimum approval count" is still yellow. @reta @andrross care to re-approve?

@dblock This approval mechanism is reset when you push a new commit, so you need to have approval on the latest commit in the PR to pass the check.

@andrross andrross merged commit 6ccb46b into opensearch-project:main Jan 18, 2024
42 checks passed
@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.x failed:

The process '/usr/bin/git' failed with exit code 128

To backport manually, run these commands in your terminal:

# Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/OpenSearch/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/OpenSearch/backport-2.x
# Create a new branch
git switch --create backport/backport-11876-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 6ccb46ba04b5d295af4c4da884068f1a5cf6cfba
# Push it to GitHub
git push --set-upstream origin backport/backport-11876-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/OpenSearch/backport-2.x

Then, create a pull request where the base branch is 2.x and the compare/head branch is backport/backport-11876-to-2.x.

dblock added a commit to dblock/OpenSearch that referenced this pull request Jan 18, 2024
* Expose RestController all handlers iterator.

Signed-off-by: dblock <[email protected]>

* Extract MethodHandlers interface.

Signed-off-by: dblock <[email protected]>

* Added CHANGELOG.

Signed-off-by: dblock <[email protected]>

---------

Signed-off-by: dblock <[email protected]>
(cherry picked from commit 6ccb46b)
dblock added a commit to dblock/OpenSearch that referenced this pull request Jan 18, 2024
* Expose RestController all handlers iterator.

Signed-off-by: dblock <[email protected]>

* Extract MethodHandlers interface.

Signed-off-by: dblock <[email protected]>

* Added CHANGELOG.

Signed-off-by: dblock <[email protected]>

---------

Signed-off-by: dblock <[email protected]>
(cherry picked from commit 6ccb46b)
dblock added a commit that referenced this pull request Jan 19, 2024
* Expose RestController all handlers iterator.

Signed-off-by: dblock <[email protected]>

* Extract MethodHandlers interface.

Signed-off-by: dblock <[email protected]>

* Added CHANGELOG.

Signed-off-by: dblock <[email protected]>

---------

Signed-off-by: dblock <[email protected]>
(cherry picked from commit 6ccb46b)
dblock added a commit to dblock/opensearch-api that referenced this pull request Jan 19, 2024
peteralfonsi pushed a commit to peteralfonsi/OpenSearch that referenced this pull request Mar 1, 2024
* Expose RestController all handlers iterator.

Signed-off-by: dblock <[email protected]>

* Extract MethodHandlers interface.

Signed-off-by: dblock <[email protected]>

* Added CHANGELOG.

Signed-off-by: dblock <[email protected]>

---------

Signed-off-by: dblock <[email protected]>
rayshrey pushed a commit to rayshrey/OpenSearch that referenced this pull request Mar 18, 2024
* Expose RestController all handlers iterator.

Signed-off-by: dblock <[email protected]>

* Extract MethodHandlers interface.

Signed-off-by: dblock <[email protected]>

* Added CHANGELOG.

Signed-off-by: dblock <[email protected]>

---------

Signed-off-by: dblock <[email protected]>
shiv0408 pushed a commit to Gaurav614/OpenSearch that referenced this pull request Apr 25, 2024
* Expose RestController all handlers iterator.

Signed-off-by: dblock <[email protected]>

* Extract MethodHandlers interface.

Signed-off-by: dblock <[email protected]>

* Added CHANGELOG.

Signed-off-by: dblock <[email protected]>

---------

Signed-off-by: dblock <[email protected]>
Signed-off-by: Shivansh Arora <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 2.x Backport to 2.x branch backport-failed v2.12.0 Issues and PRs related to version 2.12.0 v3.0.0 Issues and PRs related to version 3.0.0
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

3 participants