hadoop-hdfs-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tomwh...@apache.org
Subject svn commit: r812080 - in /hadoop/hdfs/trunk: CHANGES.txt src/java/org/apache/hadoop/hdfs/protocol/Block.java src/java/org/apache/hadoop/hdfs/server/common/GenerationStamp.java src/java/org/apache/hadoop/hdfs/server/datanode/DirectoryScanner.java
Date Mon, 07 Sep 2009 11:10:54 GMT
Author: tomwhite
Date: Mon Sep  7 11:10:54 2009
New Revision: 812080

URL: http://svn.apache.org/viewvc?rev=812080&view=rev
Log:
HDFS-288. Redundant computation in hashCode() implementation. Contributed by Tsz Wo (Nicholas),
SZE.

Modified:
    hadoop/hdfs/trunk/CHANGES.txt
    hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/protocol/Block.java
    hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/server/common/GenerationStamp.java
    hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/server/datanode/DirectoryScanner.java

Modified: hadoop/hdfs/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/hdfs/trunk/CHANGES.txt?rev=812080&r1=812079&r2=812080&view=diff
==============================================================================
--- hadoop/hdfs/trunk/CHANGES.txt (original)
+++ hadoop/hdfs/trunk/CHANGES.txt Mon Sep  7 11:10:54 2009
@@ -128,6 +128,9 @@
     HDFS-551. Create new functional test for a block report. (Konstantin
     Boudnik via hairong)
 
+    HDFS-288. Redundant computation in hashCode() implementation.
+    (szetszwo via tomwhite)
+
   BUG FIXES
 
     HDFS-76. Better error message to users when commands fail because of 

Modified: hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/protocol/Block.java
URL: http://svn.apache.org/viewvc/hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/protocol/Block.java?rev=812080&r1=812079&r2=812080&view=diff
==============================================================================
--- hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/protocol/Block.java (original)
+++ hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/protocol/Block.java Mon Sep  7 11:10:54
2009
@@ -207,6 +207,6 @@
   /** {@inheritDoc} */
   public int hashCode() {
     //GenerationStamp is IRRELEVANT and should not be used here
-    return 37 * 17 + (int) (blockId^(blockId>>>32));
+    return (int)(blockId^(blockId>>>32));
   }
 }

Modified: hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/server/common/GenerationStamp.java
URL: http://svn.apache.org/viewvc/hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/server/common/GenerationStamp.java?rev=812080&r1=812079&r2=812080&view=diff
==============================================================================
--- hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/server/common/GenerationStamp.java (original)
+++ hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/server/common/GenerationStamp.java Mon
Sep  7 11:10:54 2009
@@ -109,6 +109,6 @@
 
   /** {@inheritDoc} */
   public int hashCode() {
-    return 37 * 17 + (int) (genstamp^(genstamp>>>32));
+    return (int) (genstamp^(genstamp>>>32));
   }
 }

Modified: hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/server/datanode/DirectoryScanner.java
URL: http://svn.apache.org/viewvc/hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/server/datanode/DirectoryScanner.java?rev=812080&r1=812079&r2=812080&view=diff
==============================================================================
--- hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/server/datanode/DirectoryScanner.java
(original)
+++ hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/server/datanode/DirectoryScanner.java
Mon Sep  7 11:10:54 2009
@@ -113,7 +113,7 @@
 
     @Override // Object
     public int hashCode() {
-      return 37 * 17 + (int) (blockId^(blockId>>>32));
+      return (int)(blockId^(blockId>>>32));
     }
 
     public long getGenStamp() {



Mime
View raw message