Package org.apache.hadoop.hbase.client

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


        try {
            htable = connServices.getTable(PhoenixDatabaseMetaData.TYPE_TABLE_NAME_BYTES);
            HTableDescriptor htd = new HTableDescriptor(htable.getTableDescriptor());
            htd.setValue(SchemaUtil.UPGRADE_TO_2_0, Boolean.TRUE.toString());
            admin.disableTable(PhoenixDatabaseMetaData.TYPE_TABLE_NAME_BYTES);
            admin.modifyTable(PhoenixDatabaseMetaData.TYPE_TABLE_NAME_BYTES, htd);
            admin.enableTable(PhoenixDatabaseMetaData.TYPE_TABLE_NAME_BYTES);
        } catch (IOException e) {
            throw new SQLException(e);
        } finally {
            try {
View Full Code Here


                     * policy class cannot be found on the server, the HBase table is left in a horrible
                     * "ghost" state where it can't be used and can't be deleted without bouncing the master.
                     */
                    newDesc.setValue(HTableDescriptor.SPLIT_POLICY, MetaDataSplitPolicy.class.getName());
                    admin.disableTable(tableName);
                    admin.modifyTable(tableName, newDesc);
                    admin.enableTable(tableName);

                    upgradeWhiteList = upgradeCoprocessorsTo3_0(admin, false);
                }
                return null;
View Full Code Here

                    }
                }
                        
                // TODO: Take advantage of online schema change ability by setting "hbase.online.schema.update.enable" to true
                admin.disableTable(tableName);
                admin.modifyTable(tableName, newDesc);
                admin.enableTable(tableName);
               
                return newDesc;
            }
View Full Code Here

    // ensure we only have one snapshot
    SnapshotTestingUtils.assertOneSnapshotThatMatches(admin, snapshotNameBytes, TABLE_NAME);

    // enable compactions now
    admin.modifyTable(TABLE_NAME, htd);

    // renable the table so we can compact the regions
    admin.enableTable(TABLE_NAME);

    // compact the files so we get some archived files for the table we just snapshotted
View Full Code Here

      assertNotNull(status);

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

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

    }
    try {
      HTableDescriptor htd = new HTableDescriptor(LABELS_TABLE_NAME);
      htd.addFamily(new HColumnDescriptor("f1"));
      htd.addFamily(new HColumnDescriptor("f2"));
      admin.modifyTable(LABELS_TABLE_NAME, htd);
      fail("Lables table should not get altered by user.");
    } catch (Exception e) {
    }
  }
View Full Code Here

            tableDescr.setValue(Bytes.toBytes("LILY_INDEX"), json);

            System.out.println("Disabling index table " + tableNameString);
            admin.disableTable(tableName);
            System.out.println("Storing index meta on index table " + tableNameString);
            admin.modifyTable(tableName, tableDescr);
            System.out.println("Enabling index table " + tableNameString);
            admin.enableTable(tableName);
            System.out.println("--");
        }
View Full Code Here

            recordTableDescriptor.removeFamily(Bytes.toBytes("rowlog"));
            HColumnDescriptor dataFamily = recordTableDescriptor.getFamily(LilyHBaseSchema.TypeCf.DATA.bytes);
            dataFamily.setScope(1);
            recordTableDescriptor.setValue(LilyHBaseSchema.TABLE_TYPE_PROPERTY, LilyHBaseSchema.TABLE_TYPE_RECORD);
            recordTableDescriptor.setValue("lilyOwningRepository", "default");
            admin.modifyTable(LilyHBaseSchema.Table.RECORD.bytes, recordTableDescriptor);
            admin.enableTable(LilyHBaseSchema.Table.RECORD.bytes);

            // Get rid of the rowlog tables
            if (admin.tableExists(Bytes.toBytes("rowlog-mq"))) {
                admin.disableTable(Bytes.toBytes("rowlog-mq"));
View Full Code Here

                     * policy class cannot be found on the server, the HBase table is left in a horrible
                     * "ghost" state where it can't be used and can't be deleted without bouncing the master.
                     */
                    newDesc.setValue(HTableDescriptor.SPLIT_POLICY, MetaDataSplitPolicy.class.getName());
                    admin.disableTable(tableName);
                    admin.modifyTable(tableName, newDesc);
                    admin.enableTable(tableName);
                }
                return null;
            } else {
                if (!modifyExistingMetaData || existingDesc.equals(newDesc)) {
View Full Code Here

                    checkClientServerCompatibility();
                }
                        
                // TODO: Take advantage of online schema change ability by setting "hbase.online.schema.update.enable" to true
                admin.disableTable(tableName);
                admin.modifyTable(tableName, newDesc);
                admin.enableTable(tableName);
               
                return newDesc;
            }
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.