Examples of modifyTable()


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

      public Object run() throws Exception {
        HBaseAdmin admin = new HBaseAdmin(conf);
        HTableDescriptor htd = new HTableDescriptor("testModifyTable_idx");
        htd.addFamily(new HColumnDescriptor("d"));
        htd.addFamily(new HColumnDescriptor("d1"));
        admin.modifyTable(Bytes.toBytes("testModifyTable_idx"), htd);
        return null;
      }
    };

    PrivilegedExceptionAction modifyMainTable = new PrivilegedExceptionAction() {
View Full Code Here

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

        IndexSpecification iSpec1 = new IndexSpecification("spec1");
        iSpec.addIndexColumn(hcd, "q", ValueType.String, 10);
        iSpec1.addIndexColumn(hcd1, "q", ValueType.String, 10);
        ihtd.addIndex(iSpec);
        ihtd.addIndex(iSpec1);
        admin.modifyTable(Bytes.toBytes("testModifyTable"), ihtd);
        return null;
      }
    };

    try {
View Full Code Here

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

    admin.createTable(htd);

    admin.disableTable(tableName);
    IndexedHTableDescriptor ihtd =
        createIndexedHTableDescriptor(tableName, "f1", "idx1", "f1", "q1");
    admin.modifyTable(Bytes.toBytes(tableName), ihtd);
    List<HRegionInfo> regionsOfTable =
        UTIL.getHBaseCluster().getMaster().getAssignmentManager()
            .getRegionsOfTable(Bytes.toBytes(tableName + "_idx"));
    while (regionsOfTable.size() != 1) {
      regionsOfTable =
View Full Code Here

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

      // disable the table
      hbaseAdmin.disableTable(userTable);

      // This will create the index table. Also modifies the existing table htable descriptor.
      hbaseAdmin.modifyTable(Bytes.toBytes(userTable), ihtd);
      boolean found = false;
      while (!found) {
        try {
          hbaseAdmin.getTableDescriptor(Bytes.toBytes(IndexUtils.getIndexTableName(userTable)));
        } catch (TableNotFoundException tnfe) {
View Full Code Here

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

                     * 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 true;
            } else {
                if (existingDesc.equals(newDesc)) {
View Full Code Here

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

               
                // Update metadata of table
                // TODO: Take advantage of online schema change ability by setting "hbase.online.schema.update.enable" to true
                admin.disableTable(tableName);
                // TODO: What if not all existing column families are present?
                admin.modifyTable(tableName, newDesc);
                admin.enableTable(tableName);
               
                if (updateTo2_2) {
                    checkClientServerCompatibility();
                    upgradeTo2_2(admin);
View Full Code Here

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

Examples of org.apache.hadoop.hbase.master.HMaster.modifyTable()

  if (action.equals("split")) {
    if (key != null && key.length() > 0) {
      Writable[] arr = new Writable[1];
      arr[0] = new ImmutableBytesWritable(Bytes.toBytes(key));
      master.modifyTable(Bytes.toBytes(tableName), HConstants.Modify.TABLE_SPLIT, arr);
    } else {
      master.modifyTable(Bytes.toBytes(tableName), HConstants.Modify.TABLE_SPLIT, null);
    }
   
      out.write(" Split request accepted. ");
View Full Code Here

Examples of org.apache.hadoop.hbase.master.HMaster.modifyTable()

    if (key != null && key.length() > 0) {
      Writable[] arr = new Writable[1];
      arr[0] = new ImmutableBytesWritable(Bytes.toBytes(key));
      master.modifyTable(Bytes.toBytes(tableName), HConstants.Modify.TABLE_SPLIT, arr);
    } else {
      master.modifyTable(Bytes.toBytes(tableName), HConstants.Modify.TABLE_SPLIT, null);
    }
   
      out.write(" Split request accepted. ");

  } else if (action.equals("compact")) {
View Full Code Here

Examples of org.apache.hadoop.hbase.master.HMaster.modifyTable()

  } else if (action.equals("compact")) {
    if (key != null && key.length() > 0) {
      Writable[] arr = new Writable[1];
      arr[0] = new ImmutableBytesWritable(Bytes.toBytes(key));
      master.modifyTable(Bytes.toBytes(tableName), HConstants.Modify.TABLE_COMPACT, arr);
    } else {
      master.modifyTable(Bytes.toBytes(tableName), HConstants.Modify.TABLE_COMPACT, null);
    }
   
      out.write(" Compact request accepted. ");
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.