hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From omal...@apache.org
Subject svn commit: r1077566 - 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:48 GMT
Author: omalley
Date: Fri Mar  4 04:29:47 2011
New Revision: 1077566

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

    MAPREDUCE-1538. Add a limit on the number of artifacts in the DistributedCache to ensure
we cleanup aggressively. Contributed by Dick King.
    
    +++ b/YAHOO-CHANGES.txt
    +    MAPREDUCE-1538. Add a limit on the number of artifacts in the
    +    DistributedCache to ensure we cleanup aggressively. (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=1077566&r1=1077565&r2=1077566&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:47 2011
@@ -276,21 +276,10 @@ public class TrackerDistributedCacheMana
     // do the deletion, after releasing the global lock
     for (CacheStatus lcacheStatus : deleteList) {
       synchronized (lcacheStatus) {
-        FileSystem localFS = FileSystem.getLocal(conf);
-
-        Path potentialDeletee = lcacheStatus.localizedLoadPath;
-
-        localFS.delete(potentialDeletee, true);
+        FileSystem.getLocal(conf).delete(lcacheStatus.localizedLoadPath, true);
 
         // Update the maps baseDirSize and baseDirNumberSubDir
-        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());
-        }
+        LOG.info("Deleted path " + lcacheStatus.localizedLoadPath);
 
         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=1077566&r1=1077565&r2=1077566&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:47 2011
@@ -66,6 +66,7 @@ public class TestTrackerDistributedCache
   private static final int TEST_FILE_SIZE = 4 * 1024; // 4K
   private static final int LOCAL_CACHE_LIMIT = 5 * 1024; //5K
   private static final int LOCAL_CACHE_SUBDIR_LIMIT = 2;
+  private static final int LOCAL_CACHE_SUBDIR = 2;
   protected Configuration conf;
   protected Path firstCacheFile;
   protected Path secondCacheFile;
@@ -491,7 +492,7 @@ public class TestTrackerDistributedCache
     conf2.set("user.name", userName);
 
     // We first test the size limit
-    Path firstLocalCache = manager.getLocalCache(firstCacheFile.toUri(), conf2, 
+    Path localCache = manager.getLocalCache(firstCacheFile.toUri(), conf2, 
         TaskTracker.getPrivateDistributedCacheDir(userName),
         fs.getFileStatus(firstCacheFile), false,
         now, new Path(TEST_ROOT_DIR), false, false);
@@ -535,7 +536,6 @@ public class TestTrackerDistributedCache
            + "because they collectively exceeded the size limit.",
        localfs.listStatus(cachesBase).length > 1);
     
-    
     // Now we test the number of sub directories limit
     // Create the temporary cache files to be used in the tests.
     Path thirdCacheFile = new Path(TEST_ROOT_DIR, "thirdcachefile");



Mime
View raw message