Package org.apache.hadoop.hbase.index

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


    HBaseAdmin admin = new HBaseAdmin(UTIL.getConfiguration());
    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);

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


    HBaseAdmin admin = new HBaseAdmin(UTIL.getConfiguration());
    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);
    iSpec2.addIndexColumn(hcd, "q2", ValueType.String, 10);
    ihtd.addIndex(iSpec2);

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

    HBaseAdmin admin = new HBaseAdmin(UTIL.getConfiguration());
    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);
    iSpec2.addIndexColumn(hcd, "q3", ValueType.String, 10);
    ihtd.addIndex(iSpec2);
    boolean returnVal = false;
    try {
      admin.createTable(ihtd);
      fail("Exception should be thrown");
View Full Code Here

    HBaseAdmin admin = new HBaseAdmin(UTIL.getConfiguration());
    ZooKeeperWatcher zkw = HBaseTestingUtility.getZooKeeperWatcher(UTIL);
    String userTableName = "testNotConsisIndex4";
    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);
    iSpec2.addIndexColumn(hcd, "q2", ValueType.String, 7);
    ihtd.addIndex(iSpec2);

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

    HBaseAdmin admin = new HBaseAdmin(UTIL.getConfiguration());
    ZooKeeperWatcher zkw = HBaseTestingUtility.getZooKeeperWatcher(UTIL);
    String userTableName = "testConsisIndex";
    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 {
      admin.createTable(ihtd);
    } catch (IOException e) {
View Full Code Here

    ZooKeeperWatcher zkw = HBaseTestingUtility.getZooKeeperWatcher(UTIL);
    String userTableName = "testBlockEncoding";
    IndexedHTableDescriptor ihtd = new IndexedHTableDescriptor(userTableName);
    HColumnDescriptor hcd = new HColumnDescriptor("col1");

    IndexSpecification iSpec = new IndexSpecification("Index1");

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

    ihtd.addIndex(iSpec);
    admin.createTable(ihtd);
    ZKAssign.blockUntilNoRIT(zkw);
View Full Code Here

    String userTableName = "testCoLocationFixing";
    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 };
      c++;
      splits[i] = b;
    }
    admin.createTable(ihtd, splits);

    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);
    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

    Configuration conf = UTIL.getConfiguration();
    String userTableName = "testPutContainingTheIndexedColumn";
    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);
View Full Code Here

    HBaseAdmin admin = UTIL.getHBaseAdmin();
    ZooKeeperWatcher zkw = HBaseTestingUtility.getZooKeeperWatcher(UTIL);
    String userTableName = "testPostOpenCoprocessor";
    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);
View Full Code Here

    ZooKeeperWatcher zkw = HBaseTestingUtility.getZooKeeperWatcher(UTIL);
    Configuration conf = UTIL.getConfiguration();
    String userTableName = "testMultipleIndicesOnUniqueColumns";
    IndexedHTableDescriptor ihtd = new IndexedHTableDescriptor(userTableName);
    HColumnDescriptor hcd = new HColumnDescriptor("col");
    IndexSpecification iSpec1 = new IndexSpecification("Index1");
    IndexSpecification iSpec2 = new IndexSpecification("Index2");
    iSpec1.addIndexColumn(hcd, "ql1", ValueType.String, 10);
    iSpec2.addIndexColumn(hcd, "ql2", ValueType.String, 10);
    ihtd.addFamily(hcd);
    ihtd.addIndex(iSpec1);
    ihtd.addIndex(iSpec2);
    admin.createTable(ihtd);
    ZKAssign.blockUntilNoRIT(zkw);
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.