use of org.apache.hadoop.hbase.HBaseTestingUtil in project hbase by apache.
the class TestBucketCache method testRetrieveFromMultipleFiles.
@Test
public void testRetrieveFromMultipleFiles() throws Exception {
final Path testDirInitial = createAndGetTestDir();
final Path newTestDir = new HBaseTestingUtil().getDataTestDir();
HBASE_TESTING_UTILITY.getTestFileSystem().mkdirs(newTestDir);
String ioEngineName = new StringBuilder("files:").append(testDirInitial).append("/bucket1.cache").append(FileIOEngine.FILE_DELIMITER).append(newTestDir).append("/bucket2.cache").toString();
testRetrievalUtils(testDirInitial, ioEngineName);
int[] smallBucketSizes = new int[] { 3 * 1024, 5 * 1024 };
String persistencePath = testDirInitial + "/bucket.persistence";
BucketCache bucketCache = new BucketCache(ioEngineName, capacitySize, constructedBlockSize, smallBucketSizes, writeThreads, writerQLen, persistencePath);
assertFalse(new File(persistencePath).exists());
assertEquals(0, bucketCache.getAllocator().getUsedSize());
assertEquals(0, bucketCache.backingMap.size());
HBASE_TESTING_UTILITY.cleanupTestDir();
}
use of org.apache.hadoop.hbase.HBaseTestingUtil in project hbase by apache.
the class TestCompactionArchiveConcurrentClose method setup.
@Before
public void setup() throws Exception {
testUtil = new HBaseTestingUtil();
testDir = testUtil.getDataTestDir("TestStoreFileRefresherChore");
CommonFSUtils.setRootDir(testUtil.getConfiguration(), testDir);
}
use of org.apache.hadoop.hbase.HBaseTestingUtil in project hbase by apache.
the class TestCleanupCompactedFileAfterFailover method beforeClass.
@BeforeClass
public static void beforeClass() throws Exception {
TEST_UTIL = new HBaseTestingUtil();
// Set the scanner lease to 20min, so the scanner can't be closed by RegionServer
TEST_UTIL.getConfiguration().setInt(HConstants.HBASE_CLIENT_SCANNER_TIMEOUT_PERIOD, 1200000);
TEST_UTIL.getConfiguration().setInt(CompactionConfiguration.HBASE_HSTORE_COMPACTION_MIN_KEY, 100);
TEST_UTIL.getConfiguration().set("dfs.blocksize", "64000");
TEST_UTIL.getConfiguration().set("dfs.namenode.fs-limits.min-block-size", "1024");
TEST_UTIL.getConfiguration().set(TimeToLiveHFileCleaner.TTL_CONF_KEY, "0");
TEST_UTIL.startMiniCluster(RS_NUMBER);
admin = TEST_UTIL.getAdmin();
}
use of org.apache.hadoop.hbase.HBaseTestingUtil in project hbase by apache.
the class TestBlocksScanned method setUp.
@Before
public void setUp() throws Exception {
TEST_UTIL = new HBaseTestingUtil();
conf = TEST_UTIL.getConfiguration();
testDir = TEST_UTIL.getDataTestDir("TestBlocksScanned");
}
use of org.apache.hadoop.hbase.HBaseTestingUtil in project hbase by apache.
the class TestCleanupCompactedFileOnRegionClose method beforeClass.
@BeforeClass
public static void beforeClass() throws Exception {
util = new HBaseTestingUtil();
util.getConfiguration().setInt(CompactionConfiguration.HBASE_HSTORE_COMPACTION_MIN_KEY, 100);
util.getConfiguration().set("dfs.blocksize", "64000");
util.getConfiguration().set("dfs.namenode.fs-limits.min-block-size", "1024");
util.getConfiguration().set(TimeToLiveHFileCleaner.TTL_CONF_KEY, "0");
util.startMiniCluster(2);
}
Aggregations