[jira] [Commented] (CASSANDRA-18661) Update cassandra-stress to use Apache Commons CLI

2024-04-25 Thread Jon Haddad (Jira)


[ 
https://issues.apache.org/jira/browse/CASSANDRA-18661?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17840876#comment-17840876
 ] 

Jon Haddad commented on CASSANDRA-18661:


Took me a minute but I opened up a DISCUSS thread.

> Update cassandra-stress to use Apache Commons CLI
> -
>
> Key: CASSANDRA-18661
> URL: https://issues.apache.org/jira/browse/CASSANDRA-18661
> Project: Cassandra
>  Issue Type: Improvement
>  Components: Tool/stress
>Reporter: Brad Schoening
>Assignee: Claude Warren
>Priority: Normal
>  Labels: lhf
>
> 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:
> {quote}SSTableMetadataViewer, StandaloneScrubber, StandaloneSplitter, 
> SSTableExport, BulkLoader, and others.
> {quote}
> 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, 
>  
> {quote}For example, using the new syntax like CQLSH:
> {quote}
>  
> cassandra-stress -username foo -password bar
> {quote}and replacing the old syntax:
> {quote}
> 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



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[jira] [Commented] (CASSANDRA-18661) Update cassandra-stress to use Apache Commons CLI

2024-04-16 Thread Josh McKenzie (Jira)


[ 
https://issues.apache.org/jira/browse/CASSANDRA-18661?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17837738#comment-17837738
 ] 

Josh McKenzie commented on CASSANDRA-18661:
---

{quote}Perhaps that is a topic for the ML
{quote}
+1. [~rustyrazorblade] - you able to / willing to open up a [DISCUSS] thread on 
this? I've just started more aggressively using tlp-stress internally and I 
think the time is ripe for us to talk about this as a project.

> Update cassandra-stress to use Apache Commons CLI
> -
>
> Key: CASSANDRA-18661
> URL: https://issues.apache.org/jira/browse/CASSANDRA-18661
> Project: Cassandra
>  Issue Type: Improvement
>  Components: Tool/stress
>Reporter: Brad Schoening
>Assignee: Claude Warren
>Priority: Normal
>  Labels: lhf
>
> 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:
> {quote}SSTableMetadataViewer, StandaloneScrubber, StandaloneSplitter, 
> SSTableExport, BulkLoader, and others.
> {quote}
> 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, 
>  
> {quote}For example, using the new syntax like CQLSH:
> {quote}
>  
> cassandra-stress -username foo -password bar
> {quote}and replacing the old syntax:
> {quote}
> 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



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[jira] [Commented] (CASSANDRA-18661) Update cassandra-stress to use Apache Commons CLI

2024-03-18 Thread Brad Schoening (Jira)


[ 
https://issues.apache.org/jira/browse/CASSANDRA-18661?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17828088#comment-17828088
 ] 

Brad Schoening commented on CASSANDRA-18661:


{{Improving and modernizing the projects stress testing tools is overdue and 
easy-caas-stress looks sophisticated and easy to use. }}Perhaps that a topic 
for the ML or even a CEP? 

> Update cassandra-stress to use Apache Commons CLI
> -
>
> Key: CASSANDRA-18661
> URL: https://issues.apache.org/jira/browse/CASSANDRA-18661
> Project: Cassandra
>  Issue Type: Improvement
>  Components: Tool/stress
>Reporter: Brad Schoening
>Assignee: Claude Warren
>Priority: Normal
>  Labels: lhf
>
> 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:
> {quote}SSTableMetadataViewer, StandaloneScrubber, StandaloneSplitter, 
> SSTableExport, BulkLoader, and others.
> {quote}
> 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, 
>  
> {quote}For example, using the new syntax like CQLSH:
> {quote}
>  
> cassandra-stress -username foo -password bar
> {quote}and replacing the old syntax:
> {quote}
> 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



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[jira] [Commented] (CASSANDRA-18661) Update cassandra-stress to use Apache Commons CLI

2024-03-17 Thread Jon Haddad (Jira)


[ 
https://issues.apache.org/jira/browse/CASSANDRA-18661?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17827784#comment-17827784
 ] 

Jon Haddad commented on CASSANDRA-18661:


Probably not surprising to you - I do have an opinion here :)

A little background for posterity - I wrote tlp-stress back at The Last Pickle. 
 I know it's used in a many large scale environments.  I wrote it to address my 
issues with cassandra-stress, particularly that I found it difficult to 
configure.  I wrote tlp-stress as an easy to use alternative that includes many 
commonly run workloads, and made them easy to adjust via command line 
parameters.  I've used it to solve hundreds of performance issues and has been 
the basis of virtually all the writing I've done on my blog, as well as the 
performance related JIRAs I've filed.

In the last year I've started working on this project again, have forked and 
renamed it as easy-cass-stress.  Repo is here: 
[https://github.com/rustyrazorblade/easy-cass-stress]

I'd be more than happy to see this be the official stress tool of the project.  

> Update cassandra-stress to use Apache Commons CLI
> -
>
> Key: CASSANDRA-18661
> URL: https://issues.apache.org/jira/browse/CASSANDRA-18661
> Project: Cassandra
>  Issue Type: Improvement
>  Components: Tool/stress
>Reporter: Brad Schoening
>Assignee: Claude Warren
>Priority: Normal
>  Labels: lhf
>
> 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:
> {quote}SSTableMetadataViewer, StandaloneScrubber, StandaloneSplitter, 
> SSTableExport, BulkLoader, and others.
> {quote}
> 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, 
>  
> {quote}For example, using the new syntax like CQLSH:
> {quote}
>  
> cassandra-stress -username foo -password bar
> {quote}and replacing the old syntax:
> {quote}
> 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



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[jira] [Commented] (CASSANDRA-18661) Update cassandra-stress to use Apache Commons CLI

2024-03-17 Thread Josh McKenzie (Jira)


[ 
https://issues.apache.org/jira/browse/CASSANDRA-18661?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17827783#comment-17827783
 ] 

Josh McKenzie commented on CASSANDRA-18661:
---

So 1: this looks much improved. Great work!

And 2: In the grand tradition of this project, introducing something late in 
the conversation that's a 90 degree right turn, has anyone considered 
deprecating and removing cassandra-stress in favor of 
[tlp-stress|https://github.com/thelastpickle/tlp-stress] or some variant 
thereof? I believe there are some forks of it out and about that folks might be 
willing to donate to the foundation, and making that the de facto in-tree 
stress tool seems like it'd be a boon for our users.

[~rustyrazorblade] - got any thoughts here? 

> Update cassandra-stress to use Apache Commons CLI
> -
>
> Key: CASSANDRA-18661
> URL: https://issues.apache.org/jira/browse/CASSANDRA-18661
> Project: Cassandra
>  Issue Type: Improvement
>  Components: Tool/stress
>Reporter: Brad Schoening
>Assignee: Claude Warren
>Priority: Normal
>  Labels: lhf
>
> 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:
> {quote}SSTableMetadataViewer, StandaloneScrubber, StandaloneSplitter, 
> SSTableExport, BulkLoader, and others.
> {quote}
> 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, 
>  
> {quote}For example, using the new syntax like CQLSH:
> {quote}
>  
> cassandra-stress -username foo -password bar
> {quote}and replacing the old syntax:
> {quote}
> 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



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[jira] [Commented] (CASSANDRA-18661) Update cassandra-stress to use Apache Commons CLI

2024-03-07 Thread Claude Warren (Jira)


[ 
https://issues.apache.org/jira/browse/CASSANDRA-18661?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17824635#comment-17824635
 ] 

Claude Warren commented on CASSANDRA-18661:
---

The help for the new version looks like this:

{{{}{}}}{{{}Usage:      cassandra-stress HELP {}}}{{[options] }}

{{---Commands---}}
{{    COUNTER_READ    Multiple concurrent reads of counters. The cluster must 
first be populated by a counterwrite test.}}
{{    COUNTER_WRITE   Multiple concurrent updates of counters.}}
{{    HELP            Prints complete help.}}
{{    MIXED           Interleaving of any basic commands, with configurable 
ratio and distribution - the cluster must first be}}
{{                    populated by a write test}}
{{    PRINT           Inspect the output of a distribution definition}}
{{    READ            Multiple concurrent reads - the cluster must first be 
populated by a write test}}
{{    USER            Interleaving of user provided queries, with configurable 
ratio and distribution}}
{{    VERSION         Print the version of cassandra stress}}
{{    WRITE           Multiple concurrent writes against the cluster}}

 

{{---Options---}}
{{ -?,help                                             Prints help for the 
current command.}}
{{ -auth-provider                               Fully qualified name of 
an implementation of}}
{{                                                     
com.datastax.driver.core.AuthProvider}}
{{ -cl                                            Consistency level to 
use. Valid options are ANY, ONE, TWO, THREE, QUORUM,}}
{{                                                     ALL, LOCAL_QUORUM, 
EACH_QUORUM, SERIAL, LOCAL_SERIAL, LOCAL_ONE, NODE_LOCAL.}}
{{                                                     (Default LOCAL_ONE)}}
{{ -col-comparator                                Column Comparator to 
use.  Only applicable if -col-names is specified. Valid}}
{{                                                     values are: 
TimeUUIDType, AsciiType, UTF8Type (Default AsciiType)}}
{{ -col-count                            Cell count distribution, 
per operation (Default FIXED(5)).  May not be used}}
{{                                                     with -col-names.}}
{{ -col-names                                     A comma separated list 
of column names.  May not be used with -column-count.}}
{{ -col-size                             Cell size distribution. 
(Default FIXED(34))}}
{{ -col-slice                                          If set, range slices 
will be used for reads, otherwise a names query is used.}}
{{ -col-timestamp                                 If set, all columns will 
be written with the given timestamp.}}
{{ -command-add                          Distribution of value of 
counter increments. (Default FIXED(1))}}
{{ -command-clustering                   Distribution clustering 
runs of operations of the same kind. (Default}}
{{                                                     GAUSSIAN(1..10))}}
{{ -command-keysize                               Key size in bytes. 
(Default 10)}}
{{ -command-profile                              Specify the path to a 
yaml cql3 profile. Multiple files can be added.}}
{{ -command-ratio                               Specify the ratios for 
operations to perform. (see argument type notes below)}}
{{ -connections-per-host                          Number of connections 
per host. Onluy valid with -simple-native. (Default}}
{{                                                     value=8)}}
{{ -cql-style                                     CQL connections style.  
Valid options are: CQL, CQL_PREPARED}}
{{ -credential-file                              File is supposed to be a 
standard property file with 'cql.username',}}
{{                                                     'cql.password', 
'jmx.username', 'jmx.password',}}
{{                                                     
'transport.keystore.password', and 'transport.truststore.password' as keys.}}
{{                                                     The values for these 
keys will be overriden by their command-line}}
{{                                                     counterparts when 
specified.}}
{{ -datacenter                                    Datacenter used for 
DCAwareRoundRobinLoadPolicy}}
{{ -duration                                 Time to run. Not valid 
with -uncert-err or -n options.}}
{{ -error-ignore                                       Do not fail on errors.}}
{{ -graph-file                                   HTML file to create or 
append to.}}
{{ -graph-name                                    Alternative name for 
current operation (Default: stress op name)}}
{{ -graph-revision                                Unique name to assign to 
the current configuration being stressed.}}
{{ -graph-title                                   Title for chart. 
(Default: current date)}}
{{ 

[jira] [Commented] (CASSANDRA-18661) Update cassandra-stress to use Apache Commons CLI

2024-03-05 Thread Brad Schoening (Jira)


[ 
https://issues.apache.org/jira/browse/CASSANDRA-18661?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17823687#comment-17823687
 ] 

Brad Schoening commented on CASSANDRA-18661:


[~claude] [~smiklosovic] it's great to hear your update on the success you've 
had with this.  Stefan raises an important point about how to make this 
unifying change. There is so much legacy baggage in cassandra-stress I think 
the change is very much warranted, but we may need to keep a 
cassandra-stress-old, create a cassandra-stress-new or something and should be 
discussed on the ML.

> Update cassandra-stress to use Apache Commons CLI
> -
>
> Key: CASSANDRA-18661
> URL: https://issues.apache.org/jira/browse/CASSANDRA-18661
> Project: Cassandra
>  Issue Type: Improvement
>  Components: Tool/stress
>Reporter: Brad Schoening
>Assignee: Claude Warren
>Priority: Normal
>  Labels: lhf
>
> 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:
> {quote}SSTableMetadataViewer, StandaloneScrubber, StandaloneSplitter, 
> SSTableExport, BulkLoader, and others.
> {quote}
> 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, 
>  
> {quote}For example, using the new syntax like CQLSH:
> {quote}
>  
> cassandra-stress -username foo -password bar
> {quote}and replacing the old syntax:
> {quote}
> 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



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[jira] [Commented] (CASSANDRA-18661) Update cassandra-stress to use Apache Commons CLI

2024-03-05 Thread Stefan Miklosovic (Jira)


[ 
https://issues.apache.org/jira/browse/CASSANDRA-18661?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17823683#comment-17823683
 ] 

Stefan Miklosovic commented on CASSANDRA-18661:
---

While I definitely appreciate the effort in this ticket to make it on par with 
other CLI tools, I would bring this to ML to see what broader audience thinks 
about this. There is a ton of legacy online with all options, all the docs etc 
so I wonder if we are not making more harm than good (even with very good 
intentions). Maybe supporting the old and the new way at the same time would be 
nice to have? Not sure how that would look like, I am just trying to figure out 
how to be at least disruptive towards users as possible. 

> Update cassandra-stress to use Apache Commons CLI
> -
>
> Key: CASSANDRA-18661
> URL: https://issues.apache.org/jira/browse/CASSANDRA-18661
> Project: Cassandra
>  Issue Type: Improvement
>  Components: Tool/stress
>Reporter: Brad Schoening
>Assignee: Claude Warren
>Priority: Normal
>  Labels: lhf
>
> 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:
> {quote}SSTableMetadataViewer, StandaloneScrubber, StandaloneSplitter, 
> SSTableExport, BulkLoader, and others.
> {quote}
> 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, 
>  
> {quote}For example, using the new syntax like CQLSH:
> {quote}
>  
> cassandra-stress -username foo -password bar
> {quote}and replacing the old syntax:
> {quote}
> 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



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[jira] [Commented] (CASSANDRA-18661) Update cassandra-stress to use Apache Commons CLI

2024-03-05 Thread Brandon Williams (Jira)


[ 
https://issues.apache.org/jira/browse/CASSANDRA-18661?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17823674#comment-17823674
 ] 

Brandon Williams commented on CASSANDRA-18661:
--

I *think* that's a vestige of the old daemon mode for stress that was removed 
for security concerns in CASSANDRA-17535.

> Update cassandra-stress to use Apache Commons CLI
> -
>
> Key: CASSANDRA-18661
> URL: https://issues.apache.org/jira/browse/CASSANDRA-18661
> Project: Cassandra
>  Issue Type: Improvement
>  Components: Tool/stress
>Reporter: Brad Schoening
>Assignee: Claude Warren
>Priority: Normal
>  Labels: lhf
>
> 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:
> {quote}SSTableMetadataViewer, StandaloneScrubber, StandaloneSplitter, 
> SSTableExport, BulkLoader, and others.
> {quote}
> 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, 
>  
> {quote}For example, using the new syntax like CQLSH:
> {quote}
>  
> cassandra-stress -username foo -password bar
> {quote}and replacing the old syntax:
> {quote}
> 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



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[jira] [Commented] (CASSANDRA-18661) Update cassandra-stress to use Apache Commons CLI

2024-03-05 Thread Claude Warren (Jira)


[ 
https://issues.apache.org/jira/browse/CASSANDRA-18661?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17823670#comment-17823670
 ] 

Claude Warren commented on CASSANDRA-18661:
---

[~bschoeni]

I have managed to get Stress to use the commons-cli code (after adding some 
more functionality to commons-cli).  So we will have to wait for commons-cli 
1.7.0 to be  released.

However, there is a requirement in the code for the StressSettings to be 
serializable.  Is this an old Thrift requirement and can it be removed?  As I 
recall serialization is fraught with security issues, though this is only a 
test tool.  I just don't see how it would be used in the tool.  Any suggestions?

> Update cassandra-stress to use Apache Commons CLI
> -
>
> Key: CASSANDRA-18661
> URL: https://issues.apache.org/jira/browse/CASSANDRA-18661
> Project: Cassandra
>  Issue Type: Improvement
>  Components: Tool/stress
>Reporter: Brad Schoening
>Assignee: Claude Warren
>Priority: Normal
>  Labels: lhf
>
> 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:
> {quote}SSTableMetadataViewer, StandaloneScrubber, StandaloneSplitter, 
> SSTableExport, BulkLoader, and others.
> {quote}
> 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, 
>  
> {quote}For example, using the new syntax like CQLSH:
> {quote}
>  
> cassandra-stress -username foo -password bar
> {quote}and replacing the old syntax:
> {quote}
> 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



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[jira] [Commented] (CASSANDRA-18661) Update cassandra-stress to use Apache Commons CLI

2023-12-21 Thread Brad Schoening (Jira)


[ 
https://issues.apache.org/jira/browse/CASSANDRA-18661?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17799529#comment-17799529
 ] 

Brad Schoening commented on CASSANDRA-18661:


Claude,

Great suggestions.  In case you are not aware of the history of (driver) mode, 
Cassandra used to support thrift and there were three "modes": thrift, cql3 
(DataStax Java CQL driver), and simplenative (the SimpleClient class bundled 
with the server). 

Thrift has been removed from the code base and CASSANDRA-18529 defaulted 
cassandra-stress to use CQL, which is the normal Java driver.  The simple 
native client is an esoteric use case used only by contributors for testing as 
Brandon explained it.  Simple native would be best unseen by ordinary users of 
cassandra-stress and is just confusing to them. 

the current usage is something like:
{noformat}
Usage: -mode [prepared] [compression=?] [port=?] [user=?] [password=?] 
[auth-provider=?] [maxPending=?] [connectionsPerHost=?] [protocolVersion=?] 
[simplenative]{noformat}
and would be more understandable using the standard format of:
{noformat}
Usage: --user u --password p --port n --auth-provider c --prepared 
--compression n --maxPending n --connectionsPerHost n --protocolVersion n 
--simplenative{noformat}
Many complex use case of cassandra-stress have transitioned to NoSQLBench. 
Breaking changes to the command line arguments might be acceptable to improve 
the simplicity of using cassandra-stress for the simple use cases where it 
works best.  CASSANDRA-18529 had already introduced breaking changes.

> Update cassandra-stress to use Apache Commons CLI
> -
>
> Key: CASSANDRA-18661
> URL: https://issues.apache.org/jira/browse/CASSANDRA-18661
> Project: Cassandra
>  Issue Type: Improvement
>  Components: Tool/stress
>Reporter: Brad Schoening
>Assignee: Claude Warren
>Priority: Normal
>  Labels: lhf
>
> 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:
> {quote}SSTableMetadataViewer, StandaloneScrubber, StandaloneSplitter, 
> SSTableExport, BulkLoader, and others.
> {quote}
> 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, 
>  
> {quote}For example, using the new syntax like CQLSH:
> {quote}
>  
> cassandra-stress -username foo -password bar
> {quote}and replacing the old syntax:
> {quote}
> 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



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[jira] [Commented] (CASSANDRA-18661) Update cassandra-stress to use Apache Commons CLI

2023-12-21 Thread Claude Warren (Jira)


[ 
https://issues.apache.org/jira/browse/CASSANDRA-18661?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17799433#comment-17799433
 ] 

Claude Warren commented on CASSANDRA-18661:
---

We could change the sub-option arguments by prefixing them with what is now a 
"sub-option"

For example, this would change the example in [1] from:
{quote}{{#Load one row with default schema}}
{{$ cassandra-stress write n=1 cl=one -mode native cql3 -log 
file=create_schema.log}}{quote}
{quote}{{#Modify schema in CQL}}
{{$ cqlsh }}{quote}
{quote}{{#Run a real write workload}}
{{$ cassandra-stress write n=100 cl=one -mode native cql3 -schema 
keyspace="keyspace1" -log file=load_1M_rows.log}}{quote}
To:
{quote}{{#Load one row with default schema}}
{{$ cassandra-stress write n=1 cl=one -mode-native -mode-cql3 -log-file 
create_schema.log}}{quote}
{quote}{{#Modify schema in CQL}}
{{$ cqlsh}}{quote}
{quote}{{#Run a real write workload}}
{{$ cassandra-stress write n=100 cl=one -mode-native -mode-cql3 
-schema-keyspace "keyspace1" -log-file load_1M_rows.log}}{quote}
 

We could also change the "additional stress parameters to options which would 
then look like:
{quote}{{#Load one row with default schema}}
{{$ cassandra-stress write -n 1 -cl one -mode-native -mode-cql3 -log-file 
create_schema.log}}{quote}
{quote}{{#Modify schema in CQL}}
{{$ cqlsh }}{quote}
{quote}{{#Run a real write workload}}
{{$ cassandra-stress write -n 100 -cl one -mode-native -mode-cql3 
-schema-keyspace "keyspace1" -log-file load_1M_rows.log}}{quote}
 

This is a significant breaking change, though it might be possible to build an 
upgrade tool to convert old command lines to new ones.

 [1] 
https://docs.datastax.com/en/dse/5.1/docs/tooling/cassandra-stress-tool.html

> Update cassandra-stress to use Apache Commons CLI
> -
>
> Key: CASSANDRA-18661
> URL: https://issues.apache.org/jira/browse/CASSANDRA-18661
> Project: Cassandra
>  Issue Type: Improvement
>  Components: Tool/stress
>Reporter: Brad Schoening
>Assignee: Claude Warren
>Priority: Normal
>  Labels: lhf
>
> 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:
> {quote}SSTableMetadataViewer, StandaloneScrubber, StandaloneSplitter, 
> SSTableExport, BulkLoader, and others.
> {quote}
> 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, 
>  
> {quote}For example, using the new syntax like CQLSH:
> {quote}
>  
> cassandra-stress -username foo -password bar
> {quote}and replacing the old syntax:
> {quote}
> 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



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[jira] [Commented] (CASSANDRA-18661) Update cassandra-stress to use Apache Commons CLI

2023-12-20 Thread Claude Warren (Jira)


[ 
https://issues.apache.org/jira/browse/CASSANDRA-18661?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17798930#comment-17798930
 ] 

Claude Warren commented on CASSANDRA-18661:
---

I spent some time this morning looking at this.  I can not find a way to 
process options without a leading dash.  There are comments in the mailing list 
about how options require such prefixes to distinguish them from arguments to 
the options.

I looked at adding dashes to the existing sub-options but this all gets very 
complicated very quickly.  For example there is not a way to support 'n<', 
'n>', and 'n=' in the same set of options.  if we preprocess the line and add 
'-D' (or something similar) to the front so we have something like '-Dn<5' that 
will probably work.  However we are then replacing the custom code with new 
custom code to make it fit the CLI code. 

The other option is to take the arguments from the sub-options and process them 
as we do now.  In this case we are only using the CLI to process the 
sub-options.

We could build a system that takes the arguments for the sub-options, splits 
the sub options so that items like "n<5" become \{"n", "<5"} and then process 
the  result with an iterator where we lookup the argument in a table and pass 
the iterator to a method that then handles the configuration for that argument 
before returning and allowing the next argument to be pulled from the iterator. 
 In this way we can process arguments that take arguments (e.g. err<0.5 or 
n>6).  But again we are back to lots of custom processing.  However we can 
switch to using Predicate> and perhaps simplify some of the 
system while making it easier to extend with new options later.

I am on the fence with this.  I am willing to take a look to see if we can 
simplify and/or update, but I don't know if there is enough support to change 
this when we will still have a fair amount of custom code.  I'll continue to 
explore for the rest of today and perhaps tomorrow.  But I would appreciate any 
guidance with respect to whether or not this would be accepted if the change to 
CLI provides minimal change to the processing.

> Update cassandra-stress to use Apache Commons CLI
> -
>
> Key: CASSANDRA-18661
> URL: https://issues.apache.org/jira/browse/CASSANDRA-18661
> Project: Cassandra
>  Issue Type: Improvement
>  Components: Tool/stress
>Reporter: Brad Schoening
>Assignee: Claude Warren
>Priority: Normal
>  Labels: lhf
>
> 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:
> {quote}SSTableMetadataViewer, StandaloneScrubber, StandaloneSplitter, 
> SSTableExport, BulkLoader, and others.
> {quote}
> 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, 
>  
> {quote}For example, using the new syntax like CQLSH:
> {quote}
>  
> cassandra-stress -username foo -password bar
> {quote}and replacing the old syntax:
> {quote}
> 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



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[jira] [Commented] (CASSANDRA-18661) Update cassandra-stress to use Apache Commons CLI

2023-12-19 Thread Brad Schoening (Jira)


[ 
https://issues.apache.org/jira/browse/CASSANDRA-18661?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17798820#comment-17798820
 ] 

Brad Schoening commented on CASSANDRA-18661:


[~claude] I initiated a [discussion of this on the ML in 
July|https://mail.google.com/mail/u/0/#search/cassandra-stress/CllgCJlHnMbMzxtWxqMpbSKpdNcCJdJXmMxMfzrxgRfzHZzCcvMgWjQRLpsHCNRmSGgfZtwtXmL]
 which received essentially no comments, but it did lead to us updating the 
Apache Commons CLI library in use in the other tools from 1.1 to 1.5.0 in 
CASSANDRA-18659 |https://issues.apache.org/jira/browse/CASSANDRA-18659] and 
removing the legacy option in CASSANDRA-18529. 

Meaningfully using Apache Commons CLI would require reworking the command line 
arguments for cassandra-stress to align with the other command line tools.  It 
does look complex, perhaps too complex, and I was hoping for someone with 
expertise in Apache Commons CLI to weigh in. At the same time, the complexity 
of the existing command line args makes cassandra-stress hard to use for new 
users to users (esp. with authentication buried in -mode from back when there 
was both thrift and cql) and hard for contributors.

> Update cassandra-stress to use Apache Commons CLI
> -
>
> Key: CASSANDRA-18661
> URL: https://issues.apache.org/jira/browse/CASSANDRA-18661
> Project: Cassandra
>  Issue Type: Improvement
>  Components: Tool/stress
>Reporter: Brad Schoening
>Assignee: Claude Warren
>Priority: Normal
>  Labels: lhf
>
> 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:
> {quote}SSTableMetadataViewer, StandaloneScrubber, StandaloneSplitter, 
> SSTableExport, BulkLoader, and others.
> {quote}
> 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, 
>  
> {quote}For example, using the new syntax like CQLSH:
> {quote}
>  
> cassandra-stress -username foo -password bar
> {quote}and replacing the old syntax:
> {quote}
> 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



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[jira] [Commented] (CASSANDRA-18661) Update cassandra-stress to use Apache Commons CLI

2023-12-19 Thread Claude Warren (Jira)


[ 
https://issues.apache.org/jira/browse/CASSANDRA-18661?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17798518#comment-17798518
 ] 

Claude Warren commented on CASSANDRA-18661:
---

Using Apache Commons CLI is not going to remove much code.

Apache Commons requires that options be prefixed with a '-' or 2 dashes.  So it 
will only parse the sub-options.  It will create a list of the arguments to 
each sub-option but those will have to be parsed using a different tool as they 
are really positional arguments and the Apache CLI does not seem to handle 
those.  This means that all the code currently in place for parsing the 
sub-options will need to remain or be rewritten or we will need to find a 
positional command line parser to read them.  And then the presence of the '?' 
in some of the common options (i.e. n Update cassandra-stress to use Apache Commons CLI
> -
>
> Key: CASSANDRA-18661
> URL: https://issues.apache.org/jira/browse/CASSANDRA-18661
> Project: Cassandra
>  Issue Type: Improvement
>  Components: Tool/stress
>Reporter: Brad Schoening
>Assignee: Claude Warren
>Priority: Normal
>  Labels: lhf
>
> 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:
> {quote}SSTableMetadataViewer, StandaloneScrubber, StandaloneSplitter, 
> SSTableExport, BulkLoader, and others.
> {quote}
> 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, 
>  
> {quote}For example, using the new syntax like CQLSH:
> {quote}
>  
> cassandra-stress -username foo -password bar
> {quote}and replacing the old syntax:
> {quote}
> 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



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org