dineshchitlangia commented on a change in pull request #1102:
URL: https://github.com/apache/hadoop-ozone/pull/1102#discussion_r443294463
##########
File path:
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/safemode/ContainerSafeModeRule.java
##########
@@ -125,4 +125,10 @@ protected void process(NodeRegistrationContainerReport
reportsProto) {
protected void cleanup() {
containerMap.clear();
}
+
+ @Override
+ public String getStatusText() {
+ return "currentContainerThreshold " + getCurrentContainerThreshold()
+ + " should >= safeModeCutoff " + this.safeModeCutoff;
Review comment:
```suggestion
+ " >= safeModeCutoff " + this.safeModeCutoff;
```
##########
File path:
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/safemode/DataNodeSafeModeRule.java
##########
@@ -79,4 +79,10 @@ protected void process(NodeRegistrationContainerReport
reportsProto) {
protected void cleanup() {
registeredDnSet.clear();
}
+
+ @Override
+ public String getStatusText() {
+ return "registeredDns " + this.registeredDns + " should >= requiredDns "
Review comment:
```suggestion
return "registeredDns " + this.registeredDns + " >= requiredDns "
```
##########
File path:
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/safemode/SCMSafeModeManager.java
##########
@@ -272,6 +273,21 @@ public boolean getInSafeMode() {
return inSafeMode.get();
}
+ /**
+ * Get the safe mode statuses of each rules.
Review comment:
```suggestion
* Get the safe mode status of all rules.
```
##########
File path:
hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/scm/client/ScmClient.java
##########
@@ -210,6 +212,15 @@ Pipeline
createReplicationPipeline(HddsProtos.ReplicationType type,
*/
boolean inSafeMode() throws IOException;
+ /**
+ * Get the safe mode statuses of each rules.
Review comment:
```suggestion
* Get the safe mode status of all rules.
```
##########
File path:
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/safemode/ContainerSafeModeRule.java
##########
@@ -125,4 +125,10 @@ protected void process(NodeRegistrationContainerReport
reportsProto) {
protected void cleanup() {
containerMap.clear();
}
+
+ @Override
+ public String getStatusText() {
+ return "currentContainerThreshold " + getCurrentContainerThreshold()
+ + " should >= safeModeCutoff " + this.safeModeCutoff;
+ }
}
Review comment:
```suggestion
}
```
##########
File path:
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/safemode/DataNodeSafeModeRule.java
##########
@@ -79,4 +79,10 @@ protected void process(NodeRegistrationContainerReport
reportsProto) {
protected void cleanup() {
registeredDnSet.clear();
}
+
+ @Override
+ public String getStatusText() {
+ return "registeredDns " + this.registeredDns + " should >= requiredDns "
+ + this.requiredDns;
+ }
}
Review comment:
```suggestion
}
```
##########
File path:
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/safemode/HealthyPipelineSafeModeRule.java
##########
@@ -150,4 +150,11 @@ public int getCurrentHealthyPipelineCount() {
public int getHealthyPipelineThresholdCount() {
return healthyPipelineThresholdCount;
}
+
+ @Override
+ public String getStatusText() {
+ return "currentHealthyPipelineCount " + this.currentHealthyPipelineCount
+ + " should >= healthyPipelineThresholdCount "
Review comment:
```suggestion
+ " >= healthyPipelineThresholdCount "
```
##########
File path:
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/server/StorageContainerManager.java
##########
@@ -1110,4 +1111,13 @@ public SCMMetadataStore getScmMetadataStore() {
public NetworkTopology getClusterMap() {
return this.clusterMap;
}
+
+ /**
+ * Get the safe mode statuses of each rules.
Review comment:
```suggestion
* Get the safe mode status of all rules.
```
##########
File path:
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/safemode/HealthyPipelineSafeModeRule.java
##########
@@ -150,4 +150,11 @@ public int getCurrentHealthyPipelineCount() {
public int getHealthyPipelineThresholdCount() {
return healthyPipelineThresholdCount;
}
+
+ @Override
+ public String getStatusText() {
+ return "currentHealthyPipelineCount " + this.currentHealthyPipelineCount
+ + " should >= healthyPipelineThresholdCount "
+ + this.healthyPipelineThresholdCount;
+ }
}
Review comment:
```suggestion
}
```
##########
File path:
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/safemode/OneReplicaPipelineSafeModeRule.java
##########
@@ -134,4 +134,11 @@ public int getThresholdCount() {
public int getCurrentReportedPipelineCount() {
return currentReportedPipelineCount;
}
+
+ @Override
+ public String getStatusText() {
+ return "currentReportedPipelineCount "
+ + this.currentReportedPipelineCount + " should >= thresholdCount "
+ + this.thresholdCount;
+ }
}
Review comment:
```suggestion
}
```
##########
File path:
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/safemode/SCMSafeModeManager.java
##########
@@ -272,6 +273,21 @@ public boolean getInSafeMode() {
return inSafeMode.get();
}
+ /**
+ * Get the safe mode statuses of each rules.
+ *
+ * @return map of rule statuses.
+ */
+ public Map<String, Pair<Boolean, String>> getRuleStatus() {
+ Map<String, Pair<Boolean, String>> map =
+ new HashMap<>();
Review comment:
```suggestion
Map<String, Pair<Boolean, String>> map = new HashMap<>();
```
##########
File path:
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/safemode/SafeModeExitRule.java
##########
@@ -111,4 +111,9 @@ protected SafeModeMetrics getSafeModeMetrics() {
return safeModeManager.getSafeModeMetrics();
}
+ /**
+ * Return's the status text of this rule.
Review comment:
```suggestion
* Returns the status text of the rule.
```
##########
File path:
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/safemode/OneReplicaPipelineSafeModeRule.java
##########
@@ -134,4 +134,11 @@ public int getThresholdCount() {
public int getCurrentReportedPipelineCount() {
return currentReportedPipelineCount;
}
+
+ @Override
+ public String getStatusText() {
+ return "currentReportedPipelineCount "
+ + this.currentReportedPipelineCount + " should >= thresholdCount "
Review comment:
```suggestion
+ this.currentReportedPipelineCount + " >= thresholdCount "
```
##########
File path:
hadoop-hdds/tools/src/main/java/org/apache/hadoop/hdds/scm/cli/SafeModeCheckSubcommand.java
##########
@@ -43,6 +46,10 @@
@ParentCommand
private SafeModeCommands parent;
+ @CommandLine.Option(names = {"--verbose"},
+ description = "More verbose output. Show the status of rules.")
Review comment:
```suggestion
description = "Show detailed status of rules.")
```
----------------------------------------------------------------
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:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]