Thanks everyone , So It seems that it is better to add new parameter
options to meet our needs, while keeping the original parameter functions
unaffected to achieve backward compatibility.
So the new options are :
1. nodetool tablehistograms ks.tb1 or ks tb1  ... //this is *one of the old
way *of using tablehistogram. will print out the histograms of tabke ks.tb1
, we keep the old format to print out the table histograms,besides if more
than two arguments is provied, suchu as nodetool tablehistograms
system.local system_schema.columns system_schema.tables then all
tables's  histograms
will be printed out (I think this is a bug that not as excepted in the
document's decription, we should remind the user that this is an incorrenct
usage)

2. nodetool tablehistograms -tbs ks.tb1 ks.tb2 .... //print out list of
tables' histograms with format keyspace.table
3.nodetool tablehistograms -ks ks1 ks2 ks3 ... //print out list of
keyspaces histograms
4.nodetool tablehistograms -i -ks ks1 ks2 .... //print out list of table
histograms except for the keyspaces list behind the option -i
5.nodetool tablehistograns -i -tbs ks.tb1 ks.tb2 // print out list tables'
histograms except for table in ks.tb1 ks.tb2
6.nodetool tablehistograns -i -tbs ks.tb1 ks.tb2 -ks ks1 // print out list
tables' histograms except for table in ks.tb1 ks.tb2 and all tables in ks1
6.none option specified ,then all tables histograms will be print out.// this
is *another one of the old way* of using tablehistogram.

So we add some more options like "-i", "-ks", "-tbs" , we can combine these
options  and we can also use any of them individually, besides, we can also
use the tool through old way if a table with format ks.tb is provied.


Jeremiah D Jordan <jeremiah.jor...@gmail.com> 于2023年3月16日周四 23:14写道:

> -1 on any change which breaks the previously documented usage.
> +1 any additions to what the tool can do without breaking previously
> documented behavior.
>
> On Mar 16, 2023, at 7:42 AM, Josh McKenzie <jmcken...@apache.org> wrote:
>
> We could also consider augmenting the tool with new named arguments with
> the functionality you described and leave the positional usage intact.
>
> On Thu, Mar 16, 2023, at 6:43 AM, Bowen Song via dev wrote:
>
> The documented command options are:
>
> nodetool tablehistograms [<keyspace> <table> | <keyspace.table>]
>
>
>
> That means one parameter will be treated as dot separated keyspace and
> table. Alternatively, two parameters will be treated as the keyspace and
> table respectively.
>
> To remain compatible with the documented behaviour, my suggestion is to
> change the command options to:
>
> nodetool tablehistograms [<keyspace> <table> [<table2> [...]] |
> <keyspace.table> [<keyspace2.table2> [...]]]
>
> Feel free to add the "all except ..." feature to the above.
>
> This doesn't break backward compatibility in documented ways. It only
> changes the undocumented behaviour. If someone is using the undocumented
> behaviour, they must know things may break when the software is upgraded.
> We can just add a line to the NEWS.txt and let them update their scripts.
>
>
> On 16/03/2023 08:53, guo Maxwell wrote:
>
> Hello everyone :
> The nodetool tablehistograms have one argument which you can fill with
> only one table name with the format "keyspace_name.table_name
> /keyspace_name table_name", so that you can get the table histograms of the
> specied table.
>
> And  if none arguments is set, all the tables' histograms will be print
> out.And if more than 2 arguments (nomatter the format is right or wrong) are
> set , all the tables' histograms will also be print out too(Which is a bug
> In my mind).
>
> So the usage of nodetool tablehistograms has some usage restrictions, That
> is either output one , or all informations.
>
> As CASSANDRA-18296 <https://issues.apache.org/jira/browse/CASSANDRA-18296> 
> described
> , I will change the usage of nodetool tablehistograms, which support the
> feature below:
> 1. nodetool tablehistograms ks.tb1 ks.tb2 .... //print out list of tables'
> histograms with format keyspace.table
> 2.nodetool tablehistograms ks1 ks2 ks3 ... //print out list of keyspaces
> histograms
> 3.nodetool tablehistograms -i ks1 ks2 .... //print out list of table
> histograms except for the keyspaces list behind the option -i
> 4.nodetool tablehistograns -i ks ks.tb // print out list tables'
> histograms except for table in keyspace ks and ks.tb table.
> 5.none option specified ,then all tables histograms will be print out.
>
> The usage will breaks compatibility with how it was done previously, and
> as this is a user facing tool.
>
> So, What do you think?
>
> Thanks~~~
>
>
>

-- 
you are the apple of my eye !

Reply via email to