[ https://issues.apache.org/jira/browse/CASSANDRA-19476?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17837675#comment-17837675 ]
Maxim Muzafarov edited comment on CASSANDRA-19476 at 4/16/24 8:20 PM: ---------------------------------------------------------------------- I've spent some time prototyping the changes and the plan may be the following, splitting by the issues: # _Replace the airline with the picocli._ CASSANDRA-17445 The airlift library is now used to expose the management commands via the CLI. We can reuse this approach to keep the number of changes low, however, we need to replace the library with the picocli as the airlift has drawbacks. It prevents us from building JMX and CQL APIs in follows: ## The airlift library is no longer supported. It doesn't make sense to build a new code on top of deprecated annotations; ## The library handles the `[<keyspace> <tables>...]` as a single input argument, but we need to handle it independently as two input arguments `keyspace` and `tables` to build JMX and CQL APIs; ## All commands right now have host, port, username, and password options etc. which are not relevant to other types of public APIs; # {_}Create an adapter that builds dynamic JMX MBeans{_}, and parses the picocli annotations of the commands we already have. This will expose these commands with the same parameters and options that they have in the CLI, matching the nodetool CLI input. The management MBeans of the internal components e.g. StorageServiceMBean can be injected into the commands directly when the command context is initialized. # _Create a CQL command adapter._ Based on the commands annotations we can create a new adapter that handles command parameters received from the binary protocol, this is basically the same as new dynamic MBeans with the caveat that the binary protocol have to be improved to support new operation types. Options 2 and 3 can be implemented independently. was (Author: mmuzaf): I've spent some time prototyping the changes and the plan may be the following, splitting by the issues: # _Replace the airline with the picocli._ CASSANDRA-17445 The airlift library is now used to expose the management commands via the CLI. We can reuse this approach to keep the number of changes low, however, we need to replace the library with the picocli as the airlift has drawbacks. It prevents us from building JMX and CQL APIs in follows: ## The airlift library is no longer supported; ## The library handles the `[<keyspace> <tables>...]` as a single input argument, but we need to handle it independently as two input arguments `keyspace` and `tables` to build JMX and CQL APIs; ## All commands right now have host, port, username, and password options etc. which are not relevant to other types of interfaces; # {_}Create an adapter that builds dynamic JMX MBeans{_}, and parses the picocli annotations of the commands we already have. This will expose these commands with the same parameters and options that they have in the CLI, matching the nodetool CLI input. The management MBeans of the internal components e.g. StorageServiceMBean can be injected into the commands directly when the command context is initialized. # _Create a CQL command adapter._ Based on the commands annotations we can create a new adapter that handles command parameters received from the binary protocol, this is basically the same as new dynamic MBeans with the caveat that the binary protocol have to be improved to support new operation types. Options 2 and 3 can be implemented independently. > CQL Management API > ------------------ > > Key: CASSANDRA-19476 > URL: https://issues.apache.org/jira/browse/CASSANDRA-19476 > Project: Cassandra > Issue Type: Improvement > Components: CQL/Interpreter, CQL/Syntax, Tool/nodetool > Reporter: Maxim Muzafarov > Assignee: Maxim Muzafarov > Priority: High > Labels: CEP-38 > Fix For: 5.x > > > We want to run management commands via CQL. > The goals are: > * To provide a way to run predefined management commands via CQL; > * To provide a mechanism for retrieving command definitions and metadata via > CQL; > * To provide information on all available management commands via virtual > tables; > * To provide a registry that stores all C* commands and their metadata > accordingly; > * To internal instrumentation and a reasonable plan for migrating cluster > management from JMX to CQL, taking into account backward compatibility and > adopted deprecation policies; > The discussion on the ML: > https://lists.apache.org/thread/pow83q92m666nqtwyw4m3b18nnkgj2y8 > The design document: > https://cwiki.apache.org/confluence/display/CASSANDRA/CEP-38%3A+CQL+Management+API -- 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