ThinkerLei commented on a change in pull request #3898:
URL: https://github.com/apache/hadoop/pull/3898#discussion_r787408830
##########
File path:
hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestQuota.java
##########
@@ -958,6 +959,33 @@ public void testQuotaByStorageType() throws Exception {
6 * fileSpace);
}
+ @Test
+ public void testRenameInodeWithStorageType() throws IOException {
+ final int SIZE = 64;
+ final short REPL = 1;
+ final Path foo = new Path("/foo");
+ final Path bs1 = new Path(foo, "bs1");
+ final Path wow = new Path(bs1, "wow");
+ final Path bs2 = new Path(foo, "bs2");
+ final Path wow2 = new Path(bs2,"wow2");
+
+ dfs.mkdirs(bs1, FsPermission.getDirDefault());
+ dfs.mkdirs(bs2, FsPermission.getDirDefault());
+ dfs.setQuota(bs1,1000, 434217728);
+ dfs.setQuota(bs2,1000, 434217728);
+ dfs.setStoragePolicy(bs2, HdfsConstants.ONESSD_STORAGE_POLICY_NAME);
+
+ DFSTestUtil.createFile(dfs, wow, SIZE, REPL, 0);
+ DFSTestUtil.createFile(dfs, wow2, SIZE, REPL, 0);
+ assertTrue("without storage policy, typeConsumed should be 0.",
+ dfs.getQuotaUsage(bs1).getTypeConsumed(StorageType.SSD) == 0);
+ assertTrue("with storage policy, typeConsumed should not be 0.",
+ dfs.getQuotaUsage(bs2).getTypeConsumed(StorageType.SSD) != 0);
+ dfs.rename(bs2, bs1);
+ assertTrue("rename with storage policy, typeConsumed should not be 0.",
+ dfs.getQuotaUsage(bs1).getTypeConsumed(StorageType.SSD) != 0);
Review comment:
@ayushtkn thank you very much for your comment. Yes, directory bs1 is
hot but its subdirectory bs2 is setted one_ssd. In this situation, dir bs2 will
use itself block storage policy rather than his parent storage policy, is it?
--
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]