Search in sources :

Example 6 with PleaseHoldException

use of org.apache.hadoop.hbase.PleaseHoldException in project hbase by apache.

the class TestMaster method testMoveRegionWhenNotInitialized.

@Test
public void testMoveRegionWhenNotInitialized() {
    SingleProcessHBaseCluster cluster = TEST_UTIL.getHBaseCluster();
    HMaster m = cluster.getMaster();
    try {
        // fake it, set back later
        m.setInitialized(false);
        RegionInfo meta = RegionInfoBuilder.FIRST_META_REGIONINFO;
        m.move(meta.getEncodedNameAsBytes(), null);
        fail("Region should not be moved since master is not initialized");
    } catch (IOException ioe) {
        assertTrue(ioe instanceof PleaseHoldException);
    } finally {
        m.setInitialized(true);
    }
}
Also used : SingleProcessHBaseCluster(org.apache.hadoop.hbase.SingleProcessHBaseCluster) PleaseHoldException(org.apache.hadoop.hbase.PleaseHoldException) RegionInfo(org.apache.hadoop.hbase.client.RegionInfo) IOException(java.io.IOException) Test(org.junit.Test)

Aggregations

PleaseHoldException (org.apache.hadoop.hbase.PleaseHoldException)6 IOException (java.io.IOException)5 DoNotRetryIOException (org.apache.hadoop.hbase.DoNotRetryIOException)3 ReportRegionStateTransitionResponse (org.apache.hadoop.hbase.shaded.protobuf.generated.RegionServerStatusProtos.ReportRegionStateTransitionResponse)3 ServerName (org.apache.hadoop.hbase.ServerName)2 ServerNotRunningYetException (org.apache.hadoop.hbase.ipc.ServerNotRunningYetException)2 Test (org.junit.Test)2 ServiceException (com.google.protobuf.ServiceException)1 Configuration (org.apache.hadoop.conf.Configuration)1 CallQueueTooBigException (org.apache.hadoop.hbase.CallQueueTooBigException)1 HBaseConfiguration (org.apache.hadoop.hbase.HBaseConfiguration)1 HBaseIOException (org.apache.hadoop.hbase.HBaseIOException)1 HRegionInfo (org.apache.hadoop.hbase.HRegionInfo)1 HTableDescriptor (org.apache.hadoop.hbase.HTableDescriptor)1 SingleProcessHBaseCluster (org.apache.hadoop.hbase.SingleProcessHBaseCluster)1 TableName (org.apache.hadoop.hbase.TableName)1 RegionInfo (org.apache.hadoop.hbase.client.RegionInfo)1 ServiceException (org.apache.hadoop.hbase.shaded.com.google.protobuf.ServiceException)1 RegionInfo (org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.RegionInfo)1 RegionServerStatusService (org.apache.hadoop.hbase.shaded.protobuf.generated.RegionServerStatusProtos.RegionServerStatusService)1