Package org.apache.hadoop.hbase.index

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


    Configuration conf = TEST_UTIL.getConfiguration();
    HTableDescriptor htd = new HTableDescriptor("testIndexPutWithOffsetAndLength");
    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 SpatialPartition(20, 2),
      ValueType.String, 18);

    byte[] value1 = "AB---CD---EF---GH---IJ---KL---MN---OP---".getBytes();
    Put p = new Put("row".getBytes());
    p.add("col".getBytes(), "ql1".getBytes(), value1);
View Full Code Here


    HTableDescriptor htd =
        new HTableDescriptor("testIndexPutWithOffsetAndLengthWhenPutIsSmallerThanOffset");
    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 SpatialPartition(20, 2),
      ValueType.String, 18);

    byte[] value1 = "AB---CD---EF---GH".getBytes();
    Put p = new Put("row".getBytes());
    p.add("col".getBytes(), "ql1".getBytes(), value1);
View Full Code Here

  public void testExtentedParametersValidityPassScenarios() throws IOException {
    IndexSpecification spec = new IndexSpecification("index");

    // When the provided arguments are correct
    try {
      spec.addIndexColumn(new HColumnDescriptor("col"), "ql1", new SpatialPartition(4, 10),
        ValueType.String, 10);
    } catch (IllegalArgumentException e) {
      Assert.fail("the testcase should not throw exception as the arguments passed are correct.");
    }
View Full Code Here

    DataInputStream dis = null;
    try {
      bos = new ByteArrayOutputStream();
      dos = new DataOutputStream(bos);
      ColumnQualifier cq =
          new ColumnQualifier("cf", "cq", ValueType.String, 10, new SpatialPartition(0, 5));
      cq.write(dos);
      dos.flush();
      byte[] byteArray = bos.toByteArray();
      bis = new ByteArrayInputStream(byteArray);
      dis = new DataInputStream(bis);
View Full Code Here

    super.readFields(in);
    PartitionType p = PartitionType.valueOf(in.readUTF());
    if (p.equals(PartitionType.SEPARATOR)) {
      valuePartition = new SeparatorPartition();
    } else if (p.equals(PartitionType.SPATIAL)) {
      valuePartition = new SpatialPartition();
    }
    if (valuePartition != null) {
      valuePartition.readFields(in);
    }
  }
View Full Code Here

TOP

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

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.