adoroszlai opened a new pull request, #7575: URL: https://github.com/apache/ozone/pull/7575
## What changes were proposed in this pull request? `GenericParentCommand` provides a way to access `GenericCli` methods from sub-subcommands. However, its usage is tedious and comes with boilerplate code that needs to: - implement `GenericParentCommand` - define methods manually - define member variable for `@ParentCommand` (injected by picocli) Adding new methods to `GenericParentCommand` becomes harder the more implementations we have. The interface needs to be implemented on all sub-command levels. Currently only very few implementations exists. Some subcommands access top-level command via similar parent chain, but without implementing `GenericParentCommand`. Picocli keeps track of the command hierarchy and allows accessing the top-level command directly via `CommandSpec`. Therefore we can remove parent chains where it is only used to access the top-level command. This makes it easier to reorganize subcommands, add them to different parents or even parents at different levels. https://issues.apache.org/jira/browse/HDDS-11878 ## How was this patch tested? Tested some commands changed: ``` $ ozone sh --verbose volume info /vol1 Volume Name : vol1 VOLUME_NOT_FOUND org.apache.hadoop.ozone.om.exceptions.OMException: Volume vol1 is not found at org.apache.hadoop.ozone.om.protocolPB.OzoneManagerProtocolClientSideTranslatorPB.handleError(OzoneManagerProtocolClientSideTranslatorPB.java:763) at org.apache.hadoop.ozone.om.protocolPB.OzoneManagerProtocolClientSideTranslatorPB.getVolumeInfo(OzoneManagerProtocolClientSideTranslatorPB.java:462) at org.apache.hadoop.ozone.client.rpc.RpcClient.getVolumeDetails(RpcClient.java:498) ``` ``` $ ozone admin container info 1 Container id: 1 Pipeline id: 9dc28c7f-4e45-4a3b-8d87-ce8b1d788e86 ... $ ozone admin --verbose container info 1 Container id: 1 Pipeline Info: Pipeline[ Id: 9dc28c7f-4e45-4a3b-8d87-ce8b1d788e86, Nodes: 5b43e396-c1e8-4ab0-907a-1988d8ae3ff7(ozone-datanode-1.ozone_default/172.17.0.8) ReplicaIndex: 0f40dd8b8-bf0d-4e71-b3b7-6f99cedbf786(ozone-datanode-3.ozone_default/172.17.0.9) ReplicaIndex: 0d930ec97-4ffd-4d49-8177-96430fc508ae(ozone-datanode-2.ozone_default/172.17.0.2) ReplicaIndex: 0, ReplicationConfig: RATIS/THREE, State:OPEN, leaderId:5b43e396-c1e8-4ab0-907a-1988d8ae3ff7, CreationTimestamp2024-12-13T21:28:06.443Z[UTC]] ... $ ozone freon ockg -n1 -t1 --factor ONE ... $ ozone sh key info /vol1/bucket1/o1a1bpypql/0 ... "replicationFactor" : "ONE", ``` CI: https://github.com/adoroszlai/ozone/actions/runs/12321167992 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
