Search in sources :

Example 31 with SingleColumnValueFilter

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

the class HBase10CDH550QueueConsumer 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

SingleColumnValueFilter (org.apache.hadoop.hbase.filter.SingleColumnValueFilter)31 Scan (org.apache.hadoop.hbase.client.Scan)12 BinaryComparator (org.apache.hadoop.hbase.filter.BinaryComparator)10 Filter (org.apache.hadoop.hbase.filter.Filter)9 FilterList (org.apache.hadoop.hbase.filter.FilterList)8 ResultScanner (org.apache.hadoop.hbase.client.ResultScanner)7 BitComparator (org.apache.hadoop.hbase.filter.BitComparator)7 Result (org.apache.hadoop.hbase.client.Result)6 RowFilter (org.apache.hadoop.hbase.filter.RowFilter)6 Test (org.junit.Test)5 ArrayList (java.util.ArrayList)4 CompareOp (org.apache.hadoop.hbase.filter.CompareFilter.CompareOp)4 FirstKeyOnlyFilter (org.apache.hadoop.hbase.filter.FirstKeyOnlyFilter)4 Put (org.apache.hadoop.hbase.client.Put)3 ByteArrayComparable (org.apache.hadoop.hbase.filter.ByteArrayComparable)3 PrefixFilter (org.apache.hadoop.hbase.filter.PrefixFilter)3 ImmutableBytesWritable (org.apache.hadoop.hbase.io.ImmutableBytesWritable)3 SchemaPath (org.apache.drill.common.expression.SchemaPath)2 Cell (org.apache.hadoop.hbase.Cell)2 TableName (org.apache.hadoop.hbase.TableName)2