zpinto commented on code in PR #2919:
URL: https://github.com/apache/helix/pull/2919#discussion_r1764027027
##########
helix-rest/src/main/java/org/apache/helix/rest/client/CustomRestClientImpl.java:
##########
@@ -93,15 +98,52 @@ public Map<String, Boolean>
getPartitionStoppableCheck(String baseUrl, List<Stri
if (partitions != null) {
payLoads.put(PARTITIONS, partitions);
}
- JsonConverter jsonConverter = jsonNode -> {
- Map<String, Boolean> result = new HashMap<>();
- jsonNode.fields().forEachRemaining(
- kv -> result.put(kv.getKey(),
kv.getValue().get(IS_HEALTHY_FIELD).asBoolean()));
- return result;
- };
+ JsonConverter<Boolean> jsonConverter = this::extractPartitionBooleanMap;
return handleResponse(post(url, payLoads), jsonConverter);
}
+ @Override
+ public Map<String, List<String>> getAggregatedStoppableCheck(String baseUrl,
+ List<String> instances, Set<String> toBeStoppedInstances, String
clusterId,
Review Comment:
Why do we use clusterId in some places and clusterName in others?
##########
helix-core/src/main/java/org/apache/helix/model/RESTConfig.java:
##########
@@ -61,12 +63,12 @@ public String get(SimpleFields property) {
}
/**
- * Get the base restful endpoint of the instance
+ * Resolves the customized health URL by replacing the wildcard with the
instance's name
*
* @param instance The instance
* @return The base restful endpoint
*/
- public String getBaseUrl(String instance) {
+ public String resolveInstanceHealthUrl(String instance) {
Review Comment:
This is backwards incompatible change to rename public method.
##########
helix-core/src/main/java/org/apache/helix/model/RESTConfig.java:
##########
@@ -83,4 +85,18 @@ public String getBaseUrl(String instance) {
return baseUrl.replace("*", instanceVip);
}
+
+ /**
+ * Retrieves the configured health URL if no wildcard is present.
+ * Returns an empty Optional if the URL contains a wildcard.
+ *
+ * @return Optional containing the exact configured URL, or empty if a
wildcard is present.
+ */
+ public Optional<String> getConfiguredHealthUrl() {
Review Comment:
Can we think of a more descriptive name for this?
--
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]