Search in sources :

Example 6 with IndexRowKey

use of com.nearinfinity.honeycomb.hbase.rowkey.IndexRowKey in project honeycomb by altamiracorp.

the class HBaseTable method indexScanExact.

@Override
public Scanner indexScanExact(QueryKey key) {
    final TableSchema schema = store.getSchema(tableId);
    long indexId = store.getIndexId(tableId, key.getIndexName());
    IndexRowKey row = IndexRowKeyBuilder.newBuilder(tableId, indexId).withQueryKey(key, schema).withSortOrder(SortOrder.Ascending).build();
    // Scan is [start, end) : increment to set end to next possible row
    return createScannerForRange(row.encode(), incrementRowKey(row.encode()));
}
Also used : IndexRowKey(com.nearinfinity.honeycomb.hbase.rowkey.IndexRowKey) TableSchema(com.nearinfinity.honeycomb.mysql.schema.TableSchema)

Example 7 with IndexRowKey

use of com.nearinfinity.honeycomb.hbase.rowkey.IndexRowKey in project honeycomb by altamiracorp.

the class HBaseTable method ascendingIndexScanAt.

@Override
public Scanner ascendingIndexScanAt(QueryKey key) {
    final TableSchema schema = store.getSchema(tableId);
    long indexId = store.getIndexId(tableId, key.getIndexName());
    IndexRowKey startRow = IndexRowKeyBuilder.newBuilder(tableId, indexId).withQueryKey(key, schema).withSortOrder(SortOrder.Ascending).build();
    IndexRowKey endRow = IndexRowKeyBuilder.newBuilder(tableId, indexId + 1).withSortOrder(SortOrder.Ascending).build();
    return createScannerForRange(startRow.encode(), endRow.encode());
}
Also used : IndexRowKey(com.nearinfinity.honeycomb.hbase.rowkey.IndexRowKey) TableSchema(com.nearinfinity.honeycomb.mysql.schema.TableSchema)

Aggregations

IndexRowKey (com.nearinfinity.honeycomb.hbase.rowkey.IndexRowKey)7 TableSchema (com.nearinfinity.honeycomb.mysql.schema.TableSchema)5