This is an automated email from the ASF dual-hosted git repository.

sumitagrawal pushed a commit to branch HDDS-5713
in repository https://gitbox.apache.org/repos/asf/ozone.git


The following commit(s) were added to refs/heads/HDDS-5713 by this push:
     new 3e6362f2fe3 HDDS-13649. [DiskBalancer] Refine Disk Balancer CLI, 
Documentation, and Naming for Improved Usability (#9005)
3e6362f2fe3 is described below

commit 3e6362f2fe3293fa4fb0e2125708310d36fc56cb
Author: Gargi Jaiswal <[email protected]>
AuthorDate: Tue Sep 23 15:30:03 2025 +0530

    HDDS-13649. [DiskBalancer] Refine Disk Balancer CLI, Documentation, and 
Naming for Improved Usability (#9005)
---
 .../common/statemachine/StateContext.java          | 13 -----------
 hadoop-hdds/docs/content/design/diskbalancer.md    |  7 ++++--
 hadoop-hdds/docs/content/feature/DiskBalancer.md   | 25 +++++++++++++++-------
 .../docs/content/feature/DiskBalancer.zh.md        | 10 +++++++++
 .../src/main/proto/ScmAdminProtocol.proto          |  2 +-
 .../scm/cli/datanode/DiskBalancerCommands.java     |  8 ++++---
 .../cli/datanode/DiskBalancerCommonOptions.java    |  3 ++-
 .../cli/datanode/DiskBalancerStartSubcommand.java  |  4 ++--
 .../cli/datanode/DiskBalancerUpdateSubcommand.java |  4 ++--
 9 files changed, 44 insertions(+), 32 deletions(-)

diff --git 
a/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/statemachine/StateContext.java
 
b/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/statemachine/StateContext.java
index 937afbf8a27..d5c1aac91bc 100644
--- 
a/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/statemachine/StateContext.java
+++ 
b/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/statemachine/StateContext.java
@@ -60,7 +60,6 @@
 import org.apache.commons.collections.CollectionUtils;
 import org.apache.hadoop.hdds.conf.ConfigurationSource;
 import org.apache.hadoop.hdds.protocol.proto.HddsProtos;
-import 
org.apache.hadoop.hdds.protocol.proto.StorageContainerDatanodeProtocolProtos;
 import 
org.apache.hadoop.hdds.protocol.proto.StorageContainerDatanodeProtocolProtos.CommandStatus.Status;
 import 
org.apache.hadoop.hdds.protocol.proto.StorageContainerDatanodeProtocolProtos.CommandStatusReportsProto;
 import 
org.apache.hadoop.hdds.protocol.proto.StorageContainerDatanodeProtocolProtos.ContainerAction;
@@ -104,9 +103,6 @@ public class StateContext {
   static final String INCREMENTAL_CONTAINER_REPORT_PROTO_NAME =
       IncrementalContainerReportProto.getDescriptor().getFullName();
   @VisibleForTesting
-  static final String CRL_STATUS_REPORT_PROTO_NAME =
-      
StorageContainerDatanodeProtocolProtos.CRLStatusReport.getDescriptor().getFullName();
-  @VisibleForTesting
   static final String DISK_BALANCER_REPORT_PROTO_NAME =
       DiskBalancerReportProto.getDescriptor().getFullName();
 
@@ -123,7 +119,6 @@ public class StateContext {
   private final AtomicReference<Message> containerReports;
   private final AtomicReference<Message> nodeReport;
   private final AtomicReference<Message> pipelineReports;
-  private final AtomicReference<Message> crlStatusReport;
   private final AtomicReference<Message> diskBalancerReport;
   // Incremental reports are queued in the map below
   private final Map<InetSocketAddress, List<Message>>
@@ -193,7 +188,6 @@ public StateContext(ConfigurationSource conf,
     containerReports = new AtomicReference<>();
     nodeReport = new AtomicReference<>();
     pipelineReports = new AtomicReference<>();
-    crlStatusReport = new AtomicReference<>(); // Certificate Revocation List
     diskBalancerReport = new AtomicReference<>();
     endpoints = new HashSet<>();
     containerActions = new HashMap<>();
@@ -221,8 +215,6 @@ private void initReportTypeCollection() {
     type2Reports.put(NODE_REPORT_PROTO_NAME, nodeReport);
     fullReportTypeList.add(PIPELINE_REPORTS_PROTO_NAME);
     type2Reports.put(PIPELINE_REPORTS_PROTO_NAME, pipelineReports);
-    fullReportTypeList.add(CRL_STATUS_REPORT_PROTO_NAME);
-    type2Reports.put(CRL_STATUS_REPORT_PROTO_NAME, crlStatusReport);
     fullReportTypeList.add(DISK_BALANCER_REPORT_PROTO_NAME);
     type2Reports.put(DISK_BALANCER_REPORT_PROTO_NAME, diskBalancerReport);
   }
@@ -934,11 +926,6 @@ public Message getPipelineReports() {
     return pipelineReports.get();
   }
 
-  @VisibleForTesting
-  public Message getCRLStatusReport() {
-    return crlStatusReport.get();
-  }
-
   @VisibleForTesting
   public Message getDiskBalancerReport() {
     return diskBalancerReport.get();
diff --git a/hadoop-hdds/docs/content/design/diskbalancer.md 
b/hadoop-hdds/docs/content/design/diskbalancer.md
index 08326223482..4d58bf85c7e 100644
--- a/hadoop-hdds/docs/content/design/diskbalancer.md
+++ b/hadoop-hdds/docs/content/design/diskbalancer.md
@@ -120,8 +120,7 @@ used time or if the container iterator for that is 
invalidated on full utilisati
 
 ## Feature Flag
 
-The Disk Balancer feature is introduced with a feature flag. By default, this 
feature is disabled to prevent it from 
-running until it has undergone thorough testing.
+The Disk Balancer feature is introduced with a feature flag. By default, this 
feature is disabled.
 
 The feature can be enabled by setting the following property to `true` in the 
`ozone-site.xml` configuration file:
 `hdds.datanode.disk.balancer.enabled = false`
@@ -129,6 +128,10 @@ The feature can be enabled by setting the following 
property to `true` in the `o
 Developers who wish to test or use the Disk Balancer must explicitly enable 
it. Once the feature is 
 considered stable, the default value may be changed to `true` in a future 
release.
 
+**Note:** This command is hidden from the main help message (`ozone admin 
datanode --help`). This is because the feature
+is currently considered experimental and is disabled by default. The command 
is, however, fully functional for those who
+wish to enable and use the feature.
+
 ## DiskBalancer Metrics
 
 The DiskBalancer service exposes JMX metrics on each Datanode for real-time 
monitoring. These metrics provide insights
diff --git a/hadoop-hdds/docs/content/feature/DiskBalancer.md 
b/hadoop-hdds/docs/content/feature/DiskBalancer.md
index 311b19239e0..621157654b6 100644
--- a/hadoop-hdds/docs/content/feature/DiskBalancer.md
+++ b/hadoop-hdds/docs/content/feature/DiskBalancer.md
@@ -41,9 +41,18 @@ A disk is considered a candidate for balancing if its
 
 ![Data spread across disks](diskBalancer.png)
 
+## Feature Flag
+
+The Disk Balancer feature is introduced with a feature flag. By default, this 
feature is disabled.
+
+The feature can be **enabled** by setting the following property to `true` in 
the `ozone-site.xml` configuration file:
+`hdds.datanode.disk.balancer.enabled = false`
+
 ## Command Line Usage
 The DiskBalancer is managed through the `ozone admin datanode diskbalancer` 
command.
 
+**注意:**此命令在主帮助消息(“ozone admin datanode 
--help”)中隐藏。这是因为该功能目前处于实验阶段,默认禁用。不过,对于希望启用和使用该功能的用户来说,该命令功能齐全。
+
 ### **Start DiskBalancer**
 To start diskBalancer on all Datanodes with default configurations :
 
@@ -65,14 +74,14 @@ ozone admin datanode diskbalancer update [options]
 ```
 **Options include:**
 
-| Options                               | Description                          
                                                                 |              
                                                                                
                                                               
-|---------------------------------------|-------------------------------------------------------------------------------------------------------|
-| `-t, --threshold`                     | Percentage deviation from average 
utilization of the disks after which a datanode will be rebalanced. |
-| `-b, --bandwithInMB`                  | Maximum bandwidth for DiskBalancer 
per second.                                                        |
-| `-p, --parallelThread`                | Max parallelThread for DiskBalancer. 
                                                                 |
-| `-s, --stop-after-disk-even`          | Stop DiskBalancer automatically 
after disk utilization is even.                                       |
-| `-a, --all`                           | Run commands on all datanodes.       
                                                                 |
-| `-d, --datanodes`                     | Run commands on specific datanodes   
                                                                 |
+| Options                      | Description                                   
                                                        |                       
                                                                                
                                                      
+|------------------------------|-------------------------------------------------------------------------------------------------------|
+| `-t, --threshold`            | Percentage deviation from average utilization 
of the disks after which a datanode will be rebalanced. |
+| `-b, --bandwith-in-mb`       | Maximum bandwidth for DiskBalancer per 
second.                                                        |
+| `-p, --parallel-thread`      | Max parallelThread for DiskBalancer.          
                                                        |
+| `-s, --stop-after-disk-even` | Stop DiskBalancer automatically after disk 
utilization is even.                                       |
+| `-a, --all`                  | Run commands on all datanodes.                
                                                        |
+| `-d, --datanodes`            | Run commands on specific datanodes            
                                                        |
 
 ### **Stop DiskBalancer**
 To stop DiskBalancer on all Datanodes:
diff --git a/hadoop-hdds/docs/content/feature/DiskBalancer.zh.md 
b/hadoop-hdds/docs/content/feature/DiskBalancer.zh.md
index d417b2c1fc3..8c5801a46b0 100644
--- a/hadoop-hdds/docs/content/feature/DiskBalancer.zh.md
+++ b/hadoop-hdds/docs/content/feature/DiskBalancer.zh.md
@@ -37,9 +37,19 @@ summary: 数据节点的磁盘平衡器.
 
 ![Disk Even](diskBalancer.png)
 
+## 功能标志
+
+磁盘平衡器功能已通过功能标志引入。默认情况下,此功能处于禁用状态。
+
+可以通过在“ozone-site.xml”配置文件中将以下属性设置为“true”来**启用**该功能:
+`hdds.datanode.disk.balancer.enabled = false`
+
 ## 命令行用法
 DiskBalancer 通过 `ozone admin datanode diskbalancer` 命令进行管理。
 
+**注意:**此命令在主帮助信息(`ozone admin datanode 
--help`)中隐藏。这是因为该功能目前处于实验阶段,默认禁用。隐藏该命令可防止意外使用,
+并为普通用户提供清晰的帮助输出。但是,对于希望启用和使用该功能的用户,该命令仍然完全可用。
+
 ### **启动 DiskBalancer**
 要在所有 Datanode 上使用默认配置启动 DiskBalancer,请执行以下操作:
 
diff --git a/hadoop-hdds/interface-admin/src/main/proto/ScmAdminProtocol.proto 
b/hadoop-hdds/interface-admin/src/main/proto/ScmAdminProtocol.proto
index 9c338acc4be..79411c56fe3 100644
--- a/hadoop-hdds/interface-admin/src/main/proto/ScmAdminProtocol.proto
+++ b/hadoop-hdds/interface-admin/src/main/proto/ScmAdminProtocol.proto
@@ -86,7 +86,7 @@ message ScmContainerLocationRequest {
   optional GetMetricsRequestProto getMetricsRequest = 47;
   optional ContainerBalancerStatusInfoRequestProto 
containerBalancerStatusInfoRequest = 48;
   optional ReconcileContainerRequestProto reconcileContainerRequest = 49;
-  optional DatanodeDiskBalancerInfoRequestProto 
DatanodeDiskBalancerInfoRequest = 50;
+  optional DatanodeDiskBalancerInfoRequestProto 
datanodeDiskBalancerInfoRequest = 50;
   optional DatanodeDiskBalancerOpRequestProto datanodeDiskBalancerOpRequest = 
51;
 }
 
diff --git 
a/hadoop-ozone/cli-admin/src/main/java/org/apache/hadoop/hdds/scm/cli/datanode/DiskBalancerCommands.java
 
b/hadoop-ozone/cli-admin/src/main/java/org/apache/hadoop/hdds/scm/cli/datanode/DiskBalancerCommands.java
index fd8a98468f8..dc5f108788b 100644
--- 
a/hadoop-ozone/cli-admin/src/main/java/org/apache/hadoop/hdds/scm/cli/datanode/DiskBalancerCommands.java
+++ 
b/hadoop-ozone/cli-admin/src/main/java/org/apache/hadoop/hdds/scm/cli/datanode/DiskBalancerCommands.java
@@ -32,8 +32,8 @@
  * To start:
  *      ozone admin datanode diskbalancer start
  *      [ -t/--threshold {@literal <threshold>}]
- *      [ -b/--bandwidthInMB {@literal <bandwidthInMB>}]
- *      [ -p/--parallelThread {@literal <parallelThread>}]
+ *      [ -b/--bandwidth-in-mb {@literal <bandwidthInMB>}]
+ *      [ -p/--parallel-thread {@literal <parallelThread>}]
  *      [ -s/--stop-after-disk-even {@literal <stopAfterDiskEven>}]
  *      [ -a/--all {@literal <alldatanodes>}]
  *      [ -d/--datanodes {@literal <datanodes>}]
@@ -78,9 +78,11 @@
 
 @Command(
     name = "diskbalancer",
-    description = "DiskBalancer specific operations",
+    description = "DiskBalancer specific operations. It is disabled by 
default." +
+        " To enable it, set 'hdds.datanode.disk.balancer.enabled' as true",
     mixinStandardHelpOptions = true,
     versionProvider = HddsVersionProvider.class,
+    hidden = true,
     subcommands = {
         DiskBalancerStartSubcommand.class,
         DiskBalancerStopSubcommand.class,
diff --git 
a/hadoop-ozone/cli-admin/src/main/java/org/apache/hadoop/hdds/scm/cli/datanode/DiskBalancerCommonOptions.java
 
b/hadoop-ozone/cli-admin/src/main/java/org/apache/hadoop/hdds/scm/cli/datanode/DiskBalancerCommonOptions.java
index 2abac224967..2ec295682dc 100644
--- 
a/hadoop-ozone/cli-admin/src/main/java/org/apache/hadoop/hdds/scm/cli/datanode/DiskBalancerCommonOptions.java
+++ 
b/hadoop-ozone/cli-admin/src/main/java/org/apache/hadoop/hdds/scm/cli/datanode/DiskBalancerCommonOptions.java
@@ -33,7 +33,8 @@ public class DiskBalancerCommonOptions {
   @CommandLine.Option(names = {"-d", "--datanodes"},
       description = "Run commands on specific datanodes, the content can be " +
           "a list of hostnames or IPs. " +
-          "Examples: hostname1,hostname2,hostname3 or ip1,ip2,ip3")
+          "Examples: hostname1,hostname2,hostname3 or ip1,ip2,ip3",
+      split = ",")
   private List<String> datanodes = new ArrayList<>();
 
   /**
diff --git 
a/hadoop-ozone/cli-admin/src/main/java/org/apache/hadoop/hdds/scm/cli/datanode/DiskBalancerStartSubcommand.java
 
b/hadoop-ozone/cli-admin/src/main/java/org/apache/hadoop/hdds/scm/cli/datanode/DiskBalancerStartSubcommand.java
index 49d1fe01050..f2731f86b6f 100644
--- 
a/hadoop-ozone/cli-admin/src/main/java/org/apache/hadoop/hdds/scm/cli/datanode/DiskBalancerStartSubcommand.java
+++ 
b/hadoop-ozone/cli-admin/src/main/java/org/apache/hadoop/hdds/scm/cli/datanode/DiskBalancerStartSubcommand.java
@@ -44,11 +44,11 @@ public class DiskBalancerStartSubcommand extends 
ScmSubcommand {
           "example, '10' for 10%%).")
   private Double threshold;
 
-  @Option(names = {"-b", "--bandwidthInMB"},
+  @Option(names = {"-b", "--bandwidth-in-mb"},
       description = "Maximum bandwidth for DiskBalancer per second.")
   private Long bandwidthInMB;
 
-  @Option(names = {"-p", "--parallelThread"},
+  @Option(names = {"-p", "--parallel-thread"},
       description = "Max parallelThread for DiskBalancer.")
   private Integer parallelThread;
 
diff --git 
a/hadoop-ozone/cli-admin/src/main/java/org/apache/hadoop/hdds/scm/cli/datanode/DiskBalancerUpdateSubcommand.java
 
b/hadoop-ozone/cli-admin/src/main/java/org/apache/hadoop/hdds/scm/cli/datanode/DiskBalancerUpdateSubcommand.java
index b6d2dcc4510..37e50ad6c94 100644
--- 
a/hadoop-ozone/cli-admin/src/main/java/org/apache/hadoop/hdds/scm/cli/datanode/DiskBalancerUpdateSubcommand.java
+++ 
b/hadoop-ozone/cli-admin/src/main/java/org/apache/hadoop/hdds/scm/cli/datanode/DiskBalancerUpdateSubcommand.java
@@ -44,11 +44,11 @@ public class DiskBalancerUpdateSubcommand extends 
ScmSubcommand {
           "example, '10' for 10%%).")
   private Double threshold;
 
-  @Option(names = {"-b", "--bandwidthInMB"},
+  @Option(names = {"-b", "--bandwidth-in-mb"},
       description = "Maximum bandwidth for DiskBalancer per second.")
   private Long bandwidthInMB;
 
-  @Option(names = {"-p", "--parallelThread"},
+  @Option(names = {"-p", "--parallel-thread"},
       description = "Max parallelThread for DiskBalancer.")
   private Integer parallelThread;
 


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to