Package org.apache.hadoop.hbase.index

Examples of org.apache.hadoop.hbase.index.IndexedHTableDescriptor.addIndex()


    ihtd.addFamily(hcd);
    ihtd.addIndex(iSpec1);
    IndexSpecification iSpec2 = new IndexSpecification("Index2");
    iSpec2.addIndexColumn(hcd, "q1", ValueType.Int, 10);
    iSpec2.addIndexColumn(hcd, "q3", ValueType.String, 10);
    ihtd.addIndex(iSpec2);
    boolean returnVal = false;
    try {
      admin.createTable(ihtd);
      fail("Exception should be thrown");
    } catch (IOException e) {
View Full Code Here


    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);
    iSpec2.addIndexColumn(hcd, "q2", ValueType.String, 7);
    ihtd.addIndex(iSpec2);
View Full Code Here

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

    boolean returnVal = false;
    try {
      admin.createTable(ihtd);
      fail("IOException should be thrown");
View Full Code Here

    IndexedHTableDescriptor ihtd = new IndexedHTableDescriptor(userTableName);
    HColumnDescriptor hcd = new HColumnDescriptor("cf1");
    ihtd.addFamily(hcd);
    IndexSpecification iSpec = new IndexSpecification("idx");
    iSpec.addIndexColumn(hcd, "q", ValueType.String, 10);
    ihtd.addIndex(iSpec);

    char c = 'A';
    byte[][] splits = new byte[5][];
    for (int i = 0; i < 5; i++) {
      byte[] b = { (byte) c };
View Full Code Here

    String userTableName1 = "testCoLocationFixing1";
    ihtd = new IndexedHTableDescriptor(userTableName1);
    ihtd.addFamily(hcd);
    iSpec = new IndexSpecification("idx1");
    iSpec.addIndexColumn(hcd, "q", ValueType.String, 10);
    ihtd.addIndex(iSpec);
    admin.createTable(ihtd, splits);

    String userTableName2 = "testCoLocationFixing2";
    ihtd = new IndexedHTableDescriptor(userTableName2);
    ihtd.addFamily(hcd);
View Full Code Here

    String userTableName2 = "testCoLocationFixing2";
    ihtd = new IndexedHTableDescriptor(userTableName2);
    ihtd.addFamily(hcd);
    iSpec = new IndexSpecification("idx2");
    iSpec.addIndexColumn(hcd, "q", ValueType.String, 10);
    ihtd.addIndex(iSpec);
    admin.createTable(ihtd, splits);

    List<byte[]> regions = UTIL.getMetaTableRows(Bytes.toBytes(userTableName + "_idx"));
    List<byte[]> regionsEncod = getEncodedNames(regions);
View Full Code Here

    IndexedHTableDescriptor ihtd = new IndexedHTableDescriptor(userTableName);
    HColumnDescriptor hcd = new HColumnDescriptor("col");
    IndexSpecification iSpec = new IndexSpecification("Index1");
    iSpec.addIndexColumn(hcd, "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
View Full Code Here

    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.String, 10);
    ihtd.addIndex(iSpec2);

    try {
View Full Code Here

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

    try {
      admin.createTable(ihtd);
    } catch (IOException e) {
      fail("Exception should not be thrown");
View Full Code Here

    IndexSpecification iSpec = new IndexSpecification("Index1");

    iSpec.addIndexColumn(hcd, "ql", ValueType.String, 10);
    ihtd.addFamily(hcd);

    ihtd.addIndex(iSpec);
    admin.createTable(ihtd);
    ZKAssign.blockUntilNoRIT(zkw);
    HTable table = new HTable(conf, userTableName + "_idx");
    HTableDescriptor tableDescriptor =
        admin.getTableDescriptor(Bytes.toBytes(userTableName + "_idx"));
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.