Uploaded image for project: 'Hadoop Common'
  1. Hadoop Common
  2. HADOOP-5255

Fix for HADOOP-5079 HashFunction inadvertently destroys some randomness

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 0.20.0, 0.21.0
    • Fix Version/s: 0.20.0
    • Component/s: io
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      HADOOP-5079 did this "HashFunction.hash restricts initval for the next hash to the [0, maxValue) range of the hash indexes returned. This is suboptimal, particularly for larger nbHash and smaller maxValue. Rather we should first set initval, then restrict the range for the result assignment." The patch committed on that issue introduced a new bug: "My first patch contained a regression: you have to take the remainder before calling Math.abs, since Math.abs(Integer.MIN_VALUE) == Integer.MIN_VALUE still" (Jonathan Ellis).

        Attachments

          Activity

            People

            • Assignee:
              jbellis Jonathan Ellis
              Reporter:
              stack stack
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: