HBASE-27602 Remove the impact of operating env on testHFileCleaning (#5003)

Co-authored-by: tianhang.tang <tianhang.tang@shopee.com>
Signed-off-by: Duo Zhang <zhangduo@apache.org>
This commit is contained in:
tianhang 2023-02-11 19:39:03 +08:00 committed by GitHub
parent 833b10e8ba
commit e71253f4d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -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 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);