use of org.apache.hadoop.hbase.HBaseTestingUtil in project hbase by apache.
the class TestMobStoreCompaction method init.
private void init(Configuration conf, long mobThreshold) throws Exception {
this.conf = conf;
this.mobCellThreshold = mobThreshold;
HBaseTestingUtil UTIL = new HBaseTestingUtil(conf);
compactionThreshold = conf.getInt("hbase.hstore.compactionThreshold", 3);
familyDescriptor = ColumnFamilyDescriptorBuilder.newBuilder(COLUMN_FAMILY).setMobEnabled(true).setMobThreshold(mobThreshold).setMaxVersions(1).build();
tableDescriptor = UTIL.createModifyableTableDescriptor(name.getMethodName()).modifyColumnFamily(familyDescriptor).build();
RegionInfo regionInfo = RegionInfoBuilder.newBuilder(tableDescriptor.getTableName()).build();
region = HBaseTestingUtil.createRegionAndWAL(regionInfo, UTIL.getDataTestDir(), conf, tableDescriptor, new MobFileCache(conf));
fs = FileSystem.get(conf);
}
use of org.apache.hadoop.hbase.HBaseTestingUtil in project hbase by apache.
the class TestCanaryTool method setUp.
@Before
public void setUp() throws Exception {
testingUtility = new HBaseTestingUtil();
testingUtility.startMiniCluster();
mockAppender = mock(org.apache.logging.log4j.core.Appender.class);
when(mockAppender.getName()).thenReturn("mockAppender");
when(mockAppender.isStarted()).thenReturn(true);
((org.apache.logging.log4j.core.Logger) org.apache.logging.log4j.LogManager.getLogger("org.apache.hadoop.hbase")).addAppender(mockAppender);
}
use of org.apache.hadoop.hbase.HBaseTestingUtil in project hbase by apache.
the class TestSnapshotManifest method setup.
@Before
public void setup() throws Exception {
TEST_UTIL = new HBaseTestingUtil();
rootDir = TEST_UTIL.getDataTestDir(TABLE_NAME_STR);
fs = TEST_UTIL.getTestFileSystem();
conf = TEST_UTIL.getConfiguration();
SnapshotTestingUtils.SnapshotMock snapshotMock = new SnapshotTestingUtils.SnapshotMock(conf, fs, rootDir);
builder = snapshotMock.createSnapshotV2("snapshot", TABLE_NAME_STR, 0);
snapshotDir = builder.commit();
snapshotDesc = builder.getSnapshotDescription();
}
use of org.apache.hadoop.hbase.HBaseTestingUtil in project hbase by apache.
the class TestBulkLoadHFilesSplitRecovery method setupCluster.
@BeforeClass
public static void setupCluster() throws Exception {
util = new HBaseTestingUtil();
util.getConfiguration().set(CoprocessorHost.REGION_COPROCESSOR_CONF_KEY, "");
util.startMiniCluster(1);
}
use of org.apache.hadoop.hbase.HBaseTestingUtil in project hbase by apache.
the class TestScannerFromBucketCache method setUp.
private void setUp(boolean useBucketCache) throws IOException {
test_util = new HBaseTestingUtil();
conf = test_util.getConfiguration();
if (useBucketCache) {
conf.setInt("hbase.bucketcache.size", 400);
conf.setStrings(HConstants.BUCKET_CACHE_IOENGINE_KEY, "offheap");
conf.setInt("hbase.bucketcache.writer.threads", 10);
conf.setFloat("hfile.block.cache.size", 0.2f);
conf.setFloat("hbase.regionserver.global.memstore.size", 0.1f);
}
tableName = TableName.valueOf(name.getMethodName());
}
Aggregations