Migrate NodeHealthAPI from homegrown @EndPoint to JAX-RS; add ref guide link#4171
Open
epugh wants to merge 9 commits intoapache:mainfrom
Open
Migrate NodeHealthAPI from homegrown @EndPoint to JAX-RS; add ref guide link#4171epugh wants to merge 9 commits intoapache:mainfrom
epugh wants to merge 9 commits intoapache:mainfrom
Conversation
Co-authored-by: epugh <22395+epugh@users.noreply.github.com>
Co-authored-by: epugh <22395+epugh@users.noreply.github.com>
…ef guide Co-authored-by: epugh <22395+epugh@users.noreply.github.com>
8 tasks
Contributor
Author
|
Some outstanding questions: 1) there is a more mock and less mock versions of the same test. Which do we prefer? 2) Does this seem like a reasonable pattern for the conversion? |
Contributor
Author
|
I wish I didnt' have TWO ways of writing tests, one for cloud and one for standalone... sigh. |
dsmiley
reviewed
Feb 28, 2026
solr/api/src/java/org/apache/solr/client/api/model/NodeHealthResponse.java
Outdated
Show resolved
Hide resolved
solr/core/src/java/org/apache/solr/handler/admin/HealthCheckHandler.java
Outdated
Show resolved
Hide resolved
Contributor
Author
|
tests all pass! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Migrates
NodeHealthAPI— the last node-level V2 API still using Solr's homegrown@EndPointannotation — to standard JAX-RS, following the same pattern asNodeLogging,GetPublicKey, etc.Design
The logic stays in
HealthCheckHandler(minimising diff surface).NodeHealthAPIis a thin JAX-RS wrapper (~60 lines) that delegates entirely to it.Key changes
solr/api— NewNodeHealthApiinterface (@Path,@GET,@Operation) andNodeHealthResponsemodel (status,message,num_cores_unhealthy)NodeHealthAPI— Replaces@EndPointwith JAX-RS; injectsCoreContainer, delegates toHealthCheckHandlerHealthCheckHandler— Logic unchanged; addspublic NodeHealthResponse checkNodeHealth(Boolean, Integer)as the shared entry point for both v1 (handleRequestBody) and v2 (NodeHealthAPI); switches togetJerseyResources()/ emptygetApis()V2NodeAPIMappingTest— Removes the now-obsolete@EndPoint/ApiBagrouting test for healthNodeHealthAPITest— New Mockito unit tests for the API classNodeHealthAPITest2— New mock-free integration tests: cloud-mode via realMiniSolrCloudCluster, legacy mode via embeddedCoreContainerbuilt fromNodeConfigimplicit-requesthandlers.adoc— Health section now links to bothHealthCheckHandler(v1) andNodeHealthAPI(v2) javadocs