Search in sources :

Example 36 with HBaseIOException

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

the class TestAccessController method testTruncatePerms.

@Test
public void testTruncatePerms() throws Exception {
    try {
        List<UserPermission> existingPerms = AccessControlClient.getUserPermissions(systemUserConnection, TEST_TABLE.getNameAsString());
        assertTrue(existingPerms != null);
        assertTrue(existingPerms.size() > 1);
        TEST_UTIL.getAdmin().disableTable(TEST_TABLE);
        TEST_UTIL.truncateTable(TEST_TABLE);
        TEST_UTIL.waitTableAvailable(TEST_TABLE);
        List<UserPermission> perms = AccessControlClient.getUserPermissions(systemUserConnection, TEST_TABLE.getNameAsString());
        assertTrue(perms != null);
        assertEquals(existingPerms.size(), perms.size());
    } catch (Throwable e) {
        throw new HBaseIOException(e);
    }
}
Also used : HBaseIOException(org.apache.hadoop.hbase.HBaseIOException) Test(org.junit.Test)

Aggregations

HBaseIOException (org.apache.hadoop.hbase.HBaseIOException)36 IOException (java.io.IOException)19 ServerName (org.apache.hadoop.hbase.ServerName)17 ArrayList (java.util.ArrayList)13 RegionInfo (org.apache.hadoop.hbase.client.RegionInfo)13 List (java.util.List)8 HashMap (java.util.HashMap)7 InterruptedIOException (java.io.InterruptedIOException)5 Map (java.util.Map)5 DoNotRetryIOException (org.apache.hadoop.hbase.DoNotRetryIOException)5 HRegionInfo (org.apache.hadoop.hbase.HRegionInfo)5 Test (org.junit.Test)5 TreeMap (java.util.TreeMap)4 Configuration (org.apache.hadoop.conf.Configuration)4 NonNull (edu.umd.cs.findbugs.annotations.NonNull)3 ExecutionException (java.util.concurrent.ExecutionException)3 RegionLocations (org.apache.hadoop.hbase.RegionLocations)3 TableName (org.apache.hadoop.hbase.TableName)3 FavoredNodeAssignmentHelper (org.apache.hadoop.hbase.favored.FavoredNodeAssignmentHelper)3 RSGroupAdminEndpoint (org.apache.hadoop.hbase.rsgroup.RSGroupAdminEndpoint)3