Package org.apache.hadoop.hbase.client

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


      }
      assertTrue(st.rollback(regionServer, regionServer));
      assertTrue(ZKUtil.checkExists(regionServer.getZooKeeper(), node) == -1);
    }
    if (admin.isTableAvailable(tableName) && admin.isTableEnabled(tableName)) {
      admin.disableTable(tableName);
      admin.deleteTable(tableName);
    }
  }
 
  @Test
View Full Code Here


      }
      assertFalse("region is still in transition",
          am.getRegionsInTransition().containsKey(region.getRegionInfo().getEncodedName()));
    }
    if (admin.isTableAvailable(tableName) && admin.isTableEnabled(tableName)) {
      admin.disableTable(tableName);
      admin.deleteTable(tableName);
      admin.close();
    }
  }
 
View Full Code Here

      // Check if current version do have specified column family
      if (!tableDesc.hasFamily(familyBytes)) {
        if (options.getCreateHBaseTable()) {
          // Create the column family.
          LOG.info("Creating missing column family " + familyName);
          admin.disableTable(tableName);
          admin.addColumn(tableName, colDesc);
          admin.enableTable(tableName);
        } else {
          LOG.warn("Could not find column family " + familyName + " in table "
            + tableName);
View Full Code Here

    }

    public synchronized static void dropTableIfExists(byte[] tableName) throws IOException {
        HBaseAdmin admin = HBaseUtils.getHBaseAdmin();
        if (admin.tableExists(tableName)) {
            admin.disableTable(tableName);
            admin.deleteTable(tableName);
        }
    }
}
View Full Code Here

      if (!admin.tableExists(tableName)) {
        LOG.warn(tableName + " have been already deleted.");
        admin.close();
        return;
      }
      admin.disableTable(tableName);
      try {
        admin.deleteTable(tableName);
      } finally {
        admin.close();
      }
View Full Code Here

    try {
      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) {
View Full Code Here

    try {
      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

      try {
        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(conf);
        if (!admin.tableExists(tableName)) {
            admin.close();
            return;
        }
        admin.disableTable(tableName);
        admin.deleteTable(tableName);
        admin.close();
    }

    public byte[] b(String v) {
View Full Code Here

  public void testMinimumServerCount() throws Exception {
    HBaseAdmin admin = new HBaseAdmin(conf);

    // create and disable table
    admin.createTable(createTableDescriptor(TABLE_NAME));
    admin.disableTable(TABLE_NAME);
    assertFalse(admin.isTableEnabled(TABLE_NAME));

    // reach in and set minimum server count
    cluster.hbaseCluster.getMaster().getServerManager()
      .setMinimumServerCount(2);
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.