use of org.apache.hadoop.hbase.HBaseTestingUtil in project hbase by apache.
the class TestSnapshotCleanerChore method testSnapshotCleanerWithReadIOE.
@Test
public void testSnapshotCleanerWithReadIOE() throws IOException {
snapshotManager = Mockito.mock(SnapshotManager.class);
Stoppable stopper = new StoppableImplementation();
Configuration conf = new HBaseTestingUtil().getConfiguration();
SnapshotCleanerChore snapshotCleanerChore = new SnapshotCleanerChore(stopper, conf, snapshotManager);
Mockito.when(snapshotManager.getCompletedSnapshots()).thenThrow(IOException.class);
try {
LOG.info("While getting completed Snapshots, IOException would occur. Hence, No Snapshot" + " should be deleted");
snapshotCleanerChore.chore();
} finally {
stopper.stop("Stopping Test Stopper");
}
Mockito.verify(snapshotManager, Mockito.times(0)).deleteSnapshot(Mockito.any());
}
use of org.apache.hadoop.hbase.HBaseTestingUtil in project hbase by apache.
the class TestRegionMoveAndAbandon method setup.
@Before
public void setup() throws Exception {
UTIL = new HBaseTestingUtil();
zkCluster = UTIL.startMiniZKCluster();
StartTestingClusterOption option = StartTestingClusterOption.builder().numRegionServers(2).build();
cluster = UTIL.startMiniHBaseCluster(option);
rs1 = cluster.getRegionServer(0);
rs2 = cluster.getRegionServer(1);
assertEquals(2, cluster.getRegionServerThreads().size());
tableName = TableName.valueOf(name.getMethodName());
UTIL.createTable(tableName, Bytes.toBytes("cf"));
UTIL.waitTableAvailable(tableName, 30_000);
regionInfo = Iterables.getOnlyElement(cluster.getRegions(tableName)).getRegionInfo();
}
use of org.apache.hadoop.hbase.HBaseTestingUtil in project hbase by apache.
the class TestRecoveredEditsReplayAndAbort method setup.
@Before
public void setup() throws IOException {
TEST_UTIL = new HBaseTestingUtil();
CONF = TEST_UTIL.getConfiguration();
method = name.getMethodName();
tableName = TableName.valueOf(method);
}
use of org.apache.hadoop.hbase.HBaseTestingUtil in project hbase by apache.
the class TestMemStoreSegmentsIterator method setup.
@Before
public void setup() throws IOException {
Configuration conf = new Configuration();
HBaseTestingUtil hbaseUtility = new HBaseTestingUtil(conf);
TableDescriptorBuilder tableDescriptorBuilder = TableDescriptorBuilder.newBuilder(TableName.valueOf(TABLE));
ColumnFamilyDescriptor columnFamilyDescriptor = ColumnFamilyDescriptorBuilder.newBuilder(Bytes.toBytes(FAMILY)).build();
tableDescriptorBuilder.setColumnFamily(columnFamilyDescriptor);
RegionInfo info = RegionInfoBuilder.newBuilder(TableName.valueOf(TABLE)).build();
Path rootPath = hbaseUtility.getDataTestDir(ROOT_SUB_PATH);
this.wal = HBaseTestingUtil.createWal(conf, rootPath, info);
this.region = HRegion.createHRegion(info, rootPath, conf, tableDescriptorBuilder.build(), this.wal, true);
this.store = new HStore(this.region, columnFamilyDescriptor, conf, false);
this.comparator = CellComparator.getInstance();
this.compactionKVMax = HConstants.COMPACTION_KV_MAX_DEFAULT;
}
use of org.apache.hadoop.hbase.HBaseTestingUtil in project hbase by apache.
the class TestAccessControlFilter method setupBeforeClass.
@BeforeClass
public static void setupBeforeClass() throws Exception {
TEST_UTIL = new HBaseTestingUtil();
Configuration conf = TEST_UTIL.getConfiguration();
// Up the handlers; this test needs more than usual.
conf.setInt(HConstants.REGION_SERVER_HIGH_PRIORITY_HANDLER_COUNT, 10);
enableSecurity(conf);
verifyConfiguration(conf);
// We expect 0.98 scanning semantics
conf.setBoolean(AccessControlConstants.CF_ATTRIBUTE_EARLY_OUT, false);
TEST_UTIL.startMiniCluster();
TEST_UTIL.waitTableEnabled(PermissionStorage.ACL_TABLE_NAME.getName(), 50000);
READER = User.createUserForTesting(conf, "reader", new String[0]);
LIMITED = User.createUserForTesting(conf, "limited", new String[0]);
DENIED = User.createUserForTesting(conf, "denied", new String[0]);
}
Aggregations