You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by zh...@apache.org on 2023/02/11 12:20:26 UTC

[hbase] 01/02: HBASE-27602 Remove the impact of operating env on testHFileCleaning (#5003)

This is an automated email from the ASF dual-hosted git repository.

zhangduo pushed a commit to branch branch-2.4
in repository https://gitbox.apache.org/repos/asf/hbase.git

commit af6b63a14a98d5f4af0949090c382728b6782e6d
Author: tianhang <ta...@gmail.com>
AuthorDate: Sat Feb 11 19:39:03 2023 +0800

    HBASE-27602 Remove the impact of operating env on testHFileCleaning (#5003)
    
    Co-authored-by: tianhang.tang <ti...@shopee.com>
    Signed-off-by: Duo Zhang <zh...@apache.org>
    (cherry picked from commit e71253f4d8db0f808b4a2d27f66fca37b1ad0632)
---
 .../org/apache/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 1a491977033..e9a6db364d4 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
@@ -71,6 +71,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
@@ -162,8 +165,7 @@ public class TestHFileCleaner {
         + "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);