hadoop-mapreduce-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cdoug...@apache.org
Subject svn commit: r1127360 - in /hadoop/mapreduce/branches/MR-279: ./ yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/ yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/...
Date Wed, 25 May 2011 02:20:55 GMT
Author: cdouglas
Date: Wed May 25 02:20:54 2011
New Revision: 1127360

URL: http://svn.apache.org/viewvc?rev=1127360&view=rev
Log:
Add public cache.

Modified:
    hadoop/mapreduce/branches/MR-279/CHANGES.txt
    hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/AuxServices.java
    hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/container/ContainerResourceFailedEvent.java
    hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/localizer/FSDownload.java
    hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/localizer/LocalResourceRequest.java
    hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/localizer/ResourceLocalizationService.java
    hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/localizer/TestResourceLocalizationService.java
    hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/CapacityScheduler.java

Modified: hadoop/mapreduce/branches/MR-279/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/CHANGES.txt?rev=1127360&r1=1127359&r2=1127360&view=diff
==============================================================================
--- hadoop/mapreduce/branches/MR-279/CHANGES.txt (original)
+++ hadoop/mapreduce/branches/MR-279/CHANGES.txt Wed May 25 02:20:54 2011
@@ -4,9 +4,11 @@ Trunk (unreleased changes)
 
   MAPREDUCE-279
 
+    Add public cache. (cdouglas)
+
     MAPREDUCE-2534. Fix CI breaking hard coded version in jobclient pom. 
     (Luke Lu via mahadev)
-   
+
     MAPREDUCE-2522. Security for JobHistory service. (Siddharth Seth via 
     mahadev)
 

Modified: hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/AuxServices.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/AuxServices.java?rev=1127360&r1=1127359&r2=1127360&view=diff
==============================================================================
--- hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/AuxServices.java
(original)
+++ hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/AuxServices.java
Wed May 25 02:20:54 2011
@@ -54,6 +54,8 @@ public class AuxServices extends Abstrac
 
   protected final synchronized void addService(String name,
       AuxiliaryService service) {
+    LOG.info("Adding auxiliary service " +
+        service.getName() + ", \"" + name + "\"");
     serviceMap.put(name, service);
   }
 

Modified: hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/container/ContainerResourceFailedEvent.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/container/ContainerResourceFailedEvent.java?rev=1127360&r1=1127359&r2=1127360&view=diff
==============================================================================
--- hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/container/ContainerResourceFailedEvent.java
(original)
+++ hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/container/ContainerResourceFailedEvent.java
Wed May 25 02:20:54 2011
@@ -5,15 +5,15 @@ import org.apache.hadoop.yarn.server.nod
 
 public class ContainerResourceFailedEvent extends ContainerResourceEvent {
 
-  private final Exception exception;
+  private final Throwable exception;
 
   public ContainerResourceFailedEvent(ContainerId container,
-      LocalResourceRequest rsrc, Exception cause) {
+      LocalResourceRequest rsrc, Throwable cause) {
     super(container, ContainerEventType.RESOURCE_FAILED, rsrc);
     this.exception = cause;
   }
 
-  public Exception getCause() {
+  public Throwable getCause() {
     return exception;
   }
 }

Modified: hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/localizer/FSDownload.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/localizer/FSDownload.java?rev=1127360&r1=1127359&r2=1127360&view=diff
==============================================================================
--- hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/localizer/FSDownload.java
(original)
+++ hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/localizer/FSDownload.java
Wed May 25 02:20:54 2011
@@ -108,7 +108,9 @@ public class FSDownload implements Calla
       localrsrc.renameTo(dst);
       break;
     }
-    return FileUtil.getDU(destDir);
+    return 0;
+    // TODO Should calculate here before returning
+    //return FileUtil.getDU(destDir);
   }
 
   @Override
@@ -134,10 +136,12 @@ public class FSDownload implements Calla
 
     Path dFinal = files.makeQualified(new Path(dst_work, sCopy.getName()));
     try {
-      Path dTmp = this.userUgi.doAs(new PrivilegedExceptionAction<Path>() {
-        public Path run() throws Exception {
-          return files.makeQualified(copy(sCopy, dst_work));
-        };
+      Path dTmp = null == userUgi
+        ? files.makeQualified(copy(sCopy, dst_work))
+        : userUgi.doAs(new PrivilegedExceptionAction<Path>() {
+            public Path run() throws Exception {
+              return files.makeQualified(copy(sCopy, dst_work));
+            };
       });
       unpack(new File(dTmp.toUri()), new File(dFinal.toUri()));
       files.rename(dst_work, dst, Rename.OVERWRITE);

Modified: hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/localizer/LocalResourceRequest.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/localizer/LocalResourceRequest.java?rev=1127360&r1=1127359&r2=1127360&view=diff
==============================================================================
--- hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/localizer/LocalResourceRequest.java
(original)
+++ hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/localizer/LocalResourceRequest.java
Wed May 25 02:20:54 2011
@@ -23,9 +23,12 @@ import java.net.URISyntaxException;
 import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.yarn.api.records.LocalResource;
 import org.apache.hadoop.yarn.api.records.LocalResourceType;
+import org.apache.hadoop.yarn.api.records.LocalResourceVisibility;
+import org.apache.hadoop.yarn.api.records.URL;
 import org.apache.hadoop.yarn.util.ConverterUtils;
 
-public class LocalResourceRequest implements Comparable<LocalResourceRequest> {
+public class LocalResourceRequest
+    implements LocalResource, Comparable<LocalResourceRequest> {
 
   private final Path loc;
   private final long timestamp;
@@ -83,15 +86,57 @@ public class LocalResourceRequest implem
     return loc;
   }
 
+  @Override
   public long getTimestamp() {
     return timestamp;
   }
 
+  @Override
   public LocalResourceType getType() {
     return type;
   }
 
   @Override
+  public URL getResource() {
+    return ConverterUtils.getYarnUrlFromPath(loc);
+  }
+
+  @Override
+  public long getSize() {
+    return -1L;
+  }
+
+  @Override
+  public LocalResourceVisibility getVisibility() {
+    throw new UnsupportedOperationException();
+  }
+
+  @Override
+  public void setResource(URL resource) {
+    throw new UnsupportedOperationException();
+  }
+
+  @Override
+  public void setSize(long size) {
+    throw new UnsupportedOperationException();
+  }
+
+  @Override
+  public void setTimestamp(long timestamp) {
+    throw new UnsupportedOperationException();
+  }
+
+  @Override
+  public void setType(LocalResourceType type) {
+    throw new UnsupportedOperationException();
+  }
+
+  @Override
+  public void setVisibility(LocalResourceVisibility visibility) {
+    throw new UnsupportedOperationException();
+  }
+
+  @Override
   public String toString() {
     StringBuilder sb = new StringBuilder();
     sb.append("{ ");

Modified: hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/localizer/ResourceLocalizationService.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/localizer/ResourceLocalizationService.java?rev=1127360&r1=1127359&r2=1127360&view=diff
==============================================================================
--- hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/localizer/ResourceLocalizationService.java
(original)
+++ hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/localizer/ResourceLocalizationService.java
Wed May 25 02:20:54 2011
@@ -18,6 +18,7 @@
 package org.apache.hadoop.yarn.server.nodemanager.containermanager.localizer;
 
 import java.io.DataOutputStream;
+import java.io.File;
 
 import java.net.URISyntaxException;
 
@@ -25,20 +26,31 @@ import java.util.EnumSet;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.Map;
+import java.util.Random;
+import java.util.concurrent.CancellationException;
+import java.util.concurrent.CompletionService;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.ExecutorCompletionService;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.Future;
 
+import org.apache.hadoop.fs.FileUtil;
 import org.apache.hadoop.security.Credentials;
 import org.apache.hadoop.security.token.Token;
 import org.apache.hadoop.security.token.TokenIdentifier;
 import org.apache.hadoop.yarn.api.records.LocalResource;
 import org.apache.hadoop.yarn.api.records.LocalResourceVisibility;
+import static org.apache.hadoop.fs.CreateFlag.CREATE;
+import static org.apache.hadoop.fs.CreateFlag.OVERWRITE;
+import static org.apache.hadoop.yarn.server.nodemanager.NMConfig.DEFAULT_MAX_PUBLIC_FETCH_THREADS;
 import static org.apache.hadoop.yarn.server.nodemanager.NMConfig.DEFAULT_NM_LOCALIZER_BIND_ADDRESS;
 import static org.apache.hadoop.yarn.server.nodemanager.NMConfig.DEFAULT_NM_LOCAL_DIR;
 import static org.apache.hadoop.yarn.server.nodemanager.NMConfig.DEFAULT_NM_LOG_DIR;
 import static org.apache.hadoop.yarn.server.nodemanager.NMConfig.NM_LOCALIZER_BIND_ADDRESS;
 import static org.apache.hadoop.yarn.server.nodemanager.NMConfig.NM_LOCAL_DIR;
 import static org.apache.hadoop.yarn.server.nodemanager.NMConfig.NM_LOG_DIR;
-import static org.apache.hadoop.fs.CreateFlag.CREATE;
-import static org.apache.hadoop.fs.CreateFlag.OVERWRITE;
+import static org.apache.hadoop.yarn.server.nodemanager.NMConfig.NM_MAX_PUBLIC_FETCH_THREADS;
 
 import java.io.IOException;
 import java.net.InetSocketAddress;
@@ -115,7 +127,7 @@ public class ResourceLocalizationService
   private RecordFactory recordFactory;
   private final LocalDirAllocator localDirsSelector;
 
-  //private final LocalResourcesTracker publicRsrc;
+  private final LocalResourcesTracker publicRsrc;
   private final ConcurrentMap<String,LocalResourcesTracker> privateRsrc =
     new ConcurrentHashMap<String,LocalResourcesTracker>();
   private final ConcurrentMap<String,LocalResourcesTracker> appRsrc =
@@ -128,6 +140,7 @@ public class ResourceLocalizationService
     this.dispatcher = dispatcher;
     this.delService = delService;
     this.localDirsSelector = new LocalDirAllocator(NMConfig.NM_LOCAL_DIR);
+    this.publicRsrc = new LocalResourcesTrackerImpl(dispatcher);
   }
 
   FileContext getLocalFileContext(Configuration conf) {
@@ -178,7 +191,7 @@ public class ResourceLocalizationService
     sysDirs = Collections.unmodifiableList(sysDirs);
     localizationServerAddress = NetUtils.createSocketAddr(
       conf.get(NM_LOCALIZER_BIND_ADDRESS, DEFAULT_NM_LOCALIZER_BIND_ADDRESS));
-    localizerTracker = new LocalizerTracker();
+    localizerTracker = new LocalizerTracker(conf);
     dispatcher.register(LocalizerEventType.class, localizerTracker);
     super.init(conf);
   }
@@ -254,8 +267,7 @@ public class ResourceLocalizationService
       switch (vis) {
       default:
       case PUBLIC:
-        // TODO
-        tracker = null;
+        tracker = publicRsrc;
         break;
       case PRIVATE:
         tracker = privateRsrc.get(c.getUser());
@@ -341,25 +353,28 @@ public class ResourceLocalizationService
 
   /**
    * Sub-component handling the spawning of {@link ContainerLocalizer}s
-   * 
    */
   class LocalizerTracker implements EventHandler<LocalizerEvent> {
 
-    private final Map<String,LocalizerRunner> localizerRunners;
+    private final PublicLocalizer publicLocalizer;
+    private final Map<String,LocalizerRunner> privLocalizers;
 
-    LocalizerTracker() {
-      this(new HashMap<String,LocalizerRunner>());
+    LocalizerTracker(Configuration conf) {
+      this(conf, new HashMap<String,LocalizerRunner>());
     }
 
-    LocalizerTracker(Map<String,LocalizerRunner> trackers) {
-      this.localizerRunners = trackers;
+    LocalizerTracker(Configuration conf,
+        Map<String,LocalizerRunner> privLocalizers) {
+      this.publicLocalizer = new PublicLocalizer(conf);
+      this.privLocalizers = privLocalizers;
+      publicLocalizer.start();
     }
 
     public LocalizerHeartbeatResponse processHeartbeat(LocalizerStatus status) {
       String locId = status.getLocalizerId();
-      synchronized (localizerRunners) {
-        LocalizerRunner localizerRunner = localizerRunners.get(locId);
-        if (null == localizerRunner) {
+      synchronized (privLocalizers) {
+        LocalizerRunner localizer = privLocalizers.get(locId);
+        if (null == localizer) {
           // TODO process resources anyway
           LOG.info("Unknown localizer with localizerId " + locId
               + " is sending heartbeat. Ordering it to DIE");
@@ -368,48 +383,139 @@ public class ResourceLocalizationService
           response.setLocalizerAction(LocalizerAction.DIE);
           return response;
         }
-        return localizerRunner.update(status.getResources());
+        return localizer.update(status.getResources());
       }
     }
 
     public void stop() {
-      for (LocalizerRunner localizer : localizerRunners.values()) {
+      for (LocalizerRunner localizer : privLocalizers.values()) {
         localizer.interrupt();
       }
+      publicLocalizer.interrupt();
     }
 
     @Override
     public void handle(LocalizerEvent event) {
-      synchronized (localizerRunners) {
-        String localizerId = event.getLocalizerId();
-        LocalizerRunner localizerRunner = localizerRunners.get(localizerId);
-        switch(event.getType()) {
-          case REQUEST_RESOURCE_LOCALIZATION:
-            // 0) find running localizer or start new thread
-            LocalizerResourceRequestEvent req =
-              (LocalizerResourceRequestEvent)event;
-            if (null == localizerRunner) {
-              LOG.info("Created localizerRunner for " + req.getLocalizerId());
-            localizerRunner =
-                new LocalizerRunner(req.getContext(), req.getLocalizerId());
-              localizerRunners.put(localizerId, localizerRunner);
-              localizerRunner.start();
+      String locId = event.getLocalizerId();
+      switch (event.getType()) {
+      case REQUEST_RESOURCE_LOCALIZATION:
+        // 0) find running localizer or start new thread
+        LocalizerResourceRequestEvent req =
+          (LocalizerResourceRequestEvent)event;
+        switch (req.getVisibility()) {
+        case PUBLIC:
+          publicLocalizer.addResource(req);
+          break;
+        case PRIVATE:
+        case APPLICATION:
+          synchronized (privLocalizers) {
+            LocalizerRunner localizer = privLocalizers.get(locId);
+            if (null == localizer) {
+              LOG.info("Created localizer for " + req.getLocalizerId());
+              localizer = new LocalizerRunner(req.getContext(),
+                  req.getLocalizerId());
+              privLocalizers.put(locId, localizer);
+              localizer.start();
             }
             // 1) propagate event
-            localizerRunner.addResource(req);
-            break;
-          case ABORT_LOCALIZATION:
-            // TODO: Who calls this?
-            // 0) find running localizer, interrupt and remove
-            if (null == localizerRunner) {
-              return; // ignore; already gone
+            localizer.addResource(req);
+          }
+          break;
+        }
+        break;
+      case ABORT_LOCALIZATION:
+        // 0) find running localizer, interrupt and remove
+        synchronized (privLocalizers) {
+          LocalizerRunner localizer = privLocalizers.get(locId);
+          if (null == localizer) {
+            return; // ignore; already gone
+          }
+          privLocalizers.remove(locId);
+          localizer.interrupt();
+        }
+        break;
+      }
+    }
+
+  }
+
+  class PublicLocalizer extends Thread {
+
+    static final String PUBCACHE_CTXT = "public.cache.dirs";
+
+    final FileContext lfs;
+    final Configuration conf;
+    final ExecutorService threadPool;
+    final LocalDirAllocator publicDirs;
+    final CompletionService<Path> queue;
+    final ConcurrentMap<Future<Path>,LocalizerResourceRequestEvent> pending;
+
+    PublicLocalizer(Configuration conf) {
+      this(conf, getLocalFileContext(conf),
+           Executors.newFixedThreadPool(conf.getInt(
+               NM_MAX_PUBLIC_FETCH_THREADS, DEFAULT_MAX_PUBLIC_FETCH_THREADS)),
+           new ConcurrentHashMap<Future<Path>,LocalizerResourceRequestEvent>());
+    }
+
+    PublicLocalizer(Configuration conf, FileContext lfs,
+        ExecutorService threadPool,
+        ConcurrentMap<Future<Path>,LocalizerResourceRequestEvent> pending) {
+      this.lfs = lfs;
+      this.conf = conf;
+      this.pending = pending;
+      String[] publicFilecache = new String[localDirs.size()];
+      for (int i = 0, n = localDirs.size(); i < n; ++i) {
+        publicFilecache[i] =
+          new Path(localDirs.get(i), ContainerLocalizer.FILECACHE).toString();
+      }
+      conf.setStrings(PUBCACHE_CTXT, publicFilecache);
+      this.publicDirs = new LocalDirAllocator(PUBCACHE_CTXT);
+      this.threadPool = threadPool;
+      this.queue = new ExecutorCompletionService<Path>(threadPool);
+    }
+
+    public void addResource(LocalizerResourceRequestEvent request) {
+      // TODO handle failures, cancellation, requests by other containers
+      LOG.info("Downloading public rsrc:" + request.getResource().getRequest());
+      pending.putIfAbsent(
+          queue.submit(new FSDownload(
+              lfs, null, conf, publicDirs, request.getResource().getRequest(),
+              new Random())),
+          request);
+    }
+
+    @Override
+    public void run() {
+      try {
+        // TODO shutdown, better error handling esp. DU
+        while (!Thread.currentThread().isInterrupted()) {
+          try {
+            Future<Path> completed = queue.take();
+            LocalizerResourceRequestEvent assoc = pending.get(completed);
+            try {
+              Path local = completed.get();
+              assoc.getResource().handle(
+                  new ResourceLocalizedEvent(assoc.getResource().getRequest(),
+                    local, FileUtil.getDU(new File(local.toUri()))));
+            } catch (ExecutionException e) {
+              LOG.info("Failed to download rsrc " + assoc.getResource());
+              dispatcher.getEventHandler().handle(
+                  new ContainerResourceFailedEvent(
+                    assoc.getContext().getContainerId(),
+                    assoc.getResource().getRequest(), e.getCause()));
+            } catch (CancellationException e) {
+              // ignore; shutting down
             }
-            localizerRunners.remove(localizerId);
-            localizerRunner.interrupt();
-            break;
+          } catch (InterruptedException e) {
+            return;
+          }
         }
+      } finally {
+        LOG.info("Public cache exiting");
+        threadPool.shutdownNow();
       }
     }
+
   }
 
   /**

Modified: hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/localizer/TestResourceLocalizationService.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/localizer/TestResourceLocalizationService.java?rev=1127360&r1=1127359&r2=1127360&view=diff
==============================================================================
--- hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/localizer/TestResourceLocalizationService.java
(original)
+++ hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/localizer/TestResourceLocalizationService.java
Wed May 25 02:20:54 2011
@@ -13,12 +13,10 @@ import org.apache.hadoop.yarn.server.nod
 import org.apache.hadoop.yarn.server.nodemanager.DeletionService;
 
 import org.junit.Test;
-import static org.junit.Assert.*;
 
 import static org.mockito.Mockito.*;
 
 import static org.apache.hadoop.yarn.server.nodemanager.NMConfig.NM_LOCAL_DIR;
-import static org.apache.hadoop.yarn.server.nodemanager.NMConfig.DEFAULT_NM_LOCAL_DIR;
 
 public class TestResourceLocalizationService {
 

Modified: hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/CapacityScheduler.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/CapacityScheduler.java?rev=1127360&r1=1127359&r2=1127360&view=diff
==============================================================================
--- hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/CapacityScheduler.java
(original)
+++ hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/CapacityScheduler.java
Wed May 25 02:20:54 2011
@@ -230,6 +230,10 @@ implements ResourceScheduler, CapacitySc
       conf.getQueues((parent == null) ? 
           queueName : (parent.getQueuePath()+"."+queueName));
     if (childQueueNames == null || childQueueNames.length == 0) {
+      if (null == parent) {
+        throw new IllegalStateException(
+            "Queue configuration missing child queue names for " + queueName);
+      }
       queue = new LeafQueue(this, queueName, parent, applicationComparator,
                             oldQueues.get(queueName));
     } else {



Mime
View raw message