Package org.apache.hadoop.hbase.client

Examples of org.apache.hadoop.hbase.client.HBaseAdmin.deleteTable()


        admin.close();
        return;
      }
      admin.disableTable(tableName);
      try {
        admin.deleteTable(tableName);
      } finally {
        admin.close();
      }
    } catch (MasterNotRunningException e) {
      LOG.error("Failed to delete table.", e);
View Full Code Here


      HBaseAdmin admin = new HBaseAdmin(conf);
      String metaTable = conf.get(FConstants.METASTORE_TABLE,
          FConstants.DEFAULT_METASTORE_TABLE);
      if (admin.tableExists(metaTable)) {
        admin.disableTable(metaTable);
        admin.deleteTable(metaTable);
      }
      admin.close();
      return true;
    } catch (ZooKeeperConnectionException zce) {
      LOG.error("Could not connect to zookeeper ", zce);
View Full Code Here

      HBaseAdmin admin = new HBaseAdmin(WTU.getConfiguration());
      boolean isAva = admin.isTableAvailable(tTableName);
      Assert.assertTrue(isAva);
      redo.close();
      admin.disableTable(tTableName);
      admin.deleteTable(tTableName);
      admin.close();
    } catch (Exception e) {
      e.printStackTrace();
      Assert.assertTrue(false);
    }
View Full Code Here

        HBaseAdmin admin = new HBaseAdmin(WTU.getConfiguration());
        boolean isAva = admin.isTableAvailable(tTableName);
        Assert.assertTrue(isAva);
        redo.close();
        admin.disableTable(tTableName);
        admin.deleteTable(tTableName);
        admin.close();
      } catch (Exception e) {
        e.printStackTrace();
        Assert.assertTrue(false);
      }
View Full Code Here

        if (!admin.tableExists(tableName)) {
            admin.close();
            return;
        }
        admin.disableTable(tableName);
        admin.deleteTable(tableName);
        admin.close();
    }

    public byte[] b(String v) {
        return Bytes.toBytes(v);
View Full Code Here

  public void testCompactionOverride() throws Exception {
    byte[] compactTable = Bytes.toBytes("TestCompactionOverride");
    HBaseAdmin admin = util.getHBaseAdmin();
    if (admin.tableExists(compactTable)) {
      admin.disableTable(compactTable);
      admin.deleteTable(compactTable);
    }

    HTableDescriptor htd = new HTableDescriptor(TableName.valueOf(compactTable));
    htd.addFamily(new HColumnDescriptor(A));
    htd.addCoprocessor(EvenOnlyCompactor.class.getName());
View Full Code Here

    // create table
    HBaseAdmin admin = TEST_UTIL.getHBaseAdmin();
    if (admin.tableExists(tableName)) {
      admin.disableTable(tableName);
      admin.deleteTable(tableName);
    }
    HTableDescriptor htd = new HTableDescriptor(tableName);
    htd.addFamily(new HColumnDescriptor(family1));
    htd.addFamily(new HColumnDescriptor(family2));
    admin.createTable(htd);
View Full Code Here

    verifyDenied(gblUser, putActionAll, putAction1, putAction2);
    verifyDenied(gblUser, deleteActionAll, deleteAction1, deleteAction2);

    // delete table
    admin.disableTable(tableName);
    admin.deleteTable(tableName);
  }

  private boolean hasFoundUserPermission(UserPermission userPermission, List<UserPermission> perms) {
    return perms.contains(userPermission);
  }
View Full Code Here

    // create table
    HBaseAdmin admin = TEST_UTIL.getHBaseAdmin();
    if (admin.tableExists(tableName)) {
      admin.disableTable(tableName);
      admin.deleteTable(tableName);
    }
    HTableDescriptor htd = new HTableDescriptor(tableName);
    htd.addFamily(new HColumnDescriptor(family1));
    htd.addFamily(new HColumnDescriptor(family2));
    admin.createTable(htd);
View Full Code Here

    verifyDenied(user, putQualifierAction);
    verifyDenied(user, deleteQualifierAction);

    // delete table
    admin.disableTable(tableName);
    admin.deleteTable(tableName);
  }

  @Test
  public void testPermissionList() throws Exception {
    final TableName tableName =
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.