Uploaded image for project: 'Apache Ozone'
  1. Apache Ozone
  2. HDDS-379

Simplify and improve the cli arg parsing of ozone scmcli

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 0.2.1
    • None
    • None

    Description

      SCMCLI is a useful tool to test SCM. It can create/delete/close/list containers.

      There are multiple problems with the current scmcli.

      The biggest one is the cli argument handling. Similar to HDDS-190, it's often very hard to get the help for a specific subcommand.

      The other one is that a big part of the code is the argument handling which is mixed with the business logic.

      I propose to use a more modern argument handler library and simplify the argument handling (and improve the user experience).

      I propose to use picocli.

      1.) It supports subcommands and subcommand specific and general arguments.
      2.) It could work based on annotation with very few additional boilerplate code
      3.) It's very well documented and easy to use
      4.) It's licenced under Apache licence
      5.) It supports tab autocompletion for bash and zsh and colorful output
      6.) Actively maintainer project
      7.) Adopter by other bigger projects (groovy, junit, log4j)

      In this patch I would like to demonstrate how the cli handling could be simplified. And if it's accepted, we can start to use similar approach for other ozone cli as well.

      The patch also fixes the cli (the name of the main class was wrong).

      It also requires HDDS-377 for the be compiled.

      I also deleted the TestSCMCli. It was turned off with an annotation and I believe that this functionality could be tested more easily with a robot test.

      Attachments

        1. HDDS-379.001.patch
          80 kB
          Marton Elek
        2. HDDS-379.002.patch
          78 kB
          Marton Elek
        3. HDDS-379.003.patch
          79 kB
          Marton Elek
        4. HDDS-379.004.patch
          79 kB
          Marton Elek
        5. HDDS-379.005.patch
          84 kB
          Marton Elek
        6. HDDS-379.006.patch
          85 kB
          Marton Elek

        Activity

          People

            elek Marton Elek
            elek Marton Elek
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: