Search in sources :

Example 6 with BitComparator

use of org.apache.hadoop.hbase.filter.BitComparator in project cdap by caskdata.

the class HBase10CDHQueueConsumer method createStateFilter.

/**
   * Creates a HBase filter that will filter out rows with state column state = PROCESSED (ignoring transaction).
   */
private Filter createStateFilter() {
    byte[] processedMask = new byte[Ints.BYTES * 2 + 1];
    processedMask[processedMask.length - 1] = ConsumerEntryState.PROCESSED.getState();
    return new SingleColumnValueFilter(QueueEntryRow.COLUMN_FAMILY, stateColumnName, CompareFilter.CompareOp.NOT_EQUAL, new BitComparator(processedMask, BitComparator.BitwiseOp.AND));
}
Also used : SingleColumnValueFilter(org.apache.hadoop.hbase.filter.SingleColumnValueFilter) BitComparator(org.apache.hadoop.hbase.filter.BitComparator)

Example 7 with BitComparator

use of org.apache.hadoop.hbase.filter.BitComparator in project cdap by caskdata.

the class HBase98QueueConsumer method createStateFilter.

/**
   * Creates a HBase filter that will filter out rows with state column state = PROCESSED (ignoring transaction).
   */
private Filter createStateFilter() {
    byte[] processedMask = new byte[Ints.BYTES * 2 + 1];
    processedMask[processedMask.length - 1] = ConsumerEntryState.PROCESSED.getState();
    return new SingleColumnValueFilter(QueueEntryRow.COLUMN_FAMILY, stateColumnName, CompareFilter.CompareOp.NOT_EQUAL, new BitComparator(processedMask, BitComparator.BitwiseOp.AND));
}
Also used : SingleColumnValueFilter(org.apache.hadoop.hbase.filter.SingleColumnValueFilter) BitComparator(org.apache.hadoop.hbase.filter.BitComparator)

Aggregations

BitComparator (org.apache.hadoop.hbase.filter.BitComparator)7 SingleColumnValueFilter (org.apache.hadoop.hbase.filter.SingleColumnValueFilter)7