You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@helix.apache.org by GitBox <gi...@apache.org> on 2021/03/24 22:32:54 UTC

[GitHub] [helix] NealSun96 commented on a change in pull request #1680: Use specific message for stoppable API partitions in initial state

NealSun96 commented on a change in pull request #1680:
URL: https://github.com/apache/helix/pull/1680#discussion_r600917274



##########
File path: helix-core/src/main/java/org/apache/helix/util/InstanceValidationUtil.java
##########
@@ -53,6 +54,9 @@
   public static Set<String> UNHEALTHY_STATES =
       ImmutableSet.of(HelixDefinedState.DROPPED.name(), HelixDefinedState.ERROR.name());
 
+  static final String UNHEALTHY_PARTITION = "UNHEALTHY_PARTITION";
+  static final String PARTITION_INITIAL_STATE_FAIL = "PARTITION_INITIAL_STATE_FAIL";

Review comment:
       NIT: could we have comments here explaining the definitions and contexts. For example: why is it a "fail" for partitions in initial states?

##########
File path: helix-rest/src/main/java/org/apache/helix/rest/server/service/InstanceServiceImpl.java
##########
@@ -275,11 +275,17 @@ private StoppableCheck performCustomInstanceCheck(String clusterId, String insta
         _dataAccessor.getChildValues(_dataAccessor.keyBuilder().externalViews(), true);
     Map<String, StoppableCheck> instanceStoppableChecks = new HashMap<>();
     for (String instanceName : instances) {
-      List<String> unHealthyPartitions = InstanceValidationUtil
+      Map<String, List<String>> unHealthyPartitions = InstanceValidationUtil
           .perPartitionHealthCheck(externalViews, allPartitionsHealthOnLiveInstance, instanceName,
               _dataAccessor);
+
+      List <String> unHealthyPartitionsList = new ArrayList<>();
+      for (String partitionName : unHealthyPartitions.keySet()) {
+        for (String reason : unHealthyPartitions.get(partitionName))
+          unHealthyPartitionsList.add(reason.toUpperCase() + ":" + partitionName);

Review comment:
       Coding convention may say that you need the brace brackets here. :) 




-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org