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

Amit Kabra commented on HBASE-18361:
------------------------------------

[~ram_krish] - We take hbase backups daily and we restore some part of it in 
temp table and match it with original table to see if the backups went fine. 
Since we want to validate backups and want to check everything is backed up, we 
compare everything including values to see if the backups went fine. 

Also, if we see Result.compareResults function, we see it is doing object.equal 
on the cells and hence matching complete object including values. So, I thought 
of adding the value comparison in cellcomparator class as well.
if (!ourKVs[i].equals(replicatedKVs[i]) || !CellUtil.matchingValue(ourKVs[i], 
replicatedKVs[i]))



> CellComparator compare function should compare cell's value along with other 
> attributes
> ---------------------------------------------------------------------------------------
>
>                 Key: HBASE-18361
>                 URL: https://issues.apache.org/jira/browse/HBASE-18361
>             Project: HBase
>          Issue Type: Bug
>    Affects Versions: 1.3.1
>            Reporter: Amit Kabra
>            Assignee: Amit Kabra
>         Attachments: HBASE-18361.patch
>
>
> CellComparator.compare(Cell a, Cell b) should compare a and b's value as well.
> If we create two cells as 
>     byte [] row = Bytes.toBytes("row");
>     byte [] value = Bytes.toBytes("value");
>     byte [] value1 = Bytes.toBytes("value1");
>     Cell c1 = CellUtil.createCell(row, value);
>     Cell c2 = CellUtil.createCell(row, value1);
> And compare them using CellComparator.compare(c1, c2,true) , it returns 0 i.e 
> it matches them while they are different.CellComparator compares each 
> attribute of cell but value.



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

Reply via email to