@Test public void testGetIndicesForColumn() throws Exception { MockIndex ix1 = new MockIndex("foo", 0, true, "a".getBytes(), "b".getBytes(), "c", "d"); MockIndex ix2 = new MockIndex("bar", 0, true, "e".getBytes(), "f".getBytes(), "g", "h"); Configuration conf = CConfiguration.getDefault(); Client client = new Client(conf); client.addIndex(ix1); client.addIndex(ix2); Assert.assertNotNull(client.getIndicesForColumn("c", "a".getBytes(), "b".getBytes())); }
public Index[] getIndicesForColumn(String table, byte[] family, byte[] qualifier) { Index[] indices = getIndices(); List<Index> indicesForColumn = new ArrayList<Index>(); for (Index index : indices) { if (table.equals(index.getPrimaryTableName())) { if (LexicographicBytesComparator.INSTANCE.compare(family, index.getColumnFamily()) == 0) { if (LexicographicBytesComparator.INSTANCE.compare(qualifier, index.getColumnQualifier()) == 0) { indicesForColumn.add(index); } } } } return indicesForColumn.toArray(new Index[indicesForColumn.size()]); }
Client { public Index[] getIndicesForColumn(String table, byte[] family, byte[] qualifier) { Index[] indices = getIndices(); List<Index> indicesForColumn = new ArrayList<Index>(); for (Index index : indices) { if (table.equals(index.getPrimaryTableName())) { if (LexicographicBytesComparator.INSTANCE.compare(family, index.getColumnFamily()) == 0) { if (LexicographicBytesComparator.INSTANCE.compare(qualifier, index.getColumnQualifier()) == 0) { indicesForColumn.add(index); } } } } return indicesForColumn.toArray(new Index[indicesForColumn.size()]); } }
Client { public Index[] getIndicesForColumn(String table, byte[] family, byte[] qualifier) { Index[] indices = getIndices(); List<Index> indicesForColumn = new ArrayList<Index>(); for (Index index : indices) { if (table.equals(index.getPrimaryTableName())) { if (LexicographicBytesComparator.INSTANCE.compare(family, index.getColumnFamily()) == 0) { if (LexicographicBytesComparator.INSTANCE.compare(qualifier, index.getColumnQualifier()) == 0) { indicesForColumn.add(index); } } } } return indicesForColumn.toArray(new Index[indicesForColumn.size()]); } Client(Configuration conf); }
Client { public Index[] getIndicesForColumn(String table, byte[] family, byte[] qualifier) { Index[] indices = getIndices(); List<Index> indicesForColumn = new ArrayList<Index>(); for (Index index : indices) { if (table.equals(index.getPrimaryTableName())) { if (LexicographicBytesComparator.INSTANCE.compare(family, index.getColumnFamily()) == 0) { if (LexicographicBytesComparator.INSTANCE.compare(qualifier, index.getColumnQualifier()) == 0) { indicesForColumn.add(index); } } } } return indicesForColumn.toArray(new Index[indicesForColumn.size()]); } Client(Configuration conf); void put(String tableName, Put put); HashMap<String, Index> getIndexMap(); Iterator<Result> query(Constraint query); Index[] getIndices(); Index[] getIndicesForTable(String tableName); Index getIndexByName(String string); Index[] getIndicesForColumn(String table, byte[] family,
      byte[] qualifier); void addIndex(Index index); Configuration getConf(); static void setDatabase(DatabaseAdapter db, Configuration conf); static void setDatabaseAdapter(Configuration conf,
      Class<? extends DatabaseAdapter> adapterClass); boolean tableExists(String tableName); boolean verify(); }
Client { public Index[] getIndicesForColumn(String table, byte[] family, byte[] qualifier) { Index[] indices = getIndices(); List<Index> indicesForColumn = new ArrayList<Index>(); for (Index index : indices) { if (table.equals(index.getPrimaryTableName())) { if (LexicographicBytesComparator.INSTANCE.compare(family, index.getColumnFamily()) == 0) { if (LexicographicBytesComparator.INSTANCE.compare(qualifier, index.getColumnQualifier()) == 0) { indicesForColumn.add(index); } } } } return indicesForColumn.toArray(new Index[indicesForColumn.size()]); } Client(Configuration conf); void put(String tableName, Put put); HashMap<String, Index> getIndexMap(); Iterator<Result> query(Constraint query); Index[] getIndices(); Index[] getIndicesForTable(String tableName); Index getIndexByName(String string); Index[] getIndicesForColumn(String table, byte[] family,
      byte[] qualifier); void addIndex(Index index); Configuration getConf(); static void setDatabase(DatabaseAdapter db, Configuration conf); static void setDatabaseAdapter(Configuration conf,
      Class<? extends DatabaseAdapter> adapterClass); boolean tableExists(String tableName); boolean verify();  }