فهرست منبع

Fix for HADOOP-66. Delete dfs temp files on JVM exit.

git-svn-id: https://svn.apache.org/repos/asf/lucene/hadoop/trunk@386220 13f79535-47bb-0310-9956-ffa450edef68
Doug Cutting 19 سال پیش
والد
کامیت
00cea5a675
1فایلهای تغییر یافته به همراه5 افزوده شده و 3 حذف شده
  1. 5 3
      src/java/org/apache/hadoop/dfs/DFSClient.java

+ 5 - 3
src/java/org/apache/hadoop/dfs/DFSClient.java

@@ -557,9 +557,11 @@ class DFSClient implements FSConstants {
         }
 
         private File newBackupFile() throws IOException {
-          return conf.getFile("dfs.data.dir",
-                              "tmp"+File.separator+
-                              "client-"+Math.abs(r.nextLong()));
+          File result = conf.getFile("dfs.data.dir",
+                                     "tmp"+File.separator+
+                                     "client-"+Math.abs(r.nextLong()));
+          result.deleteOnExit();
+          return result;
         }
 
         /**