adoroszlai commented on code in PR #5760:
URL: https://github.com/apache/ozone/pull/5760#discussion_r1425186024


##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/safemode/HealthyPipelineSafeModeRule.java:
##########
@@ -56,6 +57,8 @@ public class HealthyPipelineSafeModeRule extends 
SafeModeExitRule<Pipeline> {
   private final PipelineManager pipelineManager;
   private final int minHealthyPipelines;
   private final SCMContext scmContext;
+  private Set<PipelineID> pipelineIDSet;

Review Comment:
   `pipelineIDSet` should be cleared in `cleanup`:
   
   
https://github.com/apache/ozone/blob/a05bfb9ad53ca745e75362729993b3f6083d61f1/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/safemode/HealthyPipelineSafeModeRule.java#L187-L189
   
   Also, to be consistent with `processedPipelineIDs`, I suggest 
`pipelineIDSet` to be `final`.  Instead of assignment in `initializeRule`, it 
could replace contents (`clear()`, `addAll()`).



##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/safemode/HealthyPipelineSafeModeRule.java:
##########
@@ -193,9 +200,20 @@ public synchronized int getHealthyPipelineThresholdCount() 
{
 
   @Override
   public String getStatusText() {
-    return String.format("healthy Ratis/THREE pipelines (=%d) >= "
-            + "healthyPipelineThresholdCount (=%d)",
-        getCurrentHealthyPipelineCount(),
+    String status = String.format(
+        "healthy Ratis/THREE pipelines (=%d) >= healthyPipelineThresholdCount" 
+
+            " (=%d)", getCurrentHealthyPipelineCount(),
         getHealthyPipelineThresholdCount());
+    Set<PipelineID> samplePipelines = pipelineIDSet.stream()
+        .filter(element -> !processedPipelineIDs.contains(element))
+        .limit(SAMPLE_PIPELINE_DISPLAY_LIMIT)
+        .collect(Collectors.toSet());

Review Comment:
   Instead of filtering here, we could remove pipeline IDs as they are being 
processed:
   
   
https://github.com/apache/ozone/blob/a05bfb9ad53ca745e75362729993b3f6083d61f1/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/safemode/HealthyPipelineSafeModeRule.java#L130-L137



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

Reply via email to