Pārlūkot izejas kodu

HADOOP-9737. JarFinder#getJar should delete the jar file upon destruction of the JVM (jbonofre via rkanter)

(cherry picked from commit 315074bb08e0f2c9508834ada62f1533ffd82a26)
Robert Kanter 10 gadi atpakaļ
vecāks
revīzija
015b30c3ab

+ 3 - 0
hadoop-common-project/hadoop-common/CHANGES.txt

@@ -467,6 +467,9 @@ Release 2.7.0 - 2015-04-20
     HADOOP-11801. Update BUILDING.txt for Ubuntu. (Gabor Liptak via
     Arpit Agarwal)
 
+    HADOOP-9737. JarFinder#getJar should delete the jar file upon destruction
+    of the JVM (jbonofre via rkanter)
+
   OPTIMIZATIONS
 
     HADOOP-11323. WritableComparator#compare keeps reference to byte array.

+ 1 - 0
hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/util/JarFinder.java

@@ -160,6 +160,7 @@ public class JarFinder {
             File tempJar = File.createTempFile("hadoop-", "", testDir);
             tempJar = new File(tempJar.getAbsolutePath() + ".jar");
             createJar(baseDir, tempJar);
+            tempJar.deleteOnExit();
             return tempJar.getAbsolutePath();
           }
         }