[ 
https://issues.apache.org/jira/browse/HDFS-16397?focusedWorklogId=732031&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-732031
 ]

ASF GitHub Bot logged work on HDFS-16397:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 24/Feb/22 01:25
            Start Date: 24/Feb/22 01:25
    Worklog Time Spent: 10m 
      Work Description: tasanuma commented on a change in pull request #3828:
URL: https://github.com/apache/hadoop/pull/3828#discussion_r813467175



##########
File path: 
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BPServiceActor.java
##########
@@ -1356,10 +1358,21 @@ long getBlockReportIntervalMs() {
     }
 
     void setBlockReportIntervalMs(long intervalMs) {
-      Preconditions.checkArgument(intervalMs > 0);
+      Preconditions.checkArgument(intervalMs > 0,
+          DFS_BLOCKREPORT_INTERVAL_MSEC_KEY + " should be larger than 0");
       this.blockReportIntervalMs = intervalMs;
     }
 
+    void setOutliersReportIntervalMs(long intervalMs) {
+      Preconditions.checkArgument(intervalMs > 0,
+      DFS_DATANODE_OUTLIERS_REPORT_INTERVAL_KEY + " should be larger than 0");
+      this.outliersReportIntervalMs = intervalMs;
+    }
+
+    long getOutliersReportIntervalMs() {

Review comment:
       Please add VisibleForTesting.

##########
File path: 
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/ProfilingFileIoEvents.java
##########
@@ -145,4 +137,24 @@ private DataNodeVolumeMetrics getVolumeMetrics(final 
FsVolumeSpi volume) {
     }
     return null;
   }
+
+  public void setSampleRangeMax(int fileIOSamplingPercentage) {
+    isEnabled = Util.isDiskStatsEnabled(fileIOSamplingPercentage);
+    if (fileIOSamplingPercentage > 100) {
+      LOG.warn(DFSConfigKeys
+          .DFS_DATANODE_FILEIO_PROFILING_SAMPLING_PERCENTAGE_KEY +
+          " value cannot be more than 100. Setting value to 100");
+      fileIOSamplingPercentage = 100;
+    }
+    sampleRangeMax = (int) ((double) fileIOSamplingPercentage / 100 *
+        Integer.MAX_VALUE);
+  }
+
+  public boolean getDiskStatsEnabled() {

Review comment:
       You can remove this method since it isn't used anywhere. Or let's use it 
in the unit test and add VisibleForTesting.

##########
File path: 
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/ProfilingFileIoEvents.java
##########
@@ -145,4 +137,24 @@ private DataNodeVolumeMetrics getVolumeMetrics(final 
FsVolumeSpi volume) {
     }
     return null;
   }
+
+  public void setSampleRangeMax(int fileIOSamplingPercentage) {
+    isEnabled = Util.isDiskStatsEnabled(fileIOSamplingPercentage);
+    if (fileIOSamplingPercentage > 100) {
+      LOG.warn(DFSConfigKeys
+          .DFS_DATANODE_FILEIO_PROFILING_SAMPLING_PERCENTAGE_KEY +
+          " value cannot be more than 100. Setting value to 100");
+      fileIOSamplingPercentage = 100;
+    }
+    sampleRangeMax = (int) ((double) fileIOSamplingPercentage / 100 *
+        Integer.MAX_VALUE);
+  }
+
+  public boolean getDiskStatsEnabled() {
+    return isEnabled;
+  }
+
+  public int getSampleRangeMax() {

Review comment:
       Please add VisibleForTesting.




-- 
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: common-issues-unsubscr...@hadoop.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 732031)
    Time Spent: 1h 40m  (was: 1.5h)

> Reconfig slow disk parameters for datanode
> ------------------------------------------
>
>                 Key: HDFS-16397
>                 URL: https://issues.apache.org/jira/browse/HDFS-16397
>             Project: Hadoop HDFS
>          Issue Type: New Feature
>            Reporter: tomscut
>            Assignee: tomscut
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 1h 40m
>  Remaining Estimate: 0h
>
> In large clusters, rolling restart datanodes takes long time. We can make 
> slow peers parameters and slow disks parameters in datanode reconfigurable to 
> facilitate cluster operation and maintenance.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

---------------------------------------------------------------------
To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org

Reply via email to