Uploaded image for project: 'Accumulo'
  1. Accumulo
  2. ACCUMULO-4468

accumulo.core.data.Key.equals(Key, PartialKey) improvement

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Trivial
    • Resolution: Resolved
    • 1.8.0
    • None
    • core
    • Patch

    Description

      In the Key.equals(Key, PartialKey) overload, the current method compares starting at the beginning of the key, and works its way toward the end. This functions correctly, of course, but one of the typical uses of this method is to compare adjacent rows to break them into larger chunks. For example, accumulo.core.iterators.Combiner repeatedly calls this method with subsequent pairs of keys.

      I have a patch which reverses the comparison order. That is, if the method is called with ROW_COLFAM_COLQUAL_COLVIS, it will compare visibility, cq, cf, and finally row. This (marginally) improves the speed of comparisons in the relatively common case where only the last part is changing, with less complex code.

      Attachments

        1. benchmark.tar.gz
          5 kB
          Will Murnane
        2. key_comparison.patch
          3 kB
          Will Murnane

        Activity

          People

            Unassigned Unassigned
            wmurnane Will Murnane
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: