siddhantsangwan commented on code in PR #9839:
URL: https://github.com/apache/ozone/pull/9839#discussion_r2876163487


##########
hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/scm/container/balancer/ContainerBalancerConfiguration.java:
##########
@@ -91,6 +91,11 @@ public final class ContainerBalancerConfiguration {
       "to exclude from balancing. For example \"1, 4, 5\" or \"1,4,5\".")
   private String excludeContainers = "";
 
+  @Config(key = "hdds.container.balancer.include.containers", type = 
ConfigType.STRING, defaultValue =
+      "", tags = {ConfigTag.BALANCER}, description = "List of container IDs " +
+      "to include in balancing. For example \"1, 4, 5\" or \"1,4,5\".")

Review Comment:
   Add: "Only these containers will be included in balancing."



##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/balancer/ContainerBalancerSelectionCriteria.java:
##########
@@ -254,6 +260,11 @@ public void setExcludeContainers(
     this.excludeContainers = excludeContainers;
   }
 
+  public void setIncludeContainers(

Review Comment:
   Unused method, should be removed.



##########
hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/scm/container/balancer/ContainerBalancerConfiguration.java:
##########
@@ -443,6 +470,8 @@ public String toString() {
         networkTopologyEnable,
         "Whether to Trigger Refresh Datanode Usage Info",
         triggerDuEnable,
+        "Container IDs to Include in Balancing",
+        includeContainers.equals("") ? "None" : includeContainers,

Review Comment:
   This can be replaced with isEmpty().



##########
hadoop-ozone/cli-admin/src/main/java/org/apache/hadoop/hdds/scm/cli/ContainerBalancerStartSubcommand.java:
##########
@@ -126,6 +126,13 @@ public class ContainerBalancerStartSubcommand extends 
ScmSubcommand {
           "(specify \"1,2,3\" for container IDs).")
   private Optional<String> excludeContainers;
 
+  @Option(names = {"--include-containers"},
+      description = "A list of container IDs separated by commas. " +
+          "The containers specified in this list are included in balancing. " +

Review Comment:
   Change to: Only the containers specified in this list will be included in 
balancing. If --exclude-containers is also specified, those containers will be 
excluded.



##########
hadoop-ozone/cli-admin/src/main/java/org/apache/hadoop/hdds/scm/cli/ContainerBalancerStatusSubcommand.java:
##########
@@ -143,12 +144,15 @@ String 
getConfigurationPrettyString(HddsProtos.ContainerBalancerConfigurationPro
             configuration.getMoveNetworkTopologyEnable(),
             "Whether to Trigger Refresh Datanode Usage Info",
             configuration.getTriggerDuBeforeMoveEnable(),
+            "Container IDs to Include in Balancing",
+            configuration.getIncludeContainers().isEmpty() ? "None" : 
configuration.getIncludeContainers(),
             "Container IDs to Exclude from Balancing",
             configuration.getExcludeContainers().isEmpty() ? "None" : 
configuration.getExcludeContainers(),
             "Datanodes Specified to be Balanced",
             configuration.getIncludeDatanodes().isEmpty() ? "None" : 
configuration.getIncludeDatanodes(),
             "Datanodes Excluded from Balancing",
             configuration.getExcludeDatanodes().isEmpty() ? "None" : 
configuration.getExcludeDatanodes());
+

Review Comment:
   Extra line can be removed.



-- 
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]

Reply via email to