Package org.apache.hadoop.hbase.client

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


    assertFalse(MetaTableAccessor.tableExists(hConnection, name));
    UTIL.createTable(name, HConstants.CATALOG_FAMILY);
    assertTrue(MetaTableAccessor.tableExists(hConnection, name));
    Admin admin = UTIL.getHBaseAdmin();
    admin.disableTable(name);
    admin.deleteTable(name);
    assertFalse(MetaTableAccessor.tableExists(hConnection, name));
    assertTrue(MetaTableAccessor.tableExists(hConnection,
      TableName.META_TABLE_NAME));
  }
View Full Code Here


    admin.disableTable(TABLE_NAME);
    try {
      // Verify the column descriptor
      verifyHColumnDescriptor(1, TABLE_NAME, FAMILY);
    } finally {
      admin.deleteTable(TABLE_NAME);
    }
  }

  @Test
  public void testCreateTableWithDefaultFromConf() throws Exception {
View Full Code Here

    admin.disableTable(TABLE_NAME);
    try {
      // Verify the column descriptor
      verifyHColumnDescriptor(3, TABLE_NAME, FAMILY);
    } finally {
      admin.deleteTable(TABLE_NAME);
    }
  }

  @Test
  public void testCreateTableWithSetVersion() throws Exception {
View Full Code Here

    try {
      // Verify the column descriptor
      verifyHColumnDescriptor(5, TABLE_NAME, FAMILY);

    } finally {
      admin.deleteTable(TABLE_NAME);
    }
  }

  private void verifyHColumnDescriptor(int expected, final TableName tableName,
      final byte[]... families) throws IOException {
View Full Code Here

        cp.wasCloneSnapshotCalled());
      assertFalse("Coprocessor restore should not have been called on snapshot clone",
        cp.wasRestoreSnapshotCalled());
      admin.disableTable(TEST_CLONE);
      assertTrue(admin.isTableDisabled(TEST_TABLE));
      admin.deleteTable(TEST_CLONE);

      // Test restore operation
      cp.resetStates();
      admin.restoreSnapshot(TEST_SNAPSHOT);
      assertTrue("Coprocessor should have been called on snapshot restore",
View Full Code Here

      admin.deleteSnapshot(TEST_SNAPSHOT);
      assertTrue("Coprocessor should have been called on snapshot delete",
        cp.wasDeleteSnapshotCalled());
    } finally {
      admin.deleteTable(TEST_TABLE);
    }
  }

  @Test
  public void testNamespaceOperations() throws Exception {
View Full Code Here

    Admin admin = util.getHBaseAdmin();
    if (admin.tableExists(tableName)) {
      if (admin.isTableEnabled(tableName)) {
        admin.disableTable(tableName);
      }
      admin.deleteTable(tableName);
    }
    util.createTable(tableName, new byte[][] {dummy, test});
  }

  /**
 
View Full Code Here

    admin.truncateTable(TEST_TABLE, false);

    // delete table
    admin.disableTable(TEST_TABLE);
    assertTrue(admin.isTableDisabled(TEST_TABLE));
    admin.deleteTable(TEST_TABLE);
    assertFalse("Test table should have been deleted",
        admin.tableExists(TEST_TABLE));
    // preDeleteTable can't bypass default action.
    assertTrue("Coprocessor should have been called on table delete",
        cp.wasDeleteTableCalled());
View Full Code Here

    // delete table
    assertFalse("No table deleted yet", cp.wasDeleteTableCalled());
    assertFalse("Delete table handler should not be called.",
        cp.wasDeleteTableHandlerCalled());
    admin.deleteTable(TEST_TABLE);
    assertFalse("Test table should have been deleted",
        admin.tableExists(TEST_TABLE));
    assertTrue("Coprocessor should have been called on table delete",
        cp.wasDeleteTableCalled());
    assertTrue("Delete table handler should be called.",
View Full Code Here

      public Object run() throws Exception {
        HConnection unmanagedConnection = HConnectionManager.createConnection(TEST_UTIL.getConfiguration());
        Admin admin = unmanagedConnection.getAdmin();
        try {
          admin.disableTable(TEST_TABLE.getTableName());
          admin.deleteTable(TEST_TABLE.getTableName());
        } finally {
          admin.close();
          unmanagedConnection.close();
        }
        return null;
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.