Package org.apache.hadoop.hbase.client

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


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


    admin = new HBaseAdmin(conf);
    htd = admin.getTableDescriptor(TABLE_BYTES);
    hcd = htd.getFamily(CF_BYTES);
    hcd.setDataBlockEncoding(DataBlockEncoding.PREFIX);
    admin.disableTable(TABLE);
    admin.modifyColumn(TABLE, hcd);
    admin.enableTable(TABLE);
    admin.close();
    for (int i = 0; i < NUM_HFILE_V2_BATCHES; ++i) {
      TestChangingEncoding.writeTestDataBatch(conf, TABLE, numBatches++);
    }
View Full Code Here

    HColumnDescriptor hcd = getColumnDesc(admin);
    System.err.println("\nDisabling encode-on-disk. Old column descriptor: " +
        hcd + "\n");
    admin.disableTable(TABLE);
    hcd.setEncodeOnDisk(false);
    admin.modifyColumn(TABLE, hcd);

    System.err.println("\nRe-enabling table\n");
    admin.enableTable(TABLE);

    System.err.println("\nNew column descriptor: " +
View Full Code Here

      }
      if (dataBlockEncodingAlgo != null) {
        columnDesc.setDataBlockEncoding(dataBlockEncodingAlgo);
        columnDesc.setEncodeOnDisk(!encodeInCacheOnly);
      }
      admin.modifyColumn(tableName, columnDesc);
    }
    LOG.info("Enabling table " + Bytes.toString(tableName));
    admin.enableTable(tableName);
  }
View Full Code Here

      cp.preAddColumnCalledOnly());

    // modify a column family
    HColumnDescriptor hcd1 = new HColumnDescriptor(TEST_FAMILY2);
    hcd1.setMaxVersions(25);
    admin.modifyColumn(TEST_TABLE, hcd1);
    assertTrue("Second column family should be modified",
      cp.preModifyColumnCalledOnly());

    // delete table
    admin.deleteTable(TEST_TABLE);
View Full Code Here

        cp.wasAddColumnCalled());

    // modify a column family
    HColumnDescriptor hcd = new HColumnDescriptor(TEST_FAMILY2);
    hcd.setMaxVersions(25);
    admin.modifyColumn(TEST_TABLE, hcd);
    assertTrue("Second column family should be modified",
        cp.wasModifyColumnCalled());

    // enable
    assertFalse(cp.wasEnableTableCalled());
View Full Code Here

        columnDesc.setBloomFilterType(bloomType);
      }
      if (compressAlgo != null) {
        columnDesc.setCompressionType(compressAlgo);
      }
      admin.modifyColumn(tableName, columnDesc);
    }
    LOG.info("Enabling table " + Bytes.toString(tableName));
    admin.enableTable(tableName);
  }
View Full Code Here

      cp.preAddColumnCalledOnly());

    // modify a column family
    HColumnDescriptor hcd1 = new HColumnDescriptor(TEST_FAMILY2);
    hcd1.setMaxVersions(25);
    admin.modifyColumn(TEST_TABLE, hcd1);
    assertTrue("Second column family should be modified",
      cp.preModifyColumnCalledOnly());

    // delete table
    admin.deleteTable(TEST_TABLE);
View Full Code Here

        cp.wasAddColumnCalled());

    // modify a column family
    HColumnDescriptor hcd = new HColumnDescriptor(TEST_FAMILY2);
    hcd.setMaxVersions(25);
    admin.modifyColumn(TEST_TABLE, hcd);
    assertTrue("Second column family should be modified",
        cp.wasModifyColumnCalled());

    // enable
    assertFalse(cp.wasEnableTableCalled());
View Full Code Here

                }
                admin.disableTable(tableName);
                if (oldDescriptor == null) {
                    admin.addColumn(tableName, columnDescriptor);
                } else {
                    admin.modifyColumn(tableName, columnDescriptor);
                }
                admin.enableTable(tableName);
            } catch (org.apache.hadoop.hbase.TableNotFoundException e) {
                sqlE = new SQLExceptionInfo.Builder(SQLExceptionCode.TABLE_UNDEFINED).setRootCause(e).build().buildException();
            }
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.