Todd Lipcon has submitted this change and it was merged. Change subject: tool: rewrite parser logic ......................................................................
tool: rewrite parser logic While leaf and non-leaf actions share some common properties, there is much they don't share. Rather than shoehorn both into the same Action paradigm, I think it makes more sense to consider them separately. This patch splits Action into either Mode (non-leaf node) or Action (leaf node). The common properties are now found in the Label struct. Additionally, each kind of node is now structured as a class with proper encapsulation, builders, and other goodies. Overall this simplifies the command line parsing logic, hides more internal details, and reduces the boilerplate needed to add a mode or an action. There's no change to the tool's interface with the outside world. Change-Id: I794fc527525a57283f0165e262283adf14160def Reviewed-on: http://gerrit.cloudera.org:8080/3996 Tested-by: Kudu Jenkins Reviewed-by: Todd Lipcon <t...@apache.org> --- M src/kudu/tools/tool_action.cc M src/kudu/tools/tool_action.h M src/kudu/tools/tool_action_fs.cc M src/kudu/tools/tool_action_tablet.cc M src/kudu/tools/tool_main.cc 5 files changed, 333 insertions(+), 200 deletions(-) Approvals: Todd Lipcon: Looks good to me, approved Kudu Jenkins: Verified -- To view, visit http://gerrit.cloudera.org:8080/3996 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-MessageType: merged Gerrit-Change-Id: I794fc527525a57283f0165e262283adf14160def Gerrit-PatchSet: 4 Gerrit-Project: kudu Gerrit-Branch: master Gerrit-Owner: Adar Dembo <a...@cloudera.com> Gerrit-Reviewer: Adar Dembo <a...@cloudera.com> Gerrit-Reviewer: Kudu Jenkins Gerrit-Reviewer: Todd Lipcon <t...@apache.org>