epugh commented on code in PR #4171:
URL: https://github.com/apache/solr/pull/4171#discussion_r2917691210
##########
solr/core/src/java/org/apache/solr/handler/admin/HealthCheckHandler.java:
##########
@@ -100,138 +103,125 @@ public CoreContainer getCoreContainer() {
@Override
public void handleRequestBody(SolrQueryRequest req, SolrQueryResponse rsp)
throws Exception {
rsp.setHttpCaching(false);
+ final Boolean requireHealthyCores =
req.getParams().getBool(PARAM_REQUIRE_HEALTHY_CORES);
+ final Integer maxGenerationLag =
+ req.getParams().getInt(HealthCheckRequest.PARAM_MAX_GENERATION_LAG);
+ V2ApiUtils.squashIntoSolrResponseWithoutHeader(
+ rsp, checkNodeHealth(requireHealthyCores, maxGenerationLag));
+ }
- // Core container should not be null and active (redundant check)
+ /**
+ * Performs the node health check and returns the result as a {@link
NodeHealthResponse}.
+ *
+ * <p>This method is the shared implementation used by both the v1 {@link
#handleRequestBody} path
+ * and the v2 JAX-RS {@link NodeHealthAPI}.
+ */
+ public NodeHealthResponse checkNodeHealth(Boolean requireHealthyCores,
Integer maxGenerationLag) {
Review Comment:
done
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]