[ https://issues.apache.org/jira/browse/HBASE-24039?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17065433#comment-17065433 ]
Richard Antal edited comment on HBASE-24039 at 3/24/20, 8:52 AM: ----------------------------------------------------------------- I would accomplish it by querying the DeclaredMethods of the Hbck class and then investigate if it has the command that we want to run or not. It would be something like this: {code:java} Method[] methods = connection.getHbck().getClass().getDeclaredMethods(); boolean supported = false; for (Method method : methods){ if (method.getName().equals(cmd)) { supported = true; break; } } {code} was (Author: richardantal): I would accomplish it by querying the DeclaredMethods of the Hbck class and then investigate if it has the command that we want to run or not. It would be something like this: Method[] methods = connection.getHbck().getClass().getDeclaredMethods(); boolean supported = false; for (Method method : methods){ if (method.getName().equals(cmd)) { supported = true; break; } } > HBCK2 feature negotiation to check what commands are supported > -------------------------------------------------------------- > > Key: HBASE-24039 > URL: https://issues.apache.org/jira/browse/HBASE-24039 > Project: HBase > Issue Type: Improvement > Reporter: Richard Antal > Priority: Major > > Each version of HBase is shipped with a specific version of HBCK2 therefore > we can check the version and compare it to the minimum version for the given > command. > It is not that easy to decide if the command is supported or not when dealing > with back-ported features. > It the conclusion of this I would recommend using feature negotiation to > check what commands are supported instead of comparing versions. -- This message was sent by Atlassian Jira (v8.3.4#803005)