I think it’s unfortunately a bit core to many of the design-decisions being 
made in IoTDB.
Many tasks seem to be done in too short time and quite often people are not 
taking the required “step back” in order to create a good overall architecture.
I am seeing this in way too many places in the config-node and data-node 
modules.

My proposal would be to completely rewrite the code for the starting and 
stopping of the data- and config nodes. This wouldn’t be as much work as it 
sounds, a I would personally base it on Apache Commons CLI. This way we would 
have a much cleaner and better tested command-line.

However, the syntax would change.

“DataNode -s”

Would become something like:

“DataNode start”

And:

“DataNode -r 42”

Would become something like:

“DateNode -nodeId 42 remove”


Chris

Von: liyuheng <liyuheng55...@126.com>
Datum: Freitag, 9. August 2024 um 05:54
An: dev@iotdb.apache.org <dev@iotdb.apache.org>
Betreff: Re: [DISCUSS] Refactor ConfigNode and DataNode to be the command-line 
instances?
Hi Chris,

I also feel that extracting separate DataNodeCommandLine and 
ConfigNodeCommandLine classes is not really necessary.

When observing the DataNode startup process, although the main function is in 
DataNode, it needs to first go around to DataNodeCommandLine and then back to 
DataNode. This convoluted call process confuses me. Perhaps this is an attempt 
to separate the command line from the main class? Or maybe this is just a 
history design?

Anyway, I'm looking forward to you simplifying the logic here.

LiYuHeng

> 2024年8月7日 22:42,Christofer Dutz <christofer.d...@c-ware.de> 写道:
>
> Hi all,
>
> while working on cleaning up on some config-node removal, I am struggling a 
> bit with the structure of our code.
> For example, the main entry point for a program is “DataNode” and 
> “ConfigNode”, but the main methods, redirect control to a “commandline” 
> instance.
> Depending on the command issued, the commandline then needs to reference back 
> to the same instance that called the commandLine do to some other things.
>
> I think as both DataNode and ConfigNode only implement an mbean interface, it 
> would be cleaner to move the CLI stuff into the main classes and move the 
> stuff for starting and stopping nodes into “command” implementations for the 
> CLI? This mixture is hard to test and maintain.
>
> Also, could the think about basing the CLI on Apache Commons CLI, however 
> that could bring changes in output with it.
>
> What do you others think?
>
> Chris

Reply via email to