hadoop-hdfs-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t...@apache.org
Subject svn commit: r1204651 - in /hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs: CHANGES.txt src/test/java/org/apache/hadoop/hdfs/DFSTestUtil.java
Date Mon, 21 Nov 2011 19:02:56 GMT
Author: todd
Date: Mon Nov 21 19:02:56 2011
New Revision: 1204651

URL: http://svn.apache.org/viewvc?rev=1204651&view=rev
Log:
HDFS-2575. DFSTestUtil may create empty files. Contributed by Todd Lipcon.

Modified:
    hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
    hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/DFSTestUtil.java

Modified: hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt?rev=1204651&r1=1204650&r2=1204651&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt (original)
+++ hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt Mon Nov
21 19:02:56 2011
@@ -48,6 +48,8 @@ Release 0.23.1 - UNRELEASED
 
     HDFS-2567. When 0 DNs are available, show a proper error when
     trying to browse DFS via web UI. (harsh via eli)
+
+    HDFS-2575. DFSTestUtil may create empty files (todd)
     
 Release 0.23.0 - 2011-11-01 
 

Modified: hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/DFSTestUtil.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/DFSTestUtil.java?rev=1204651&r1=1204650&r2=1204651&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/DFSTestUtil.java
(original)
+++ hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/DFSTestUtil.java
Mon Nov 21 19:02:56 2011
@@ -84,6 +84,7 @@ public class DFSTestUtil {
   
   private int maxLevels;// = 3;
   private int maxSize;// = 8*1024;
+  private int minSize = 1;
   private int nFiles;
   private MyFile[] files;
   
@@ -139,7 +140,7 @@ public class DFSTestUtil {
       long fidx = -1;
       while (fidx < 0) { fidx = gen.nextLong(); }
       name = name + Long.toString(fidx);
-      size = gen.nextInt(maxSize);
+      size = minSize + gen.nextInt(maxSize - minSize);
       seed = gen.nextLong();
     }
     



Mime
View raw message