Quellcode durchsuchen

HADOOP-3467. Improve documentation for FileSystem::deleteOnExit.
Contributed by Tsz Wo (Nicholas), SZE.



git-svn-id: https://svn.apache.org/repos/asf/hadoop/core/trunk@666514 13f79535-47bb-0310-9956-ffa450edef68

Christopher Douglas vor 17 Jahren
Ursprung
Commit
886099d8f5
2 geänderte Dateien mit 15 neuen und 5 gelöschten Zeilen
  1. 3 0
      CHANGES.txt
  2. 12 5
      src/core/org/apache/hadoop/fs/FileSystem.java

+ 3 - 0
CHANGES.txt

@@ -287,6 +287,9 @@ Release 0.18.0 - Unreleased
     HADOOP-3492. Add forrest documentation for user archives.
     (Mahadev Konar via hairong)
 
+    HADOOP-3467. Improve documentation for FileSystem::deleteOnExit.
+    (Tsz Wo (Nicholas), SZE via cdouglas)
+
   OPTIMIZATIONS
 
     HADOOP-3274. The default constructor of BytesWritable creates empty 

+ 12 - 5
src/core/org/apache/hadoop/fs/FileSystem.java

@@ -613,9 +613,15 @@ public abstract class FileSystem extends Configured implements Closeable {
    */
   public abstract boolean delete(Path f, boolean recursive) throws IOException;
 
-  /** Mark a path to be deleted when FileSystem is closed or JVM exits.
-   *  The path has to exist in the file system.
+  /**
+   * Mark a path to be deleted when FileSystem is closed.
+   * When the JVM shuts down,
+   * all FileSystem objects will be closed automatically.
+   * Then,
+   * the marked path will be deleted as a result of closing the FileSystem.
    *
+   * The path has to exist in the file system.
+   * 
    * @param f the path to delete.
    * @return  true if deleteOnExit is successful, otherwise false.
    * @throws IOException
@@ -630,9 +636,10 @@ public abstract class FileSystem extends Configured implements Closeable {
     return true;
   }
 
-  // Delete all files that were marked as delete-on-exit. This recursively
-  // deletes all files in the specified paths.
-  //
+  /**
+   * Delete all files that were marked as delete-on-exit. This recursively
+   * deletes all files in the specified paths.
+   */
   protected void processDeleteOnExit() {
     synchronized (deleteOnExit) {
       for (Iterator<Path> iter = deleteOnExit.iterator(); iter.hasNext();) {