Uploaded image for project: 'Cassandra'
  1. Cassandra
  2. CASSANDRA-18661

Update cassandra-stress to use Apache Commons CLI

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Normal
    • Resolution: Unresolved
    • None
    • Tool/stress
    • Operability
    • Normal
    • All
    • None

    Description

      The Apache Commons CLI library provides an API for parsing command line options with the package org.apache.commons.cli and this is already used by a dozen of existing Cassandra utilities including:

      SSTableMetadataViewer, StandaloneScrubber, StandaloneSplitter, SSTableExport, BulkLoader, and others.

      However, cassandra-stress is an outlier which uses its own custom classes to parse command line options with classes such as OptionsSimple.  In addition, the options syntax for username, password, and others are not aligned with the format used by CQLSH.

      Currently, there are > 5K lines of code in 'settings' which appears to just process command line args.

      This suggestion is to:
       
      a) Upgrade cassandra-stress to use Apache Commons CLI (no new dependencies are required as this library is already used by the project)
       
      b) Align the cassandra-stress CLI options with those in CQLSH, 
       

      For example, using the new syntax like CQLSH:

       

      cassandra-stress -username foo -password bar

      and replacing the old syntax:

      cassandra-stress -mode username=foo and password=bar
       
      This will simplify and unify the code base, eliminate code and reduce the confusion between similar named classes such as org.apache.cassandra.stress.settings.{Option, OptionsMulti, OptionsSimple} and org.apache.commons.cli.{Option, OptionGroup, Options)
       

      Note: documentation will need to be updated as well

      Attachments

        Issue Links

          Activity

            People

              claude Claude Warren
              bschoeni Brad Schoening
              Claude Warren
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated: