goiri commented on a change in pull request #2360:
URL: https://github.com/apache/hadoop/pull/2360#discussion_r499727495



##########
File path: 
hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/RouterClientProtocol.java
##########
@@ -1799,10 +1800,14 @@ public void satisfyStoragePolicy(String path) throws 
IOException {
   }
 
   @Override
-  public HAServiceProtocol.HAServiceState getHAServiceState()
-      throws IOException {
-    rpcServer.checkOperation(NameNode.OperationCategory.READ, false);
-    return null;
+  public HAServiceProtocol.HAServiceState getHAServiceState() {
+    try {
+      // check safemode or not
+      rpcServer.checkOperation(NameNode.OperationCategory.WRITE);

Review comment:
       Instead of using exceptions, can we extract the code from 
checkSafeMode() so we can just check the state?




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

Reply via email to