Examples of addIndexColumn()


Examples of nexj.core.meta.persistence.sql.Index.addIndexColumn()

      assertEquals(1, table.getIndex(0).getIndexColumnCount());
      table.setType(Table.MANAGED); // comes in as Table.EXTERNAL from DB

      Index aspect = new Index("aspect", Index.ASPECT, null);

      aspect.addIndexColumn(new IndexColumn(table.getColumn(1), true));
      schema.addIndex(aspect);

      ApplyIndexAspectStep step = new ApplyIndexAspectStep();

      step.setAspectName(aspect.getName());
View Full Code Here

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

  public void testShouldAbleReturnTrueForIndexedTable() throws Exception {
    tableName = "testShouldAbleReturnTrueForIndexedTable";
    IndexedHTableDescriptor ihtd = new IndexedHTableDescriptor(tableName);
    HColumnDescriptor hcd = new HColumnDescriptor("col");
    IndexSpecification iSpec = new IndexSpecification("ScanIndexf");
    iSpec.addIndexColumn(hcd, "ql", ValueType.String, 10);
    ihtd.addFamily(hcd);
    ihtd.addIndex(iSpec);
    admin.createTable(ihtd);
    Assert.assertTrue(IndexMapReduceUtil.isIndexedTable(tableName, conf));
  }
View Full Code Here

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

  public void testShouldFormIndexPutsAndIndexDeletes() throws Exception {
    tableName = "testShouldFormIndexPutsAndIndexDeletes";
    IndexedHTableDescriptor ihtd = new IndexedHTableDescriptor(tableName);
    HColumnDescriptor hcd = new HColumnDescriptor("col");
    IndexSpecification iSpec = new IndexSpecification("ScanIndexf");
    iSpec.addIndexColumn(hcd, "q1", ValueType.String, 10);
    iSpec.addIndexColumn(hcd, "q2", ValueType.String, 10);
    ihtd.addFamily(hcd);
    ihtd.addIndex(iSpec);
    admin.getConfiguration().set(TableInputFormat.INPUT_TABLE, tableName);
    admin.createTable(ihtd);
View Full Code Here

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

    tableName = "testShouldFormIndexPutsAndIndexDeletes";
    IndexedHTableDescriptor ihtd = new IndexedHTableDescriptor(tableName);
    HColumnDescriptor hcd = new HColumnDescriptor("col");
    IndexSpecification iSpec = new IndexSpecification("ScanIndexf");
    iSpec.addIndexColumn(hcd, "q1", ValueType.String, 10);
    iSpec.addIndexColumn(hcd, "q2", ValueType.String, 10);
    ihtd.addFamily(hcd);
    ihtd.addIndex(iSpec);
    admin.getConfiguration().set(TableInputFormat.INPUT_TABLE, tableName);
    admin.createTable(ihtd);
    HTable mainTable = new HTable(conf, Bytes.toBytes(tableName));
View Full Code Here

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

    assertNotNull("Index Manager should not be null.", im);

    List<IndexSpecification> indexList = new ArrayList<IndexSpecification>(1);
    IndexSpecification iSpec = new IndexSpecification("index_name");

    iSpec.addIndexColumn(new HColumnDescriptor("cf"), "cq", null, 10);
    indexList.add(iSpec);
    im.addIndexForTable("index_name", indexList);
    indexList = im.getIndicesForTable("index_name");
    assertEquals("Index name should be equal with actual value.", "index_name", indexList.get(0)
        .getName());
View Full Code Here

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

    assertNotNull("Index Manager should not be null.", im);

    List<IndexSpecification> indexList = new ArrayList<IndexSpecification>(1);
    IndexSpecification iSpec = new IndexSpecification("index_name");

    iSpec.addIndexColumn(new HColumnDescriptor("cf"), "cq", null, 5);
    indexList.add(iSpec);
    im.addIndexForTable("index_name", indexList);
    indexList = im.getIndicesForTable("index_name");

    Set<ColumnQualifier> indexColumns = indexList.get(0).getIndexColumns();
View Full Code Here

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

    assertNotNull("Index Manager should not be null.", im);

    List<IndexSpecification> indexList = new ArrayList<IndexSpecification>(1);
    IndexSpecification iSpec = new IndexSpecification("index_name");

    iSpec.addIndexColumn(new HColumnDescriptor("cf"), "cq", null, 0);
    indexList.add(iSpec);
    im.addIndexForTable("index_name", indexList);
    indexList = im.getIndicesForTable("index_name");
    assertEquals("the total value length should be 2", 2, indexList.get(0).getTotalValueLength());
  }
View Full Code Here

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

    assertNotNull("Index Manager should not be null.", im);

    List<IndexSpecification> indexList = new ArrayList<IndexSpecification>(1);
    IndexSpecification iSpec = new IndexSpecification("index_name");

    iSpec.addIndexColumn(new HColumnDescriptor("cf"), "cq", null, 10);
    indexList.add(iSpec);
    im.removeIndices("index_name");
    indexList = im.getIndicesForTable("index_name");
    assertNull("Index specification List should be null.", indexList);
View Full Code Here

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

  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

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

    ZooKeeperWatcher zkw = HBaseTestingUtility.getZooKeeperWatcher(UTIL);
    IndexedHTableDescriptor ihtd = new IndexedHTableDescriptor(userTableName);
    HColumnDescriptor hcd1 = new HColumnDescriptor("column1");
    HColumnDescriptor hcd2 = new HColumnDescriptor("column2");
    IndexSpecification iSpec1 = new IndexSpecification("Index");
    iSpec1.addIndexColumn(hcd1, "q", ValueType.String, 10);
    iSpec1.addIndexColumn(hcd2, "q", ValueType.String, 10);
    ihtd.addFamily(hcd1);
    ihtd.addFamily(hcd2);
    ihtd.addIndex(iSpec1);
    admin.createTable(ihtd);
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.