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

Stefan Miklosovic edited comment on CASSANDRA-18547 at 9/25/23 9:45 AM:
------------------------------------------------------------------------

j17 pre-commit 
https://app.circleci.com/pipelines/github/instaclustr/cassandra/3223/workflows/6f148552-ea7b-4f1b-bb08-a549b60e1b05

The original patch for dtest (1) had one minor problem in it. The above build 
is the result of this branch (2) with the fix (3).

Since this is changing only Python stuff, I do not consider a build for Java 11 
necessary.

This was built for trunk but should go to 5.0 (4) as well.

I manually tested that dtests still work with cassandra-4.1 branch.

(1) https://github.com/apache/cassandra-dtest/pull/232/files
(2) https://github.com/instaclustr/cassandra/commits/CASSANDRA-18547-trunk
(3) 
https://github.com/smiklosovic/cassandra-dtest/commit/f2d575e80005c9c9713743197b9ab4249359aac7
(4) 
https://github.com/instaclustr/cassandra/commit/23eccd18220ddd7a46e5806da904adde0e149328


was (Author: smiklosovic):
j17 pre-commit 
https://app.circleci.com/pipelines/github/instaclustr/cassandra/3223/workflows/6f148552-ea7b-4f1b-bb08-a549b60e1b05

The original patch for dtest (1) had one minor problem in it. The above build 
is the result of this branch (2) with the fix (3).

Since this is changing only Python stuff, I do not consider a build for Java 11 
necessary.

This was built for trunk but should go to 5.0 as well.

I manually tested that dtests still work with cassandra-4.1 branch.

(1) https://github.com/apache/cassandra-dtest/pull/232/files
(2) https://github.com/instaclustr/cassandra/commits/CASSANDRA-18547-trunk
(3) 
https://github.com/smiklosovic/cassandra-dtest/commit/f2d575e80005c9c9713743197b9ab4249359aac7

> Refactor cqlsh On/Off switch implementation and make the output consistent
> --------------------------------------------------------------------------
>
>                 Key: CASSANDRA-18547
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-18547
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: CQL/Interpreter
>            Reporter: Brad Schoening
>            Assignee: Brad Schoening
>            Priority: Normal
>             Fix For: 5.x
>
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> This change refactors the On/Off switch implemented in the class 
> SwitchCommand and subclass  SwitchCommandWithValue of cqlshmain.py to use an 
> Enum with static methods instead of custom classes.
> The body of on_off_switch + enum definition requires just 15 lines of code vs 
> 33 in SwitchCommand.
> The existing code is hard to read, including the usage in the code, which 
> instantiates a SwitchCommand object in-order to invoke the execute method:
>  
> {code:java}
> self.tracing_enabled = SwitchCommand("TRACING", 
> "Tracing").execute(self.tracing_enabled, parsed, self.printerr){code}
> this can be replaced by a more familiar direct function call:
> {code:java}
> self.tracing_enabled = self.on_off_toggle("TRACING", "Tracing", 
> self.tracing_enabled, parsed.get_binding('switch')){code}
>  
> The refactoring also updates the command output for consistency. Instead of 
> the current:
> {code:java}
> > tracing on
> Now Tracing is enabled
> > paging on
> Query paging is already enabled. Use PAGING OFF to disable.
> > expand on
> Now Expanded output is enabled
> {code}
> replace with more succinct and consistent, using 'ON/OFF' instead of 
> enabled/disabled and removing the redundant 'Now':
> {code:java}
> > tracing on
> TRACING set to ON
> > paging on
> PAGING is already ON
> > expand on
> EXPAND set to ON
> {code}
>  



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

Reply via email to