real-logic / aeron

Efficient reliable UDP unicast, UDP multicast, and IPC message transport
https://aeron.io
Apache License 2.0
7.42k stars 892 forks source link

[Java] refactor cluster tool to allow extension #1659

Closed langera closed 2 months ago

langera commented 2 months ago

Refactoring of ClusterTool to allow extension by premium tools + reuse of command operations.

The operations are separated to their own class ClusterToolOperator which can be used on its own + extended.

There is an interface ClusterTool.Action to define one action + a class ClusterTool.ClusterToolCommand which defines an action + its description.

ClusterTool main simply executes any command that exists in a predefined Map (by name == the arg for the command).

This preserves backward compatibility and allows to compose other mains of new/modified/reused commands.
Except main, all the other public static methods in ClusterTool also kept for backward compatibility and delegate to the ClusterToolOperator

langera commented 2 months ago

Closing. Not ready yet on the premium side