hadoop-common-commits mailing list archives

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

URL: http://svn.apache.org/viewvc?rev=1077708&view=rev
Log:
commit 6650ead8bd3b08ab1ce0046203733cda5104a69b
Author: Owen O'Malley <omalley@apache.org>
Date:   Mon Sep 20 00:23:55 2010 -0700

    fix array out of bounds exception by ignoring non-archives when updating
    the sizes

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

Modified: hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/filecache/TaskDistributedCacheManager.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/filecache/TaskDistributedCacheManager.java?rev=1077708&r1=1077707&r2=1077708&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/filecache/TaskDistributedCacheManager.java
(original)
+++ hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/filecache/TaskDistributedCacheManager.java
Fri Mar  4 04:46:47 2011
@@ -246,28 +246,6 @@ public class TaskDistributedCacheManager
     return classPaths;
   }
   
-  private List<String> formClasspath(Path[] paths, URI[] uris, 
-                                     Path[] localizedFiles) {
-    if (uris == null) {
-      return new ArrayList<String>();
-    }
-    Map<String, Path> clMap = new HashMap<String, Path>();
-    List<String> classPaths = new ArrayList<String>();
-    if (paths != null) {
-      for (Path p : paths) {
-        clMap.put(p.toUri().getPath().toString(), p);
-      }
-    }
-    for (int i = 0; i < uris.length; ++i) {
-      URI u = uris[i];
-      boolean isClassPath = (null != clMap.get(u.getPath()));
-      if (isClassPath) {
-        classPaths.add(localizedFiles[i].toString());
-      }
-    }
-    return classPaths;
-  }
-
   /**
    * Releases the cached files/archives, so that space
    * can be reclaimed by the {@link TrackerDistributedCacheManager}.
@@ -283,7 +261,8 @@ public class TaskDistributedCacheManager
   public void setSizes(long[] sizes) throws IOException {
     int i = 0;
     for (CacheFile c: cacheFiles) {
-      if (!c.isPublic && c.status != null) {
+      if (!c.isPublic && c.type == CacheFile.FileType.ARCHIVE && 
+    	  c.status != null) {
         distributedCacheManager.setSize(c.status, sizes[i++]);
       }
     }

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=1077708&r1=1077707&r2=1077708&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:46:47 2011
@@ -175,7 +175,6 @@ public class TrackerDistributedCacheMana
       }
     }
     
-    boolean initSuccessful = false;
     try {
       // do the localization, after releasing the global lock
       synchronized (lcacheStatus) {
@@ -216,7 +215,6 @@ public class TrackerDistributedCacheMana
         // try some cache deletions
         compactCache(conf);
       }
-      initSuccessful = true;
     } catch (IOException ie) {
       synchronized (lcacheStatus) {
         // release this cache



Mime
View raw message