Package org.apache.hadoop.hbase.index

Examples of org.apache.hadoop.hbase.index.IndexedHTableDescriptor


      InterruptedException {
    HBaseAdmin admin = UTIL.getHBaseAdmin();
    ZooKeeperWatcher zkw = HBaseTestingUtility.getZooKeeperWatcher(UTIL);
    Configuration conf = UTIL.getConfiguration();
    String userTableName = "testMultipleIndicesOnUniqueColumns";
    IndexedHTableDescriptor ihtd = new IndexedHTableDescriptor(userTableName);
    HColumnDescriptor hcd = new HColumnDescriptor("col");
    IndexSpecification iSpec1 = new IndexSpecification("Index1");
    IndexSpecification iSpec2 = new IndexSpecification("Index2");
    iSpec1.addIndexColumn(hcd, "ql1", ValueType.String, 10);
    iSpec2.addIndexColumn(hcd, "ql2", ValueType.String, 10);
    ihtd.addFamily(hcd);
    ihtd.addIndex(iSpec1);
    ihtd.addIndex(iSpec2);
    admin.createTable(ihtd);
    ZKAssign.blockUntilNoRIT(zkw);

    HTable table = new HTable(conf, userTableName);
    Put p = new Put("row1".getBytes());
View Full Code Here


  public void testIndexOnMultipleCols() throws IOException, KeeperException, InterruptedException {
    HBaseAdmin admin = UTIL.getHBaseAdmin();
    ZooKeeperWatcher zkw = HBaseTestingUtility.getZooKeeperWatcher(UTIL);
    Configuration conf = UTIL.getConfiguration();
    String userTableName = "testSingleIndexOnMultipleCols";
    IndexedHTableDescriptor ihtd = new IndexedHTableDescriptor(userTableName);

    // Creating and adding the column families
    HColumnDescriptor hcd1 = new HColumnDescriptor("col1");
    HColumnDescriptor hcd2 = new HColumnDescriptor("col2");
    HColumnDescriptor hcd3 = new HColumnDescriptor("col3");
    ihtd.addFamily(hcd1);
    ihtd.addFamily(hcd2);
    ihtd.addFamily(hcd3);

    // Create and add indices
    IndexSpecification iSpec1 = new IndexSpecification("Index1");
    IndexSpecification iSpec2 = new IndexSpecification("Index2");
    iSpec1.addIndexColumn(hcd1, "ql1", ValueType.String, 10);
    iSpec2.addIndexColumn(hcd2, "ql1", ValueType.String, 10);
    iSpec2.addIndexColumn(hcd3, "ql1", ValueType.String, 10);
    ihtd.addIndex(iSpec1);
    ihtd.addIndex(iSpec2);
    admin.createTable(ihtd);
    ZKAssign.blockUntilNoRIT(zkw);

    HTable table = new HTable(conf, userTableName);
    Put p = new Put("row1".getBytes());
View Full Code Here

  public void testPutsWithPadding() throws IOException, KeeperException, InterruptedException {
    HBaseAdmin admin = UTIL.getHBaseAdmin();
    ZooKeeperWatcher zkw = HBaseTestingUtility.getZooKeeperWatcher(UTIL);
    Configuration conf = UTIL.getConfiguration();
    String userTableName = "testPutsWithPadding";
    IndexedHTableDescriptor ihtd = new IndexedHTableDescriptor(userTableName);

    // Creating and adding the column families
    HColumnDescriptor hcd2 = new HColumnDescriptor("col2");
    HColumnDescriptor hcd3 = new HColumnDescriptor("col3");
    HColumnDescriptor hcd4 = new HColumnDescriptor("col4");

    ihtd.addFamily(hcd2);
    ihtd.addFamily(hcd3);
    ihtd.addFamily(hcd4);

    // Create and add indices
    IndexSpecification iSpec2 = new IndexSpecification("Index2");
    iSpec2.addIndexColumn(hcd2, "ql1", ValueType.String, 10);
    iSpec2.addIndexColumn(hcd3, "ql1", ValueType.String, 10);
    iSpec2.addIndexColumn(hcd4, "ql1", ValueType.String, 10);
    ihtd.addIndex(iSpec2);
    admin.createTable(ihtd);
    ZKAssign.blockUntilNoRIT(zkw);

    HTable table = new HTable(conf, userTableName);
    Put p = new Put("row1".getBytes());
View Full Code Here

  public void testBulkPut() throws IOException, KeeperException, InterruptedException {
    HBaseAdmin admin = UTIL.getHBaseAdmin();
    ZooKeeperWatcher zkw = HBaseTestingUtility.getZooKeeperWatcher(UTIL);
    Configuration conf = UTIL.getConfiguration();
    String userTableName = "testBulkPut";
    IndexedHTableDescriptor ihtd = new IndexedHTableDescriptor(userTableName);

    // Creating and adding the column families
    HColumnDescriptor hcd1 = new HColumnDescriptor("col1");
    HColumnDescriptor hcd2 = new HColumnDescriptor("col2");
    HColumnDescriptor hcd3 = new HColumnDescriptor("col3");
    ihtd.addFamily(hcd1);
    ihtd.addFamily(hcd2);
    ihtd.addFamily(hcd3);

    // Create and add indices
    IndexSpecification iSpec1 = new IndexSpecification("Index1");
    IndexSpecification iSpec2 = new IndexSpecification("Index2");
    iSpec1.addIndexColumn(hcd1, "ql1", ValueType.String, 10);
    iSpec2.addIndexColumn(hcd3, "ql1", ValueType.String, 10);
    ihtd.addIndex(iSpec1);
    ihtd.addIndex(iSpec2);
    admin.createTable(ihtd);
    ZKAssign.blockUntilNoRIT(zkw);

    Thread[] t = new Thread[10];
    for (int i = 0; i < 10; i++) {
View Full Code Here

      InterruptedException {
    HBaseAdmin admin = UTIL.getHBaseAdmin();
    ZooKeeperWatcher zkw = HBaseTestingUtility.getZooKeeperWatcher(UTIL);
    final Configuration conf = UTIL.getConfiguration();
    final String userTableName = "TestBulkPutWithRepeatedRows";
    IndexedHTableDescriptor ihtd = new IndexedHTableDescriptor(userTableName);

    // Creating and adding the column families
    HColumnDescriptor hcd1 = new HColumnDescriptor("col1");

    ihtd.addFamily(hcd1);

    // Create and add indices
    IndexSpecification iSpec1 = new IndexSpecification("Index1");

    iSpec1.addIndexColumn(hcd1, "ql1", ValueType.String, 10);

    ihtd.addIndex(iSpec1);

    admin.createTable(ihtd);
    ZKAssign.blockUntilNoRIT(zkw);

    new Thread() {
View Full Code Here

    Configuration conf = UTIL.getConfiguration();
    conf.setBoolean("hbase.use.secondary.index", true);
    conf.setInt("hbase.regionserver.lease.period", 90000000);
    ZooKeeperWatcher zkw = HBaseTestingUtility.getZooKeeperWatcher(UTIL);
    String userTableName = "testIndexRegionSplit";
    IndexedHTableDescriptor ihtd = new IndexedHTableDescriptor(userTableName);
    HColumnDescriptor hcd = new HColumnDescriptor("col");
    IndexSpecification iSpec = new IndexSpecification("ScanIndexf");
    iSpec.addIndexColumn(new HColumnDescriptor("col"), "ql", ValueType.String, 10);
    ihtd.addFamily(hcd);
    ihtd.addIndex(iSpec);
    admin.createTable(ihtd);
    ZKAssign.blockUntilNoRIT(zkw);
    HTable table = new HTable(conf, userTableName);
    // test put with the indexed column
    for (int i = 0; i < 10; i++) {
View Full Code Here

    Configuration conf = UTIL.getConfiguration();
    conf.setBoolean("hbase.use.secondary.index", true);
    conf.setInt("hbase.regionserver.lease.period", 90000000);
    ZooKeeperWatcher zkw = HBaseTestingUtility.getZooKeeperWatcher(UTIL);
    String userTableName = "testIndexRegionSplit1";
    IndexedHTableDescriptor ihtd = new IndexedHTableDescriptor(userTableName);
    HColumnDescriptor hcd = new HColumnDescriptor("col");
    HColumnDescriptor hcd2 = new HColumnDescriptor("col2");
    IndexSpecification iSpec = new IndexSpecification("ScanIndexf");
    iSpec.addIndexColumn(hcd, "ql", ValueType.String, 10);
    ihtd.addFamily(hcd);
    ihtd.addFamily(hcd2);
    ihtd.addIndex(iSpec);
    admin.createTable(ihtd);
    ZKAssign.blockUntilNoRIT(zkw);
    HTable table = new HTable(conf, userTableName);
    // test put with the indexed column
    for (int i = 0; i < 10; i++) {
View Full Code Here

    Configuration conf = UTIL.getConfiguration();
    conf.setInt("hbase.regionserver.lease.period", 900000000);
    conf.setBoolean("hbase.use.secondary.index", true);
    ZooKeeperWatcher zkw = HBaseTestingUtility.getZooKeeperWatcher(UTIL);
    String userTableName = "testIndexSplitWithClosestRow";
    IndexedHTableDescriptor ihtd = new IndexedHTableDescriptor(userTableName);
    HColumnDescriptor hcd = new HColumnDescriptor("col");
    IndexSpecification iSpec = new IndexSpecification("ScanIndexf");
    iSpec.addIndexColumn(new HColumnDescriptor("col"), "ql", ValueType.String, 10);
    ihtd.addFamily(hcd);
    ihtd.addIndex(iSpec);
    admin.createTable(ihtd);
    ZKAssign.blockUntilNoRIT(zkw);
    HTable table = new HTable(conf, userTableName);
    // test put with the indexed column
    for (int i = 0; i <= 10; i++) {
View Full Code Here

    HBaseAdmin admin = UTIL.getHBaseAdmin();
    Configuration conf = UTIL.getConfiguration();
    conf.setBoolean("hbase.use.secondary.index", true);
    ZooKeeperWatcher zkw = HBaseTestingUtility.getZooKeeperWatcher(UTIL);
    String userTableName = "testIndexSplitWithClosestRowNotInMainTable";
    IndexedHTableDescriptor ihtd = new IndexedHTableDescriptor(userTableName);
    HColumnDescriptor hcd = new HColumnDescriptor("col");
    IndexSpecification iSpec = new IndexSpecification("ScanIndexf");
    iSpec.addIndexColumn(new HColumnDescriptor("col"), "ql", ValueType.String, 10);
    ihtd.addFamily(hcd);
    ihtd.addIndex(iSpec);
    admin.createTable(ihtd);
    ZKAssign.blockUntilNoRIT(zkw);
    HTable table = new HTable(conf, userTableName);
    // test put with the indexed column
    for (int i = 0; i <= 10; i++) {
View Full Code Here

  public void testPutWithValueLengthMoreThanMaxValueLength() throws IOException, KeeperException,
      InterruptedException {
    HBaseAdmin admin = UTIL.getHBaseAdmin();
    Configuration conf = UTIL.getConfiguration();
    String userTableName = "testPutWithValueLengthMoreThanMaxValueLength";
    IndexedHTableDescriptor ihtd = new IndexedHTableDescriptor(userTableName);
    HColumnDescriptor hcd = new HColumnDescriptor("col");
    IndexSpecification iSpec1 = new IndexSpecification("Index1");
    iSpec1.addIndexColumn(hcd, "ql1", ValueType.String, 10);
    ihtd.addFamily(hcd);
    ihtd.addIndex(iSpec1);
    admin.createTable(ihtd);

    HTable table = new HTable(conf, userTableName);
    table.setAutoFlush(false);
    List<Put> putList = new ArrayList<Put>(3);
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hbase.index.IndexedHTableDescriptor

Copyright © 2018 www.massapicom. 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.