Uploaded image for project: 'HBase'
  1. HBase
  2. HBASE-24039

HBCK2 feature negotiation to check what commands are supported

Details

    Description

      Each HBase version is shipped with a specific version of HBCK2 therefore we can check the HBCK2 version and decide if the given command is supported in that version or not.
      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 on the server side instead of comparing versions.

      Attachments

        1. HBASE-24039.master.v1.patch
          7 kB
          Richárd Antal

        Issue Links

          Activity

            richardantal Richárd Antal added a comment - - edited

            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; } }
            

            We also uploaded this change and checked it on 3 clusters and seems to work.

            richardantal Richárd Antal added a comment - - edited 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 ; } } We also uploaded this change and checked it on 3 clusters and seems to work.
            busbey Sean Busbey added a comment -

            Anything to get us started down this road is a good idea to me. I suspect we need something that can query the actual cluster long term, but incremental improvements would be great.

            busbey Sean Busbey added a comment - Anything to get us started down this road is a good idea to me. I suspect we need something that can query the actual cluster long term, but incremental improvements would be great.
            psomogyi Peter Somogyi added a comment -

            RichardAntal, could you create a pull request on GitHub? We only have automated testing for the hbase-operator-tools repository set for PRs and not for patch files.

            Please also validate your patch with checkstyle. In HBase LineLength is set to 100 characters.

            psomogyi Peter Somogyi added a comment - RichardAntal , could you create a pull request on GitHub? We only have automated testing for the hbase-operator-tools repository set for PRs and not for patch files. Please also validate your patch with checkstyle. In HBase LineLength is set to 100 characters.

            People

              richardantal Richárd Antal
              richardantal Richárd Antal
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: