[ 
https://issues.apache.org/jira/browse/CASSANDRA-16513?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Paulo Motta updated CASSANDRA-16513:
------------------------------------
    Description: 
Several virtual tables were recently added, but they're currently only 
accessible via cqlsh or programmatically. While this is valuable for many use 
cases, operators are accustomed with the convenience of querying system metrics 
with a simple nodetool command.

In addition to that, a relatively common request is to provide nodetool output 
in different formats (JSON, YAML and even XML) (CASSANDRA-5977, 
CASSANDRA-12035, CASSANDRA-12486, CASSANDRA-12698, CASSANDRA-12503). However 
this requires lots of manual labor as each nodetool subcommand needs to be 
adapted to support new output formats.

I propose adding a new CLI tool that will consistently print to the standard 
output the contents of a virtual table. By default the command will print the 
output in a tabular format similar to cqlsh, but a "--format" parameter can be 
specified to modify the output to some other format like JSON or YAML.

It should be possible to add a limit to the amount of rows displayed and filter 
to display only rows from with specific keys (ie. keyspace or table). The 
command should be flexible and provide simple hooks for registration and 
customization of new virtual tables.

My vision is that this is a path towards deprecating JMX and toward CQL for 
management, as we move information currently available through JMX to virtual 
tables (as CASSANDRA-14457 did with compactionstats) and easily expose them in 
this new tool as more virtual tables are added. Eventually we can also add 
setters when we start supporting writeable virtual tables.

I propose calling this tool admintool (naming bikeshedding welcome), for 
example:
{noformat}
admintool help

admintool <subcommand> <entity>

Available subcommands and entities are:

subcommands:
 - display
 - set (future)

entities:
 - caches
 - internode_inbound
 - internode_outbound
 - settings
 - sstable_tasks
 - system_properties
 - thread_pools

nodetool display clients --format yaml
...
nodetool display internode_outboud --format json
...
nodetool show sstabletasks --filter keyspace=my_ks --filter table=my_table
...
{noformat}

  was:
Several virtual tables were recently added, but they're currently only 
accessible via cqlsh or programmatically. While this is valuable for many use 
cases, operators are accustomed with the convenience of querying system metrics 
with a simple nodetool command.

In addition to that, a relatively common request is to provide nodetool output 
in different formats (JSON, YAML and even XML) (CASSANDRA-5977, 
CASSANDRA-12035, CASSANDRA-12486, CASSANDRA-12698, CASSANDRA-12503). However 
this requires lots of manual labor as each nodetool subcommand needs to be 
adapted to support new output formats.

I propose adding a new nodetool command that will consistently print to the 
standard output the contents of a virtual table. By default the command will 
print the output in a human-readable tabular format similar to cqlsh, but a 
"--format" parameter can be specified to modify the output to some other format 
like JSON or YAML.

It should be possible to add a limit to the amount of rows displayed and filter 
to display only rows from a specific keyspace or table. The command should be 
flexible and provide simple hooks for registration and customization of new 
virtual tables.

I propose calling this command nodetool show <virtualtable> (naming 
bikeshedding welcome), for example:
{noformat}
nodetool show --list
caches
clients
internode_inbound
internode_outbound
settings
sstable_tasks
system_properties
thread_pools

nodetool show clients --format yaml
...
nodetool show internode_outboud --format json
...
nodetool show sstabletasks --keyspace my_ks --table -my_table
...
{noformat}

        Summary: Add tool to display or export the contents of a virtual table  
(was: Add nodetool command to display or export the contents of a virtual table)

Several virtual tables were recently added, but they're currently only 
accessible via cqlsh or programmatically. While this is valuable for many use 
cases, operators are accustomed with the convenience of querying system metrics 
with a simple nodetool command.

In addition to that, a relatively common request is to provide nodetool output 
in different formats (JSON, YAML and even XML) (CASSANDRA-5977, 
CASSANDRA-12035, CASSANDRA-12486, CASSANDRA-12698, CASSANDRA-12503). However 
this requires lots of manual labor as each nodetool subcommand needs to be 
adapted to support new output formats.

I propose adding a new tool that will consistently print to the standard output 
the contents of a virtual table. By default the command will print the output 
in a tabular format similar to cqlsh, but a "--format" parameter can be 
specified to modify the output to some other format like JSON or YAML.

It should be possible to add a limit to the amount of rows displayed and filter 
to display only rows from with specific keys (ie. keyspace or table). The 
command should be flexible and provide simple hooks for registration and 
customization of new virtual tables.

My vision is that this is a path towards deprecating JMX and toward CQL for 
management, as we move information currently available through JMX to virtual 
tables (as CASSANDRA-14457 did with compactionstats) and easily expose them in 
this new tool as more virtual tables are added. Eventually we can also add 
setters when we start supporting writeable virtual tables.

I propose calling this tool admintool (naming bikeshedding welcome), for 
example:
{noformat}
admintool help

admintool <subcommand> <entity>

Available subcommands and entities are:

subcommands:
 - display
 - set (future)

entities:
 - caches
 - internode_inbound
 - internode_outbound
 - settings
 - sstable_tasks
 - system_properties
 - thread_pools

...

nodetool display clients --format yaml
...
nodetool display internode_outboud --format json
...
nodetool show sstabletasks --filter keyspace=my_ks --filter table=my_table
...
{noformat}

> Add tool to display or export the contents of a virtual table
> -------------------------------------------------------------
>
>                 Key: CASSANDRA-16513
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-16513
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Observability/Metrics, Tool/nodetool
>            Reporter: Paulo Motta
>            Priority: Normal
>              Labels: gsoc2021, mentor
>
> Several virtual tables were recently added, but they're currently only 
> accessible via cqlsh or programmatically. While this is valuable for many use 
> cases, operators are accustomed with the convenience of querying system 
> metrics with a simple nodetool command.
> In addition to that, a relatively common request is to provide nodetool 
> output in different formats (JSON, YAML and even XML) (CASSANDRA-5977, 
> CASSANDRA-12035, CASSANDRA-12486, CASSANDRA-12698, CASSANDRA-12503). However 
> this requires lots of manual labor as each nodetool subcommand needs to be 
> adapted to support new output formats.
> I propose adding a new CLI tool that will consistently print to the standard 
> output the contents of a virtual table. By default the command will print the 
> output in a tabular format similar to cqlsh, but a "--format" parameter can 
> be specified to modify the output to some other format like JSON or YAML.
> It should be possible to add a limit to the amount of rows displayed and 
> filter to display only rows from with specific keys (ie. keyspace or table). 
> The command should be flexible and provide simple hooks for registration and 
> customization of new virtual tables.
> My vision is that this is a path towards deprecating JMX and toward CQL for 
> management, as we move information currently available through JMX to virtual 
> tables (as CASSANDRA-14457 did with compactionstats) and easily expose them 
> in this new tool as more virtual tables are added. Eventually we can also add 
> setters when we start supporting writeable virtual tables.
> I propose calling this tool admintool (naming bikeshedding welcome), for 
> example:
> {noformat}
> admintool help
> admintool <subcommand> <entity>
> Available subcommands and entities are:
> subcommands:
>  - display
>  - set (future)
> entities:
>  - caches
>  - internode_inbound
>  - internode_outbound
>  - settings
>  - sstable_tasks
>  - system_properties
>  - thread_pools
> nodetool display clients --format yaml
> ...
> nodetool display internode_outboud --format json
> ...
> nodetool show sstabletasks --filter keyspace=my_ks --filter table=my_table
> ...
> {noformat}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to