Package org.apache.hadoop.hbase.client

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


    // delete column
    assertFalse("No column family deleted yet", cp.wasDeleteColumnCalled());
    assertFalse("Delete table column handler should not be called.",
        cp.wasDeleteColumnHandlerCalled());
    admin.deleteColumn(TEST_TABLE, TEST_FAMILY2);
    HTableDescriptor tableDesc = admin.getTableDescriptor(TEST_TABLE);
    assertNull("'"+Bytes.toString(TEST_FAMILY2)+"' should have been removed",
        tableDesc.getFamily(TEST_FAMILY2));
    assertTrue("Coprocessor should have been called on column delete",
        cp.wasDeleteColumnCalled());
View Full Code Here


      admin.addColumn(LABELS_TABLE_NAME, hcd);
      fail("Lables table should not get altered by user.");
    } catch (Exception e) {
    }
    try {
      admin.deleteColumn(LABELS_TABLE_NAME, VisibilityConstants.LABELS_TABLE_FAMILY);
      fail("Lables table should not get altered by user.");
    } catch (Exception e) {
    }
    try {
      HColumnDescriptor hcd = new HColumnDescriptor(VisibilityConstants.LABELS_TABLE_FAMILY);
View Full Code Here

    try {
      // Verify the table descriptor
      verifyTableDescriptor(TABLE_NAME, FAMILY_0, FAMILY_1);

      // Modify the table removing one family and verify the descriptor
      admin.deleteColumn(TABLE_NAME, FAMILY_1);
      verifyTableDescriptor(TABLE_NAME, FAMILY_0);
    } finally {
      admin.deleteTable(TABLE_NAME);
    }
  }
View Full Code Here

    ExecutorService executor = Executors.newSingleThreadExecutor();
    Future<Object> shouldFinish = executor.submit(new Callable<Object>() {
      @Override
      public Object call() throws Exception {
        Admin admin = TEST_UTIL.getHBaseAdmin();
        admin.deleteColumn(TABLE_NAME, FAMILY);
        return null;
      }
    });

    deleteColumn.await();
View Full Code Here

      }
    }

    // TEST - Disable and delete the column family
    admin.disableTable(TABLENAME);
    admin.deleteColumn(TABLENAME, Bytes.toBytes("cf2"));

    // 5 - Check if only 2 column families exist in the descriptor
    HTableDescriptor afterhtd = admin.getTableDescriptor(TABLENAME);
    assertEquals(2, afterhtd.getColumnFamilies().length);
    HColumnDescriptor[] newFamilies = afterhtd.getColumnFamilies();
View Full Code Here

    // delete column
    assertFalse("No column family deleted yet", cp.wasDeleteColumnCalled());
    assertFalse("Delete table column handler should not be called.",
        cp.wasDeleteColumnHandlerCalled());
    admin.deleteColumn(TEST_TABLE, TEST_FAMILY2);
    HTableDescriptor tableDesc = admin.getTableDescriptor(TEST_TABLE);
    assertNull("'"+Bytes.toString(TEST_FAMILY2)+"' should have been removed",
        tableDesc.getFamily(TEST_FAMILY2));
    assertTrue("Coprocessor should have been called on column delete",
        cp.wasDeleteColumnCalled());
View Full Code Here

    try {
      // Verify the table descriptor
      verifyTableDescriptor(TABLE_NAME, FAMILY_0, FAMILY_1);

      // Modify the table removing one family and verify the descriptor
      admin.deleteColumn(TABLE_NAME, FAMILY_1);
      verifyTableDescriptor(TABLE_NAME, FAMILY_0);
    } finally {
      admin.deleteTable(TABLE_NAME);
    }
  }
View Full Code Here

      }
    }

    // TEST - Disable and delete the column family
    admin.disableTable(TABLENAME);
    admin.deleteColumn(TABLENAME, Bytes.toBytes("cf2"));

    // 5 - Check if only 2 column families exist in the descriptor
    HTableDescriptor afterhtd = admin.getTableDescriptor(TABLENAME);
    assertEquals(2, afterhtd.getColumnFamilies().length);
    HColumnDescriptor[] newFamilies = afterhtd.getColumnFamilies();
View Full Code Here

    ExecutorService executor = Executors.newSingleThreadExecutor();
    Future<Object> shouldFinish = executor.submit(new Callable<Object>() {
      @Override
      public Object call() throws Exception {
        Admin admin = TEST_UTIL.getHBaseAdmin();
        admin.deleteColumn(TABLE_NAME, FAMILY);
        return null;
      }
    });

    deleteColumn.await();
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.