From e71253f4d8db0f808b4a2d27f66fca37b1ad0632 Mon Sep 17 00:00:00 2001 From: tianhang Date: Sat, 11 Feb 2023 19:39:03 +0800 Subject: [PATCH] HBASE-27602 Remove the impact of operating env on testHFileCleaning (#5003) Co-authored-by: tianhang.tang Signed-off-by: Duo Zhang --- .../hadoop/hbase/master/cleaner/TestHFileCleaner.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/cleaner/TestHFileCleaner.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/cleaner/TestHFileCleaner.java index 02ad398d8ae9..ba16ec12daf2 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/cleaner/TestHFileCleaner.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/cleaner/TestHFileCleaner.java @@ -67,6 +67,9 @@ public class TestHFileCleaner { private static DirScanPool POOL; + private static String MOCK_ARCHIVED_HFILE_DIR = + HConstants.HFILE_ARCHIVE_DIRECTORY + "/namespace/table/region"; + @BeforeClass public static void setupCluster() throws Exception { // have to use a minidfs cluster because the localfs doesn't modify file times correctly @@ -158,8 +161,7 @@ public void testHFileCleaning() throws Exception { + "org.apache.hadoop.hbase.mob.ManualMobMaintHFileCleaner"); conf.setLong(TimeToLiveHFileCleaner.TTL_CONF_KEY, ttl); Server server = new DummyServer(); - Path archivedHfileDir = - new Path(UTIL.getDataTestDirOnTestFS(), HConstants.HFILE_ARCHIVE_DIRECTORY); + Path archivedHfileDir = new Path(UTIL.getDataTestDirOnTestFS(), MOCK_ARCHIVED_HFILE_DIR); FileSystem fs = FileSystem.get(conf); HFileCleaner cleaner = new HFileCleaner(1000, server, conf, fs, archivedHfileDir, POOL);