Package org.apache.hadoop.hbase.client.idx

Examples of org.apache.hadoop.hbase.client.idx.IdxColumnDescriptor


    final AtomicInteger sequence = new AtomicInteger(0);

    HTableDescriptor desc = new HTableDescriptor("testConcurrentReadWrite");
    byte[] family = Bytes.toBytes("concurrentRW");
    byte[] qualifier = Bytes.toBytes("strings");
    IdxColumnDescriptor descriptor = new IdxColumnDescriptor(family);
    descriptor.addIndexDescriptor(new IdxIndexDescriptor(qualifier,
      IdxQualifierType.CHAR_ARRAY));
    desc.addFamily(descriptor);
    HBaseAdmin admin = new HBaseAdmin(conf);
    admin.createTable(desc);
    HTable table = new HTable(conf, desc.getName());
View Full Code Here


  /**
   * Test that the index constructed correctly.
   */
  public void testConstruction() {
    IdxColumnDescriptor columnDescriptor = new IdxColumnDescriptor(FAMILY);
    byte[] value;
    int id;
    CompleteIndexBuilder bldr;

    /**
 
View Full Code Here

   * Compares the Idx region performance with the HRegion performance.
   *
   * @throws java.io.IOException in case of an IO error
   */
  public void testIdxRegionPerformance() throws IOException {
    IdxColumnDescriptor family1 = new IdxColumnDescriptor(FAMILY_1_NAME);
    family1.addIndexDescriptor(new IdxIndexDescriptor(INT_QUAL_NAME,
      IdxQualifierType.INT));
    family1.addIndexDescriptor(new IdxIndexDescriptor(BYTES_QUAL_NAME,
      IdxQualifierType.BYTE_ARRAY));

    IdxColumnDescriptor family2 = new IdxColumnDescriptor(FAMILY_2_NAME);
    family2.addIndexDescriptor(new IdxIndexDescriptor(CHARS_QUAL_NAME,
      IdxQualifierType.CHAR_ARRAY));

    HTableDescriptor htableDescriptor
      = new HTableDescriptor("testIdxRegionPerformance");
    htableDescriptor.addFamily(family1);
View Full Code Here

    HBaseConfiguration conf, Pair<byte[],
      IdxIndexDescriptor[]>... families)
    throws Exception {
    HTableDescriptor htd = new HTableDescriptor(tableName);
    for (Pair<byte[], IdxIndexDescriptor[]> familyPair : families) {
      IdxColumnDescriptor idxColumnDescriptor
        = new IdxColumnDescriptor(familyPair.getFirst());
      if (familyPair.getSecond() != null) {
        for (IdxIndexDescriptor descriptor : familyPair.getSecond())
          idxColumnDescriptor.addIndexDescriptor(descriptor);
      }
      htd.addFamily(idxColumnDescriptor);
    }
    HRegionInfo info = new HRegionInfo(htd, null, null, false);
    Path path = new Path(DIR + callingMethod);
View Full Code Here

  protected HTableDescriptor constructTableDescriptor(byte[] tableName,
    byte[]... families) {
    HTableDescriptor htd = new HTableDescriptor(tableName);
    for (byte[] family : families) {
      try {
        IdxColumnDescriptor icd = new IdxColumnDescriptor(family);
        icd.addIndexDescriptor(new IdxIndexDescriptor(qual1,
          IdxQualifierType.BYTE_ARRAY));
        icd.addIndexDescriptor(new IdxIndexDescriptor(qual2,
          IdxQualifierType.BYTE_ARRAY));
        icd.addIndexDescriptor(new IdxIndexDescriptor(qual3,
          IdxQualifierType.BYTE_ARRAY));
        htd.addFamily(icd);
      } catch (IOException e) {
        throw new IllegalStateException(e);
      }
View Full Code Here

  }
 
  public static void main(String args[]) throws Exception {
    HBaseAdmin admin = new HBaseAdmin(new HBaseConfiguration());
    HTableDescriptor tableDescr = new HTableDescriptor("testfacttable");
    IdxColumnDescriptor idxColumnDescriptor = new IdxColumnDescriptor(Bytes.toBytes("data"));
    IdxIndexDescriptor indexDescriptor1  = new IdxIndexDescriptor(Bytes.toBytes("d1"), IdxQualifierType.LONG);
    IdxIndexDescriptor indexDescriptor2  = new IdxIndexDescriptor(Bytes.toBytes("d2"), IdxQualifierType.LONG);
    IdxIndexDescriptor indexDescriptor3  = new IdxIndexDescriptor(Bytes.toBytes("d3"), IdxQualifierType.LONG);
    idxColumnDescriptor.addIndexDescriptor(indexDescriptor1);
    idxColumnDescriptor.addIndexDescriptor(indexDescriptor2);
    idxColumnDescriptor.addIndexDescriptor(indexDescriptor3);
    tableDescr.addFamily(idxColumnDescriptor);
    if(admin.tableExists("testfacttable")) {
      admin.disableTable("testfacttable");
      admin.deleteTable("testfacttable");
    }
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hbase.client.idx.IdxColumnDescriptor

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.