Search in sources :

Example 36 with HBaseTestingUtil

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);
}
Also used : RegionInfo(org.apache.hadoop.hbase.client.RegionInfo) HBaseTestingUtil(org.apache.hadoop.hbase.HBaseTestingUtil)

Example 37 with HBaseTestingUtil

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);
}
Also used : HBaseTestingUtil(org.apache.hadoop.hbase.HBaseTestingUtil) Before(org.junit.Before)

Example 38 with HBaseTestingUtil

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();
}
Also used : HBaseTestingUtil(org.apache.hadoop.hbase.HBaseTestingUtil) Before(org.junit.Before)

Example 39 with HBaseTestingUtil

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);
}
Also used : HBaseTestingUtil(org.apache.hadoop.hbase.HBaseTestingUtil) BeforeClass(org.junit.BeforeClass)

Example 40 with HBaseTestingUtil

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());
}
Also used : HBaseTestingUtil(org.apache.hadoop.hbase.HBaseTestingUtil)

Aggregations

HBaseTestingUtil (org.apache.hadoop.hbase.HBaseTestingUtil)144 Configuration (org.apache.hadoop.conf.Configuration)42 Test (org.junit.Test)42 Before (org.junit.Before)41 BeforeClass (org.junit.BeforeClass)37 Path (org.apache.hadoop.fs.Path)24 HBaseConfiguration (org.apache.hadoop.hbase.HBaseConfiguration)22 Admin (org.apache.hadoop.hbase.client.Admin)22 RegionInfo (org.apache.hadoop.hbase.client.RegionInfo)15 StartTestingClusterOption (org.apache.hadoop.hbase.StartTestingClusterOption)14 FileSystem (org.apache.hadoop.fs.FileSystem)13 MiniZooKeeperCluster (org.apache.hadoop.hbase.zookeeper.MiniZooKeeperCluster)12 TableName (org.apache.hadoop.hbase.TableName)10 TableDescriptor (org.apache.hadoop.hbase.client.TableDescriptor)10 SingleProcessHBaseCluster (org.apache.hadoop.hbase.SingleProcessHBaseCluster)9 ServerName (org.apache.hadoop.hbase.ServerName)8 Table (org.apache.hadoop.hbase.client.Table)8 ZKWatcher (org.apache.hadoop.hbase.zookeeper.ZKWatcher)8 IOException (java.io.IOException)7 ArrayList (java.util.ArrayList)7