hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From omal...@apache.org
Subject svn commit: r1077567 - in /hadoop/common/branches/branch-0.20-security-patches/src: mapred/org/apache/hadoop/filecache/TrackerDistributedCacheManager.java test/org/apache/hadoop/filecache/TestTrackerDistributedCacheManager.java
Date Fri, 04 Mar 2011 04:29:53 GMT
Author: omalley
Date: Fri Mar  4 04:29:53 2011
New Revision: 1077567

URL: http://svn.apache.org/viewvc?rev=1077567&view=rev
Log:
commit a82eac90ab2d252f1a4b7b1266f6531085838e81
Author: Arun C Murthy <acmurthy@apache.org>
Date:   Fri Jul 2 16:49:11 2010 -0700

    MAPREDUCE-1914. Ensure unique sub-directories for artifacts in the DistributedCache are
cleaned up. Dick King.
    
    +++ b/YAHOO-CHANGES.txt
    +    MAPREDUCE-1914. Ensure unique sub-directories for artifacts in the
    +    DistributedCache are cleaned up. (Dick King via acmurthy)
    +

Modified:
    hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/filecache/TrackerDistributedCacheManager.java
    hadoop/common/branches/branch-0.20-security-patches/src/test/org/apache/hadoop/filecache/TestTrackerDistributedCacheManager.java

Modified: hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/filecache/TrackerDistributedCacheManager.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/filecache/TrackerDistributedCacheManager.java?rev=1077567&r1=1077566&r2=1077567&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/filecache/TrackerDistributedCacheManager.java
(original)
+++ hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/filecache/TrackerDistributedCacheManager.java
Fri Mar  4 04:29:53 2011
@@ -276,10 +276,21 @@ public class TrackerDistributedCacheMana
     // do the deletion, after releasing the global lock
     for (CacheStatus lcacheStatus : deleteList) {
       synchronized (lcacheStatus) {
-        FileSystem.getLocal(conf).delete(lcacheStatus.localizedLoadPath, true);
+        FileSystem localFS = FileSystem.getLocal(conf);
+
+        Path potentialDeletee = lcacheStatus.localizedLoadPath;
+
+        localFS.delete(potentialDeletee, true);
 
         // Update the maps baseDirSize and baseDirNumberSubDir
-        LOG.info("Deleted path " + lcacheStatus.localizedLoadPath);
+        LOG.info("Deleted path " + potentialDeletee);
+
+        try {
+          localFS.delete(lcacheStatus.getLocalizedUniqueDir(), true);
+        } catch (IOException e) {
+          LOG.warn("Could not delete distributed cache empty directory "
+                   + lcacheStatus.getLocalizedUniqueDir());
+        }
 
         deleteCacheInfoUpdate(lcacheStatus);
       }

Modified: hadoop/common/branches/branch-0.20-security-patches/src/test/org/apache/hadoop/filecache/TestTrackerDistributedCacheManager.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20-security-patches/src/test/org/apache/hadoop/filecache/TestTrackerDistributedCacheManager.java?rev=1077567&r1=1077566&r2=1077567&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.20-security-patches/src/test/org/apache/hadoop/filecache/TestTrackerDistributedCacheManager.java
(original)
+++ hadoop/common/branches/branch-0.20-security-patches/src/test/org/apache/hadoop/filecache/TestTrackerDistributedCacheManager.java
Fri Mar  4 04:29:53 2011
@@ -492,7 +492,7 @@ public class TestTrackerDistributedCache
     conf2.set("user.name", userName);
 
     // We first test the size limit
-    Path localCache = manager.getLocalCache(firstCacheFile.toUri(), conf2, 
+    Path firstLocalCache = manager.getLocalCache(firstCacheFile.toUri(), conf2, 
         TaskTracker.getPrivateDistributedCacheDir(userName),
         fs.getFileStatus(firstCacheFile), false,
         now, new Path(TEST_ROOT_DIR), false, false);



Mime
View raw message