hadoop-hdfs-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1131331 - in /hadoop/hdfs/trunk: ./ src/java/org/apache/hadoop/hdfs/server/datanode/
Date Sat, 04 Jun 2011 06:55:23 GMT
Author: mattf
Date: Sat Jun  4 06:55:23 2011
New Revision: 1131331

URL: http://svn.apache.org/viewvc?rev=1131331&view=rev
Log:
HDFS-2019. Fix all the places where Java method File.list is used with FileUtil.list API.
 Contributed by Bharath Mundlapudi.

Modified:
    hadoop/hdfs/trunk/CHANGES.txt
    hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/server/datanode/BlockPoolSliceStorage.java
    hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/server/datanode/DataStorage.java
    hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/server/datanode/FSDataset.java

Modified: hadoop/hdfs/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/hdfs/trunk/CHANGES.txt?rev=1131331&r1=1131330&r2=1131331&view=diff
==============================================================================
--- hadoop/hdfs/trunk/CHANGES.txt (original)
+++ hadoop/hdfs/trunk/CHANGES.txt Sat Jun  4 06:55:23 2011
@@ -287,6 +287,9 @@ Trunk (unreleased changes)
 
   IMPROVEMENTS
 
+    HDFS-2019. Fix all the places where Java method File.list is used with
+    FileUtil.list API (Bharath Mundlapudi via mattf)
+
     HDFS-1934. Fix NullPointerException when certain File APIs return null
     (Bharath Mundlapudi via mattf)
 

Modified: hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/server/datanode/BlockPoolSliceStorage.java
URL: http://svn.apache.org/viewvc/hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/server/datanode/BlockPoolSliceStorage.java?rev=1131331&r1=1131330&r2=1131331&view=diff
==============================================================================
--- hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/server/datanode/BlockPoolSliceStorage.java
(original)
+++ hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/server/datanode/BlockPoolSliceStorage.java
Sat Jun  4 06:55:23 2011
@@ -28,6 +28,7 @@ import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
 import org.apache.hadoop.classification.InterfaceAudience;
+import org.apache.hadoop.fs.FileUtil;
 import org.apache.hadoop.fs.HardLink;
 import org.apache.hadoop.hdfs.protocol.FSConstants;
 import org.apache.hadoop.hdfs.protocol.LayoutVersion;
@@ -351,7 +352,7 @@ public class BlockPoolSliceStorage exten
     if (!LayoutVersion.supports(Feature.APPEND_RBW_DIR, layoutVersion)
         && detachDir.exists() && detachDir.isDirectory()) {
 
-      if (detachDir.list().length != 0) {
+      if (FileUtil.list(detachDir).length != 0) {
         throw new IOException("Detached directory " + detachDir
             + " is not empty. Please manually move each file under this "
             + "directory to the finalized directory if the finalized "

Modified: hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/server/datanode/DataStorage.java
URL: http://svn.apache.org/viewvc/hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/server/datanode/DataStorage.java?rev=1131331&r1=1131330&r2=1131331&view=diff
==============================================================================
--- hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/server/datanode/DataStorage.java (original)
+++ hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/server/datanode/DataStorage.java Sat
Jun  4 06:55:23 2011
@@ -39,6 +39,7 @@ import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.LocalFileSystem;
 import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.fs.HardLink;
+import org.apache.hadoop.fs.FileUtil;
 import org.apache.hadoop.fs.permission.FsPermission;
 import org.apache.hadoop.hdfs.DFSConfigKeys;
 import org.apache.hadoop.hdfs.HdfsConfiguration;
@@ -505,7 +506,7 @@ public class DataStorage extends Storage
     if (!LayoutVersion.supports(Feature.APPEND_RBW_DIR, layoutVersion) &&
         detachDir.exists() && detachDir.isDirectory() ) {
       
-        if (detachDir.list().length != 0 ) {
+        if (FileUtil.list(detachDir).length != 0 ) {
           throw new IOException("Detached directory " + detachDir +
               " is not empty. Please manually move each file under this " +
               "directory to the finalized directory if the finalized " +

Modified: hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/server/datanode/FSDataset.java
URL: http://svn.apache.org/viewvc/hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/server/datanode/FSDataset.java?rev=1131331&r1=1131330&r2=1131331&view=diff
==============================================================================
--- hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/server/datanode/FSDataset.java (original)
+++ hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/server/datanode/FSDataset.java Sat Jun
 4 06:55:23 2011
@@ -724,10 +724,10 @@ public class FSDataset implements FSCons
       File finalizedDir = new File(bpCurrentDir,
           DataStorage.STORAGE_DIR_FINALIZED);
       File rbwDir = new File(bpCurrentDir, DataStorage.STORAGE_DIR_RBW);
-      if (finalizedDir.exists() && finalizedDir.list().length != 0) {
+      if (finalizedDir.exists() && FileUtil.list(finalizedDir).length != 0) {
         return false;
       }
-      if (rbwDir.exists() && rbwDir.list().length != 0) {
+      if (rbwDir.exists() && FileUtil.list(rbwDir).length != 0) {
         return false;
       }
       return true;



Mime
View raw message