[ 
https://issues.apache.org/jira/browse/HBASE-18617?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16130241#comment-16130241
 ] 

Chia-Ping Tsai commented on HBASE-18617:
----------------------------------------

{quote}
+      Pair<byte[], byte[]> p = new Pair<>();
+      // create a copy of pair bytes so that they are not modified by the 
filter
+      p.setFirst(Arrays.copyOf(aFuzzyKeysData.getFirst(), 
aFuzzyKeysData.getFirst().length));
+      p.setSecond(Arrays.copyOf(aFuzzyKeysData.getSecond(), 
aFuzzyKeysData.getSecond().length));
+
       if (p.getFirst().length != p.getSecond().length) {
         Pair<String, String> readable =
-            new Pair<>(Bytes.toStringBinary(p.getFirst()), 
Bytes.toStringBinary(p
{quote}
Consider coping the pair after the length check. If the check fails, it is a 
waste of time to copy input data.
HBASE-17890 covers this issue but it has not be reviewed.  It clone the input 
data in preprocessSearchKey/preprocessMask.


> FuzzyRowKeyFilter should not modify the filter pairs
> ----------------------------------------------------
>
>                 Key: HBASE-18617
>                 URL: https://issues.apache.org/jira/browse/HBASE-18617
>             Project: HBase
>          Issue Type: Bug
>    Affects Versions: 1.1.2
>            Reporter: vinisha
>            Priority: Minor
>         Attachments: FuzzyRowFilter_HBASE_18617.patch
>
>
> Current implementation of FuzzyRowKeyFilter modifies the provided filter 
> pairs: 
> https://github.com/apache/hbase/blob/master/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FuzzyRowFilter.java#L89-L90
> Filter should not change the filter pair. 



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to