You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by "Ivan Valchev (JIRA)" <ji...@apache.org> on 2010/11/18 13:50:13 UTC
[jira] Created: (HBASE-3245) client.Result uses inverted
Comparator in the versionMap (containted in familyMap)
client.Result uses inverted Comparator<Long> in the versionMap (containted in familyMap)
----------------------------------------------------------------------------------------
Key: HBASE-3245
URL: https://issues.apache.org/jira/browse/HBASE-3245
Project: HBase
Issue Type: Bug
Reporter: Ivan Valchev
Fix For: 0.89.20100924
In getMap() method the comparator passed to versionMap does:
public int compare(Long l1, Long l2) {
return l2.compareTo(l1);
}
which inverts the result of the comparison.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Resolved: (HBASE-3245) client.Result uses inverted
Comparator in the versionMap (containted in familyMap)
Posted by "Jonathan Gray (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HBASE-3245?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jonathan Gray resolved HBASE-3245.
----------------------------------
Resolution: Not A Problem
Hi Ivan.
This is actually the correct behavior. In HBase, we sort rows and columns in ascending, lexicographical order. However, versions are sorted in descending order (most recent version appears first).
If I'm somehow not understanding the issue, please do re-open the JIRA and provide more explanation. Thanks!
> client.Result uses inverted Comparator<Long> in the versionMap (containted in familyMap)
> ----------------------------------------------------------------------------------------
>
> Key: HBASE-3245
> URL: https://issues.apache.org/jira/browse/HBASE-3245
> Project: HBase
> Issue Type: Bug
> Reporter: Ivan Valchev
> Fix For: 0.89.20100924
>
>
> In getMap() method the comparator passed to versionMap does:
> public int compare(Long l1, Long l2) {
> return l2.compareTo(l1);
> }
> which inverts the result of the comparison.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (HBASE-3245) client.Result uses inverted
Comparator in the versionMap (containted in familyMap)
Posted by "Ivan Valchev (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HBASE-3245?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12933734#action_12933734 ]
Ivan Valchev commented on HBASE-3245:
-------------------------------------
Hi Jonathan,
So I guess this:
getMap().get(family).get(qualifier).lowerKey(HConstants.LATEST_TIMESTAMP) == null
being always true is the correct behavior. I know versions are sorted in descending order but navigating through the versionMap is some how counterintuitive
> client.Result uses inverted Comparator<Long> in the versionMap (containted in familyMap)
> ----------------------------------------------------------------------------------------
>
> Key: HBASE-3245
> URL: https://issues.apache.org/jira/browse/HBASE-3245
> Project: HBase
> Issue Type: Bug
> Reporter: Ivan Valchev
> Fix For: 0.89.20100924
>
>
> In getMap() method the comparator passed to versionMap does:
> public int compare(Long l1, Long l2) {
> return l2.compareTo(l1);
> }
> which inverts the result of the comparison.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (HBASE-3245) client.Result uses inverted
Comparator in the versionMap (containted in familyMap)
Posted by "ryan rawson (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HBASE-3245?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12933737#action_12933737 ]
ryan rawson commented on HBASE-3245:
------------------------------------
Have a look at the raw interface for more options.
> client.Result uses inverted Comparator<Long> in the versionMap (containted in familyMap)
> ----------------------------------------------------------------------------------------
>
> Key: HBASE-3245
> URL: https://issues.apache.org/jira/browse/HBASE-3245
> Project: HBase
> Issue Type: Bug
> Reporter: Ivan Valchev
> Fix For: 0.89.20100924
>
>
> In getMap() method the comparator passed to versionMap does:
> public int compare(Long l1, Long l2) {
> return l2.compareTo(l1);
> }
> which inverts the result of the comparison.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.