Search in sources :

Example 1 with IndexRowKey

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

the class HBaseTable method ascendingIndexScanAfter.

@Override
public Scanner ascendingIndexScanAfter(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(incrementRowKey(startRow.encode()), endRow.encode());
}
Also used : IndexRowKey(com.nearinfinity.honeycomb.hbase.rowkey.IndexRowKey) TableSchema(com.nearinfinity.honeycomb.mysql.schema.TableSchema)

Example 2 with IndexRowKey

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

the class HBaseTable method descendingIndexScanBefore.

@Override
public Scanner descendingIndexScanBefore(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.Descending).build();
    IndexRowKey endRow = IndexRowKeyBuilder.newBuilder(tableId, indexId + 1).withSortOrder(SortOrder.Descending).build();
    return createScannerForRange(incrementRowKey(startRow.encode()), endRow.encode());
}
Also used : IndexRowKey(com.nearinfinity.honeycomb.hbase.rowkey.IndexRowKey) TableSchema(com.nearinfinity.honeycomb.mysql.schema.TableSchema)

Example 3 with IndexRowKey

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

the class HBaseTable method descendingIndexScan.

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

Example 4 with IndexRowKey

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

the class HBaseTable method descendingIndexScanAt.

@Override
public Scanner descendingIndexScanAt(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.Descending).build();
    IndexRowKey endRow = IndexRowKeyBuilder.newBuilder(tableId, indexId + 1).withSortOrder(SortOrder.Descending).build();
    return createScannerForRange(startRow.encode(), endRow.encode());
}
Also used : IndexRowKey(com.nearinfinity.honeycomb.hbase.rowkey.IndexRowKey) TableSchema(com.nearinfinity.honeycomb.mysql.schema.TableSchema)

Example 5 with IndexRowKey

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

the class HBaseTable method ascendingIndexScan.

@Override
public Scanner ascendingIndexScan(QueryKey key) {
    long indexId = store.getIndexId(tableId, key.getIndexName());
    IndexRowKey startRow = IndexRowKeyBuilder.newBuilder(tableId, indexId).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)

Aggregations

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