Package org.apache.hadoop.hbase.client

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


    // disable table before modification
    admin.disableTable(tableName);

    User newOwner = User.createUserForTesting(conf, "new_owner", new String[] {});
    htd.setOwner(newOwner);
    admin.modifyTable(tableName, htd);
    perms = protocol.getUserPermissions(tableName);
    UserPermission newOwnerperm = new UserPermission(Bytes.toBytes(newOwner.getName()), tableName,
        null, Action.values());
    assertTrue("New owner should have all permissions on table",
      hasFoundUserPermission(newOwnerperm, perms));
View Full Code Here


      assertNotNull(status);
     
      HTableDescriptor htd = admin.getTableDescriptor(table.getBytes());
      htd.setValue("NOT_DEFAULT", "true");
      admin.disableTable(table);
      admin.modifyTable(table.getBytes(), htd);
      admin.enableTable(table);
      fs.delete(status.getPath(), true);
     
      // fix OrphanTable with cache
      htd = admin.getTableDescriptor(table.getBytes()); // warms up cached htd on master
View Full Code Here

    admin.disableTable(TEST_TABLE);
    assertTrue(admin.isTableDisabled(TEST_TABLE));

    // modify table
    htd.setMaxFileSize(512 * 1024 * 1024);
    admin.modifyTable(TEST_TABLE, htd);
    // preModifyTable can't bypass default action.
    assertTrue("Test table should have been modified",
      cp.wasModifyTableCalled());

    // add a column family
View Full Code Here

    assertTrue("Coprocessor should have been called on table disable",
      cp.wasDisableTableCalled());

    // modify table
    htd.setMaxFileSize(512 * 1024 * 1024);
    admin.modifyTable(TEST_TABLE, htd);
    assertTrue("Test table should have been modified",
        cp.wasModifyTableCalled());

    // add a column family
    admin.addColumn(TEST_TABLE, new HColumnDescriptor(TEST_FAMILY2));
View Full Code Here

      assertNotNull(status);

      HTableDescriptor htd = admin.getTableDescriptor(table.getBytes());
      htd.setValue("NOT_DEFAULT", "true");
      admin.disableTable(table);
      admin.modifyTable(table.getBytes(), htd);
      admin.enableTable(table);
      fs.delete(status.getPath(), true);

      // fix OrphanTable with cache
      htd = admin.getTableDescriptor(table.getBytes()); // warms up cached htd on master
View Full Code Here

    admin.disableTable(TEST_TABLE);
    assertTrue(admin.isTableDisabled(TEST_TABLE));

    // modify table
    htd.setMaxFileSize(512 * 1024 * 1024);
    admin.modifyTable(TEST_TABLE, htd);
    // preModifyTable can't bypass default action.
    assertTrue("Test table should have been modified",
      cp.wasModifyTableCalled());

    // add a column family
View Full Code Here

    assertTrue("Coprocessor should have been called on table disable",
      cp.wasDisableTableCalled());

    // modify table
    htd.setMaxFileSize(512 * 1024 * 1024);
    admin.modifyTable(TEST_TABLE, htd);
    assertTrue("Test table should have been modified",
        cp.wasModifyTableCalled());

    // add a column family
    admin.addColumn(TEST_TABLE, new HColumnDescriptor(TEST_FAMILY2));
View Full Code Here

    // disable table before modification
    admin.disableTable(tableName);

    User newOwner = User.createUserForTesting(conf, "new_owner", new String[] {});
    htd.setOwner(newOwner);
    admin.modifyTable(tableName, htd);
    perms = protocol.getUserPermissions(tableName);
    UserPermission newOwnerperm = new UserPermission(Bytes.toBytes(newOwner.getName()), tableName,
        null, Action.values());
    assertTrue("New owner should have all permissions on table",
      hasFoundUserPermission(newOwnerperm, perms));
View Full Code Here

                HTableDescriptor newDesc = new HTableDescriptor(oldDesc);
                newDesc.addFamily(new HColumnDescriptor(columnFamily));
                logger.info("table does not yet have expected column family, modifying descriptor to " + newDesc);
                HBaseAdmin hbaseAdmin = table.getHbase().admin();
                hbaseAdmin.disableTable(table.getName());
                hbaseAdmin.modifyTable(Bytes.toBytes(table.getName()), newDesc);
                hbaseAdmin.enableTable(table.getName());
            }
        } catch (IOException e) {
            logger.warning("problem adding column family: " + e);
        }
View Full Code Here

                HTableDescriptor newDesc = new HTableDescriptor(oldDesc);
                newDesc.addFamily(new HColumnDescriptor(COLUMN_FAMILY));
                logger.info("table does not yet have expected column family, modifying descriptor to " + newDesc);
                HBaseAdmin hbaseAdmin = table.getHbase().admin();
                hbaseAdmin.disableTable(table.getName());
                hbaseAdmin.modifyTable(Bytes.toBytes(table.getName()), newDesc);
                hbaseAdmin.enableTable(table.getName());
            }
        } catch (IOException e) {
            logger.warning("problem adding column family: " + e);
        }
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.