Package org.apache.hadoop.hbase.client

Examples of org.apache.hadoop.hbase.client.Admin.truncateTable()


    admin.modifyColumn(TEST_TABLE, hcd1);
    assertTrue("Second column family should be modified",
      cp.preModifyColumnCalledOnly());

    // truncate table
    admin.truncateTable(TEST_TABLE, false);

    // delete table
    admin.disableTable(TEST_TABLE);
    assertTrue(admin.isTableDisabled(TEST_TABLE));
    admin.deleteTable(TEST_TABLE);
View Full Code Here


    Admin admin = util.getHBaseAdmin();

    boolean preserveSplits = random.nextBoolean();
    LOG.info("Performing action: Truncate table " + tableName.getNameAsString() +
             "preserve splits " + preserveSplits);
    admin.truncateTable(tableName, preserveSplits);
  }
}
View Full Code Here

    admin.modifyColumn(TEST_TABLE, hcd1);
    assertTrue("Second column family should be modified",
      cp.preModifyColumnCalledOnly());

    // truncate table
    admin.truncateTable(TEST_TABLE, false);

    // delete table
    admin.disableTable(TEST_TABLE);
    assertTrue(admin.isTableDisabled(TEST_TABLE));
    admin.deleteTable(TEST_TABLE);
View Full Code Here

   * @param preserveRegions keep the existing split points
   * @return HTable for the new table
   */
  public HTable truncateTable(final TableName tableName, final boolean preserveRegions) throws IOException {
    Admin admin = getHBaseAdmin();
    admin.truncateTable(tableName, preserveRegions);
    return new HTable(getConfiguration(), tableName);
  }

  /**
   * Truncate a table using the admin command.
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.