starocean999 commented on code in PR #45108:
URL: https://github.com/apache/doris/pull/45108#discussion_r1879446762
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/parser/LogicalPlanBuilder.java:
##########
@@ -4714,6 +4717,26 @@ public LogicalPlan
visitShowStorageEngines(ShowStorageEnginesContext ctx) {
return new ShowStorageEnginesCommand();
}
+ @Override
+ public LogicalPlan visitAdminRebalanceDisk(AdminRebalanceDiskContext ctx) {
+ if (ctx.ON() != null) {
+ List<String> backendList = Lists.newArrayList();
+ ctx.backends.forEach(backend ->
backendList.add(stripQuotes(backend.getText())));
+ return new AdminRebalanceDiskCommand(false, backendList);
+ }
+ return new AdminRebalanceDiskCommand(false);
+ }
+
+ @Override
+ public LogicalPlan
visitAdminCancelRebalanceDisk(AdminCancelRebalanceDiskContext ctx) {
+ if (ctx.ON() != null) {
+ List<String> backendList = Lists.newArrayList();
+ ctx.backends.forEach(backend ->
backendList.add(stripQuotes(backend.getText())));
+ return new AdminRebalanceDiskCommand(true, backendList);
Review Comment:
As Binfeng said, you can create a base class like RebalanceDiskCommand and
put common logic there, the use two different sub classes to implement the two
commands
--
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]