tomscut commented on code in PR #5793:
URL: https://github.com/apache/hadoop/pull/5793#discussion_r1361415121
##########
hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/TestReservedSpaceCalculator.java:
##########
@@ -168,6 +168,29 @@ public void testReservedSpaceAggresivePerStorageType() {
checkReserved(StorageType.ARCHIVE, 100000, 5000);
}
+ @Test
+ public void testReservedSpaceAbsolutePerDir() {
+ conf.setClass(DFS_DATANODE_DU_RESERVED_CALCULATOR_KEY,
ReservedSpaceCalculatorAbsolute.class,
+ ReservedSpaceCalculator.class);
+
+ String dir1 = "/data/hdfs1/data";
+ String dir2 = "/data/hdfs2/data";
+ String dir3 = "/data/hdfs3/data";
+
+ conf.setLong(DFS_DATANODE_DU_RESERVED_KEY + "." + dir1 + ".ssd", 900);
+ conf.setLong(DFS_DATANODE_DU_RESERVED_KEY + "." + dir1, 1800);
+ conf.setLong(DFS_DATANODE_DU_RESERVED_KEY + "." + dir2, 2700);
+ conf.setLong(DFS_DATANODE_DU_RESERVED_KEY + ".ssd", 3600);
+ conf.setLong(DFS_DATANODE_DU_RESERVED_KEY, 4500);
+
+ checkReserved(StorageType.SSD, 10000, 900, dir1);
+ checkReserved(StorageType.DISK, 10000, 1800, dir1);
+ checkReserved(StorageType.SSD, 10000, 2700, dir2);
+ checkReserved(StorageType.DISK, 10000, 2700, dir2);
+ checkReserved(StorageType.SSD, 10000, 3600, dir3);
+ checkReserved(StorageType.DISK, 10000, 4500, dir3);
+ }
+
Review Comment:
We can add a unit test for `DU_RESERVED_PERCENTAGE_KEY`.
--
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]