hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From omal...@apache.org
Subject svn commit: r668832 - in /hadoop/core/trunk: CHANGES.txt src/core/org/apache/hadoop/io/IOUtils.java src/hdfs/org/apache/hadoop/dfs/FSNamesystem.java
Date Tue, 17 Jun 2008 21:21:34 GMT
Author: omalley
Date: Tue Jun 17 14:21:33 2008
New Revision: 668832

URL: http://svn.apache.org/viewvc?rev=668832&view=rev
Log:
HADOOP-3535. Fix documentation and name of IOUtils.close to
reflect that it should only be used in cleanup contexts.

Modified:
    hadoop/core/trunk/CHANGES.txt
    hadoop/core/trunk/src/core/org/apache/hadoop/io/IOUtils.java
    hadoop/core/trunk/src/hdfs/org/apache/hadoop/dfs/FSNamesystem.java

Modified: hadoop/core/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/CHANGES.txt?rev=668832&r1=668831&r2=668832&view=diff
==============================================================================
--- hadoop/core/trunk/CHANGES.txt (original)
+++ hadoop/core/trunk/CHANGES.txt Tue Jun 17 14:21:33 2008
@@ -304,6 +304,9 @@
     HADOOP-2762. Add forrest documentation for controls of memory limits on 
     hadoop daemons and Map-Reduce tasks. (Amareshwari Sriramadasu via ddas)
 
+    HADOOP-3535. Fix documentation and name of IOUtils.close to
+    reflect that it should only be used in cleanup contexts. (omalley)
+
   OPTIMIZATIONS
 
     HADOOP-3274. The default constructor of BytesWritable creates empty 

Modified: hadoop/core/trunk/src/core/org/apache/hadoop/io/IOUtils.java
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/core/org/apache/hadoop/io/IOUtils.java?rev=668832&r1=668831&r2=668832&view=diff
==============================================================================
--- hadoop/core/trunk/src/core/org/apache/hadoop/io/IOUtils.java (original)
+++ hadoop/core/trunk/src/core/org/apache/hadoop/io/IOUtils.java Tue Jun 17 14:21:33 2008
@@ -123,11 +123,12 @@
   }
   
   /**
-   * Close the Closeable objects.
-   * Log {@link IOException} if there is any. 
+   * Close the Closeable objects and <b>ignore</b> any {@link IOException} or

+   * null pointers. Must only be used for cleanup in exception handlers.
+   * @param log the log to record problems to at debug level. Can be null.
    * @param closeables the objects to close
    */
-  public static void close(Log log, java.io.Closeable... closeables) {
+  public static void cleanup(Log log, java.io.Closeable... closeables) {
     for(java.io.Closeable c : closeables) {
       if (c != null) {
         try {
@@ -142,11 +143,12 @@
   }
 
   /**
-   * Closes the stream ignoring {@link IOException} 
+   * Closes the stream ignoring {@link IOException}.
+   * Must only be called in cleaning up from exception handlers.
    * @param stream the Stream to close
    */
   public static void closeStream( java.io.Closeable stream ) {
-    close(null, stream);
+    cleanup(null, stream);
   }
   
   /**

Modified: hadoop/core/trunk/src/hdfs/org/apache/hadoop/dfs/FSNamesystem.java
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/hdfs/org/apache/hadoop/dfs/FSNamesystem.java?rev=668832&r1=668831&r2=668832&view=diff
==============================================================================
--- hadoop/core/trunk/src/hdfs/org/apache/hadoop/dfs/FSNamesystem.java (original)
+++ hadoop/core/trunk/src/hdfs/org/apache/hadoop/dfs/FSNamesystem.java Tue Jun 17 14:21:33
2008
@@ -463,7 +463,7 @@
         }
       } catch (InterruptedException ie) {
       } finally {
-        IOUtils.close(LOG, dir);
+        IOUtils.cleanup(LOG, dir);
       }
     }
   }



Mime
View raw message