Package org.apache.hadoop.hbase.index

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


    Configuration conf = TEST_UTIL.getConfiguration();
    HTableDescriptor htd = new HTableDescriptor("testIndexPutWithNegativeIntDataTypes");
    HRegionInfo info = new HRegionInfo(htd.getName(), "ABC".getBytes(), "BBB".getBytes(), false);
    // HLog hlog = UTIL.getMiniHBaseCluster().getRegionServer(0).getWAL();
    HRegion region = HRegion.createHRegion(info, basedir, conf, htd);
    IndexSpecification spec = new IndexSpecification("index");
    spec.addIndexColumn(new HColumnDescriptor("col"), "ql1", ValueType.Long, 4);

    byte[] value1 = Bytes.toBytes(-2562351L);
    Put p = new Put("row".getBytes());
    p.add("col".getBytes(), "ql1".getBytes(), value1);
    Put indexPut = IndexUtils.prepareIndexPut(p, spec, region);
View Full Code Here


    Configuration conf = TEST_UTIL.getConfiguration();
    HTableDescriptor htd = new HTableDescriptor("testIndexPutWithNegativeIntDataTypes");
    HRegionInfo info = new HRegionInfo(htd.getName(), "ABC".getBytes(), "BBB".getBytes(), false);
    // HLog hlog = UTIL.getMiniHBaseCluster().getRegionServer(0).getWAL();
    HRegion region = HRegion.createHRegion(info, basedir, conf, htd);
    IndexSpecification spec = new IndexSpecification("index");
    spec.addIndexColumn(new HColumnDescriptor("col"), "ql1", ValueType.Short, 4);

    short s = 1000;
    byte[] value1 = Bytes.toBytes(s);
    Put p = new Put("row".getBytes());
    p.add("col".getBytes(), "ql1".getBytes(), value1);
View Full Code Here

    Configuration conf = TEST_UTIL.getConfiguration();
    HTableDescriptor htd = new HTableDescriptor("testIndexPutWithNegativeIntDataTypes");
    HRegionInfo info = new HRegionInfo(htd.getName(), "ABC".getBytes(), "BBB".getBytes(), false);
    // HLog hlog = UTIL.getMiniHBaseCluster().getRegionServer(0).getWAL();
    HRegion region = HRegion.createHRegion(info, basedir, conf, htd);
    IndexSpecification spec = new IndexSpecification("index");
    spec.addIndexColumn(new HColumnDescriptor("col"), "ql1", ValueType.Short, 4);

    byte b = 100;
    byte[] value1 = Bytes.toBytes(b);
    Put p = new Put("row".getBytes());
    p.add("col".getBytes(), "ql1".getBytes(), value1);
View Full Code Here

    Configuration conf = TEST_UTIL.getConfiguration();
    HTableDescriptor htd = new HTableDescriptor("testIndexPutWithNegativeIntDataTypes");
    HRegionInfo info = new HRegionInfo(htd.getName(), "ABC".getBytes(), "BBB".getBytes(), false);
    // HLog hlog = UTIL.getMiniHBaseCluster().getRegionServer(0).getWAL();
    HRegion region = HRegion.createHRegion(info, basedir, conf, htd);
    IndexSpecification spec = new IndexSpecification("index");
    spec.addIndexColumn(new HColumnDescriptor("col"), "ql1", ValueType.Char, 4);

    char c = 'A';
    byte[] value1 = new byte[2];
    value1[1] = (byte) c;
    c >>= 8;
View Full Code Here

    Configuration conf = TEST_UTIL.getConfiguration();
    HTableDescriptor htd = new HTableDescriptor("testIndexPutWithNegativeIntDataTypes");
    HRegionInfo info = new HRegionInfo(htd.getName(), "ABC".getBytes(), "BBB".getBytes(), false);
    // HLog hlog = UTIL.getMiniHBaseCluster().getRegionServer(0).getWAL();
    HRegion region = HRegion.createHRegion(info, basedir, conf, htd);
    IndexSpecification spec = new IndexSpecification("index");
    spec.addIndexColumn(new HColumnDescriptor("col"), "ql1", ValueType.Double, 8);

    byte[] value1 = Bytes.toBytes(109.4548957D);
    Put p = new Put("row".getBytes());
    p.add("col".getBytes(), "ql1".getBytes(), value1);
    Put indexPut = IndexUtils.prepareIndexPut(p, spec, region);
View Full Code Here

    Path basedir = new Path(DIR + "TestIndexPut");
    Configuration conf = TEST_UTIL.getConfiguration();
    HTableDescriptor htd = new HTableDescriptor("testSequenceOfIndexPutsWithDataTypes");
    HRegionInfo info = new HRegionInfo(htd.getName(), "ABC".getBytes(), "BBB".getBytes(), false);
    HRegion region = HRegion.createHRegion(info, basedir, conf, htd);
    IndexSpecification spec = new IndexSpecification("index");
    spec.addIndexColumn(new HColumnDescriptor("col"), "ql1", ValueType.Int, 4);

    byte[] value1 = Bytes.toBytes(-1000);
    Put p = new Put("row".getBytes());
    p.add("col".getBytes(), "ql1".getBytes(), value1);
    Put indexPut = IndexUtils.prepareIndexPut(p, spec, region);
View Full Code Here

    Path basedir = new Path(DIR + "TestIndexPut");
    Configuration conf = TEST_UTIL.getConfiguration();
    HTableDescriptor htd = new HTableDescriptor("testSequenceOfIndexPutsWithDataTypes");
    HRegionInfo info = new HRegionInfo(htd.getName(), "ABC".getBytes(), "BBB".getBytes(), false);
    HRegion region = HRegion.createHRegion(info, basedir, conf, htd);
    IndexSpecification spec = new IndexSpecification("index");
    spec.addIndexColumn(new HColumnDescriptor("col"), "ql1", ValueType.Float, 4);

    byte[] value1 = Bytes.toBytes(-10.40f);
    Put p = new Put("row".getBytes());
    p.add("col".getBytes(), "ql1".getBytes(), value1);
    Put indexPut = IndexUtils.prepareIndexPut(p, spec, region);
View Full Code Here

    Path basedir = new Path(DIR + "TestIndexPut");
    Configuration conf = TEST_UTIL.getConfiguration();
    HTableDescriptor htd = new HTableDescriptor("testSequenceOfIndexPutsWithDataTypes");
    HRegionInfo info = new HRegionInfo(htd.getName(), "ABC".getBytes(), "BBB".getBytes(), false);
    HRegion region = HRegion.createHRegion(info, basedir, conf, htd);
    IndexSpecification spec = new IndexSpecification("index");
    spec.addIndexColumn(new HColumnDescriptor("col"), "ql1", ValueType.Int, 4);

    byte[] value1 = Bytes.toBytes(1000);
    Put p = new Put("row".getBytes());
    p.add("col".getBytes(), "ql1".getBytes(), value1);
    Put indexPut = IndexUtils.prepareIndexPut(p, spec, region);
View Full Code Here

    Path basedir = new Path(DIR + "TestIndexPut");
    Configuration conf = TEST_UTIL.getConfiguration();
    HTableDescriptor htd = new HTableDescriptor("testIndexPutWithSeparatorAndDataType");
    HRegionInfo info = new HRegionInfo(htd.getName(), "ABC".getBytes(), "BBB".getBytes(), false);
    HRegion region = HRegion.createHRegion(info, basedir, conf, htd);
    IndexSpecification spec = new IndexSpecification("index");
    spec.addIndexColumn(new HColumnDescriptor("col"), "ql1", new SeparatorPartition("---", 4),
      ValueType.Int, 4);

    byte[] putValue = new byte[19];
    byte[] value1 = "AB---CD---EF---".getBytes();
    byte[] value2 = Bytes.toBytes(100000);
View Full Code Here

  }

  private IndexedHTableDescriptor createIndexedHTableDescriptor(String tableName,
      String columnFamily, String indexName, String indexColumnFamily, String indexColumnQualifier) {
    IndexedHTableDescriptor htd = new IndexedHTableDescriptor(tableName);
    IndexSpecification iSpec = new IndexSpecification(indexName);
    HColumnDescriptor hcd = new HColumnDescriptor(columnFamily);
    iSpec.addIndexColumn(hcd, indexColumnQualifier, ValueType.String, 10);
    htd.addFamily(hcd);
    htd.addIndex(iSpec);
    return htd;
  }
View Full Code Here

TOP

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

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.