petersomogyi commented on a change in pull request #55: HBASE-24039 
URL: 
https://github.com/apache/hbase-operator-tools/pull/55#discussion_r403939591
 
 

 ##########
 File path: hbase-hbck2/src/main/java/org/apache/hbase/HBCK2.java
 ##########
 @@ -133,6 +143,19 @@ void checkHBCKSupport(ClusterConnection connection, 
String cmd, String ... suppo
     }
   }
 
+  void checkFunctionSupported(ClusterConnection connection, String cmd) throws 
IOException {
+    if (skipCheck) {
+      LOG.info("Skipped {} command version check; 'skip' set", cmd);
+      return;
+    }
+    List<Method> methods = 
Arrays.asList(connection.getHbck().getClass().getDeclaredMethods());
+    List<String> finalCmds = functionNameMap.getOrDefault(cmd, 
Collections.singletonList(cmd));
+    boolean supported = methods.stream().anyMatch(method ->  
finalCmds.contains(method.getName()));
+    if (!supported) {
+      throw new UnsupportedOperationException("Unsupported command" + cmd);
 
 Review comment:
   nit: missing space from concatenation.
   
   Error message would be better like "This HBase cluster does not support 
command: <cmd>". For me the original could also mean that `cmd` is an unknown 
command.

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


With regards,
Apache Git Services

Reply via email to