HBase
  1. HBase
  2. HBASE-3245

client.Result uses inverted Comparator<Long> in the versionMap (containted in familyMap)

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Not a Problem
    • Affects Version/s: None
    • Fix Version/s: 0.89.20100924
    • Component/s: None
    • Labels:
      None

      Description

      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.

        Activity

        Hide
        Jonathan Gray added a comment -

        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!

        Show
        Jonathan Gray added a comment - 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!
        Hide
        Ivan Valchev added a comment -

        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

        Show
        Ivan Valchev added a comment - 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
        Hide
        ryan rawson added a comment -

        Have a look at the raw interface for more options.

        Show
        ryan rawson added a comment - Have a look at the raw interface for more options.

          People

          • Assignee:
            Unassigned
            Reporter:
            Ivan Valchev
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development