[
https://issues.apache.org/jira/browse/HBASE-19950?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16359224#comment-16359224
]
Chia-Ping Tsai commented on HBASE-19950:
----------------------------------------
1) Why we don't allow user to pass the null qualifier? The null qualifier is
valid in hbase. Perhaps we can convert the passed null qualifier to empty array?
{code:java}
+ public ColumnValueFilter(final byte[] family, final byte[] qualifier,
+ final CompareOperator op,
+ final ByteArrayComparable comparator) {
+ this.family = Preconditions.checkNotNull(family, "family should not be
null.");
+ this.qualifier = Preconditions.checkNotNull(qualifier, "qualifier should not
be null");
+ this.op = Preconditions.checkNotNull(op, "CompareOperator should not be
null");
+ this.comparator = Preconditions.checkNotNull(comparator, "Comparator should
not be null");
+ }{code}
2) ColumnValueFilter doesn't filter the cell by the row, right?
{code:java}
+ @Override
+ public boolean hasFilterRow() {
+ return true;
+ }{code}
3) Seems to me all fields can be final?
{code:java}
+ private byte[] family;
+ private byte[] qualifier;
+ private CompareOperator op;
+ private ByteArrayComparable comparator;{code}
4) Please add the check of NO_OP. Otherwise, the compare will throw the
RuntimeException
{code:java}
+ private boolean compareValue(final CompareOperator op, final
ByteArrayComparable comparator,
+ final Cell cell) {
+ int compareResult = PrivateCellUtil.compareValue(cell, comparator);
+ return CompareFilter.compare(op, compareResult);
+ }{code}
> Introduce a ColumnValueFilter
> -----------------------------
>
> Key: HBASE-19950
> URL: https://issues.apache.org/jira/browse/HBASE-19950
> Project: HBase
> Issue Type: Improvement
> Components: Filters
> Reporter: Reid Chan
> Assignee: Reid Chan
> Priority: Minor
> Attachments: HBASE-19950.master.001.patch,
> HBASE-19950.master.002.patch, HBASE-19950.master.003.patch
>
>
> Different from {{SingleColumnValueFilter}} which returns an entire row when
> specified condition is matched, this new filter will return the matched cell
> only. There're already some discussions in HBASE-19824.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)