hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e..@apache.org
Subject svn commit: r1204116 - in /hadoop/common/branches/branch-0.20-security: CHANGES.txt src/hdfs/org/apache/hadoop/hdfs/server/datanode/DataBlockScanner.java
Date Sun, 20 Nov 2011 02:56:43 GMT
Author: eli
Date: Sun Nov 20 02:56:43 2011
New Revision: 1204116

URL: http://svn.apache.org/viewvc?rev=1204116&view=rev
Log:
HDFS-2541. For a sufficiently large value of blocks, the DN Scanner may request a random number
with a negative seed value. Contributed by Harsh J

Modified:
    hadoop/common/branches/branch-0.20-security/CHANGES.txt
    hadoop/common/branches/branch-0.20-security/src/hdfs/org/apache/hadoop/hdfs/server/datanode/DataBlockScanner.java

Modified: hadoop/common/branches/branch-0.20-security/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20-security/CHANGES.txt?rev=1204116&r1=1204115&r2=1204116&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.20-security/CHANGES.txt (original)
+++ hadoop/common/branches/branch-0.20-security/CHANGES.txt Sun Nov 20 02:56:43 2011
@@ -40,6 +40,9 @@ Release 0.20.206.0 - unreleased
     
     HADOOP-7297. Remove docs for CN and BN, as they aren't present. (harsh)
 
+    HDFS-2541. For a sufficiently large value of blocks, the DN Scanner 
+    may request a random number with a negative seed value. (harsh via eli)
+
   IMPROVEMENTS
 
     MAPREDUCE-2836. Provide option to fail jobs when submitted to

Modified: hadoop/common/branches/branch-0.20-security/src/hdfs/org/apache/hadoop/hdfs/server/datanode/DataBlockScanner.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20-security/src/hdfs/org/apache/hadoop/hdfs/server/datanode/DataBlockScanner.java?rev=1204116&r1=1204115&r2=1204116&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.20-security/src/hdfs/org/apache/hadoop/hdfs/server/datanode/DataBlockScanner.java
(original)
+++ hadoop/common/branches/branch-0.20-security/src/hdfs/org/apache/hadoop/hdfs/server/datanode/DataBlockScanner.java
Sun Nov 20 02:56:43 2011
@@ -248,8 +248,9 @@ class DataBlockScanner implements Runnab
      */
     long period = Math.min(scanPeriod, 
                            Math.max(blockMap.size(),1) * 600 * 1000L);
+    int periodInt = Math.abs((int)period);
     return System.currentTimeMillis() - scanPeriod + 
-           random.nextInt((int)period);    
+           random.nextInt(periodInt);    
   }
 
   /** Adds block to list of blocks */



Mime
View raw message