|
@@ -45,6 +45,7 @@ import static org.apache.hadoop.hdfs.DFSConfigKeys.DFS_DATANODE_FILEIO_PROFILING
|
|
|
import static org.apache.hadoop.hdfs.DFSConfigKeys.DFS_DATANODE_MIN_OUTLIER_DETECTION_DISKS_KEY;
|
|
|
import static org.apache.hadoop.hdfs.DFSConfigKeys.DFS_DATANODE_OUTLIERS_REPORT_INTERVAL_KEY;
|
|
|
import static org.apache.hadoop.hdfs.DFSConfigKeys.DFS_DATANODE_SLOWDISK_LOW_THRESHOLD_MS_KEY;
|
|
|
+import static org.apache.hadoop.hdfs.DFSConfigKeys.DFS_DATANODE_MAX_SLOWDISKS_TO_EXCLUDE_KEY;
|
|
|
import static org.junit.Assert.assertEquals;
|
|
|
import static org.junit.Assert.assertFalse;
|
|
|
import static org.junit.Assert.assertNull;
|
|
@@ -636,13 +637,15 @@ public class TestDataNodeReconfiguration {
|
|
|
String[] slowDisksParameters2 = {
|
|
|
DFS_DATANODE_FILEIO_PROFILING_SAMPLING_PERCENTAGE_KEY,
|
|
|
DFS_DATANODE_MIN_OUTLIER_DETECTION_DISKS_KEY,
|
|
|
- DFS_DATANODE_SLOWDISK_LOW_THRESHOLD_MS_KEY};
|
|
|
+ DFS_DATANODE_SLOWDISK_LOW_THRESHOLD_MS_KEY,
|
|
|
+ DFS_DATANODE_MAX_SLOWDISKS_TO_EXCLUDE_KEY};
|
|
|
for (String parameter : slowDisksParameters2) {
|
|
|
dn.reconfigureProperty(parameter, "99");
|
|
|
}
|
|
|
// Assert diskMetrics.
|
|
|
assertEquals(99, dn.getDiskMetrics().getMinOutlierDetectionDisks());
|
|
|
assertEquals(99, dn.getDiskMetrics().getLowThresholdMs());
|
|
|
+ assertEquals(99, dn.getDiskMetrics().getMaxSlowDisksToExclude());
|
|
|
// Assert dnConf.
|
|
|
assertTrue(dn.getDnConf().diskStatsEnabled);
|
|
|
// Assert profilingEventHook.
|
|
@@ -673,12 +676,16 @@ public class TestDataNodeReconfiguration {
|
|
|
dn.reconfigureProperty(DFS_DATANODE_FILEIO_PROFILING_SAMPLING_PERCENTAGE_KEY, "1");
|
|
|
dn.reconfigureProperty(DFS_DATANODE_MIN_OUTLIER_DETECTION_DISKS_KEY, null);
|
|
|
dn.reconfigureProperty(DFS_DATANODE_SLOWDISK_LOW_THRESHOLD_MS_KEY, null);
|
|
|
+ dn.reconfigureProperty(DFS_DATANODE_MAX_SLOWDISKS_TO_EXCLUDE_KEY, null);
|
|
|
assertEquals(String.format("expect %s is not configured",
|
|
|
DFS_DATANODE_MIN_OUTLIER_DETECTION_DISKS_KEY), null,
|
|
|
dn.getConf().get(DFS_DATANODE_MIN_OUTLIER_DETECTION_DISKS_KEY));
|
|
|
assertEquals(String.format("expect %s is not configured",
|
|
|
DFS_DATANODE_SLOWDISK_LOW_THRESHOLD_MS_KEY), null,
|
|
|
dn.getConf().get(DFS_DATANODE_SLOWDISK_LOW_THRESHOLD_MS_KEY));
|
|
|
+ assertEquals(String.format("expect %s is not configured",
|
|
|
+ DFS_DATANODE_MAX_SLOWDISKS_TO_EXCLUDE_KEY), null,
|
|
|
+ dn.getConf().get(DFS_DATANODE_MAX_SLOWDISKS_TO_EXCLUDE_KEY));
|
|
|
assertEquals(DFS_DATANODE_MIN_OUTLIER_DETECTION_DISKS_DEFAULT,
|
|
|
dn.getDiskMetrics().getSlowDiskDetector().getMinOutlierDetectionNodes());
|
|
|
assertEquals(DFS_DATANODE_SLOWDISK_LOW_THRESHOLD_MS_DEFAULT,
|