Package org.apache.hadoop.hbase.index

Examples of org.apache.hadoop.hbase.index.IndexSpecification.addIndexColumn()


    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


    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

    ZooKeeperWatcher zkw = HBaseTestingUtility.getZooKeeperWatcher(UTIL);
    String userTableName = "testNotConsisIndex1";
    IndexedHTableDescriptor ihtd = new IndexedHTableDescriptor(userTableName);
    HColumnDescriptor hcd = new HColumnDescriptor("col");
    IndexSpecification iSpec1 = new IndexSpecification("Index1");
    iSpec1.addIndexColumn(hcd, "q1", ValueType.String, 10);
    ihtd.addFamily(hcd);
    ihtd.addIndex(iSpec1);
    IndexSpecification iSpec2 = new IndexSpecification("Index2");
    iSpec2.addIndexColumn(hcd, "q1", ValueType.Int, 10);
    ihtd.addIndex(iSpec2);
View Full Code Here

    IndexSpecification iSpec1 = new IndexSpecification("Index1");
    iSpec1.addIndexColumn(hcd, "q1", ValueType.String, 10);
    ihtd.addFamily(hcd);
    ihtd.addIndex(iSpec1);
    IndexSpecification iSpec2 = new IndexSpecification("Index2");
    iSpec2.addIndexColumn(hcd, "q1", ValueType.Int, 10);
    ihtd.addIndex(iSpec2);

    boolean returnVal = false;
    try {
      admin.createTable(ihtd);
View Full Code Here

    ZooKeeperWatcher zkw = HBaseTestingUtility.getZooKeeperWatcher(UTIL);
    String userTableName = "testNotConsisIndex2";
    IndexedHTableDescriptor ihtd = new IndexedHTableDescriptor(userTableName);
    HColumnDescriptor hcd = new HColumnDescriptor("col");
    IndexSpecification iSpec1 = new IndexSpecification("Index1");
    iSpec1.addIndexColumn(hcd, "q1", ValueType.String, 10);
    iSpec1.addIndexColumn(hcd, "q2", ValueType.String, 4);
    ihtd.addFamily(hcd);
    ihtd.addIndex(iSpec1);
    IndexSpecification iSpec2 = new IndexSpecification("Index2");
    iSpec2.addIndexColumn(hcd, "q3", ValueType.String, 10);
View Full Code Here

    String userTableName = "testNotConsisIndex2";
    IndexedHTableDescriptor ihtd = new IndexedHTableDescriptor(userTableName);
    HColumnDescriptor hcd = new HColumnDescriptor("col");
    IndexSpecification iSpec1 = new IndexSpecification("Index1");
    iSpec1.addIndexColumn(hcd, "q1", ValueType.String, 10);
    iSpec1.addIndexColumn(hcd, "q2", ValueType.String, 4);
    ihtd.addFamily(hcd);
    ihtd.addIndex(iSpec1);
    IndexSpecification iSpec2 = new IndexSpecification("Index2");
    iSpec2.addIndexColumn(hcd, "q3", ValueType.String, 10);
    iSpec2.addIndexColumn(hcd, "q2", ValueType.String, 10);
View Full Code Here

    iSpec1.addIndexColumn(hcd, "q1", ValueType.String, 10);
    iSpec1.addIndexColumn(hcd, "q2", ValueType.String, 4);
    ihtd.addFamily(hcd);
    ihtd.addIndex(iSpec1);
    IndexSpecification iSpec2 = new IndexSpecification("Index2");
    iSpec2.addIndexColumn(hcd, "q3", ValueType.String, 10);
    iSpec2.addIndexColumn(hcd, "q2", ValueType.String, 10);
    ihtd.addIndex(iSpec2);

    boolean returnVal = false;
    try {
View Full Code Here

    iSpec1.addIndexColumn(hcd, "q2", ValueType.String, 4);
    ihtd.addFamily(hcd);
    ihtd.addIndex(iSpec1);
    IndexSpecification iSpec2 = new IndexSpecification("Index2");
    iSpec2.addIndexColumn(hcd, "q3", ValueType.String, 10);
    iSpec2.addIndexColumn(hcd, "q2", ValueType.String, 10);
    ihtd.addIndex(iSpec2);

    boolean returnVal = false;
    try {
      admin.createTable(ihtd);
View Full Code Here

    ZooKeeperWatcher zkw = HBaseTestingUtility.getZooKeeperWatcher(UTIL);
    String userTableName = "testNotConsisIndex3";
    IndexedHTableDescriptor ihtd = new IndexedHTableDescriptor(userTableName);
    HColumnDescriptor hcd = new HColumnDescriptor("col");
    IndexSpecification iSpec1 = new IndexSpecification("Index1");
    iSpec1.addIndexColumn(hcd, "q1", ValueType.String, 10);
    iSpec1.addIndexColumn(hcd, "q2", ValueType.String, 10);
    ihtd.addFamily(hcd);
    ihtd.addIndex(iSpec1);
    IndexSpecification iSpec2 = new IndexSpecification("Index2");
    iSpec2.addIndexColumn(hcd, "q1", ValueType.Int, 10);
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.