Browse Source

HADOOP-161. Add hashCode() method to Block. Contributed by Milind.

git-svn-id: https://svn.apache.org/repos/asf/lucene/hadoop/trunk@407099 13f79535-47bb-0310-9956-ffa450edef68
Doug Cutting 19 years ago
parent
commit
e5b2d15294
2 changed files with 7 additions and 0 deletions
  1. 3 0
      CHANGES.txt
  2. 4 0
      src/java/org/apache/hadoop/dfs/Block.java

+ 3 - 0
CHANGES.txt

@@ -38,6 +38,9 @@ Trunk (unreleased)
  9. HADOOP-218. Avoid accessing configuration while looping through
     tasks in JobTracker.  (Mahadev Konar via cutting)
 
+10. HADOOP-161. Add hashCode() method to DFS's Block.
+    (Milind Bhandarkar via cutting)
+
 
 Release 0.2.1 - 2006-05-12
 

+ 4 - 0
src/java/org/apache/hadoop/dfs/Block.java

@@ -132,4 +132,8 @@ class Block implements Writable, Comparable {
         Block b = (Block) o;
         return (this.compareTo(b) == 0);
     }
+    
+    public int hashCode() {
+        return 37 * 17 + (int) (getBlockId()^(getBlockId()>>>32));
+    }
 }