You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@aurora.apache.org by ma...@apache.org on 2014/01/15 22:38:13 UTC

[50/50] [abbrv] git commit: Fixed code review feedback and added TODOs.

Fixed code review feedback and added TODOs.


Project: http://git-wip-us.apache.org/repos/asf/incubator-aurora/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-aurora/commit/47cfca00
Tree: http://git-wip-us.apache.org/repos/asf/incubator-aurora/tree/47cfca00
Diff: http://git-wip-us.apache.org/repos/asf/incubator-aurora/diff/47cfca00

Branch: refs/heads/mansu/AURORA-4187_scheduler_home_page-no-seed
Commit: 47cfca00778d9758af56f2c5fa2663405f9e8988
Parents: 82a4f93
Author: Suman Karumuri <sk...@twitter.com>
Authored: Tue Jan 14 22:59:49 2014 -0800
Committer: Suman Karumuri <sk...@twitter.com>
Committed: Tue Jan 14 22:59:49 2014 -0800

----------------------------------------------------------------------
 .../java/org/apache/aurora/scheduler/http/DisplayUtils.java | 1 -
 .../org/apache/aurora/scheduler/http/ServletModule.java     | 9 ++++-----
 .../org/apache/aurora/scheduler/http/UIRedirectFilter.java  | 3 ++-
 3 files changed, 6 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/47cfca00/src/main/java/org/apache/aurora/scheduler/http/DisplayUtils.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/http/DisplayUtils.java b/src/main/java/org/apache/aurora/scheduler/http/DisplayUtils.java
index 65676b9..6870fd8 100644
--- a/src/main/java/org/apache/aurora/scheduler/http/DisplayUtils.java
+++ b/src/main/java/org/apache/aurora/scheduler/http/DisplayUtils.java
@@ -17,7 +17,6 @@ package org.apache.aurora.scheduler.http;
 
 import com.google.common.base.Function;
 import com.google.common.collect.Ordering;
-
 import com.twitter.common.args.Arg;
 import com.twitter.common.args.CmdLine;
 

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/47cfca00/src/main/java/org/apache/aurora/scheduler/http/ServletModule.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/http/ServletModule.java b/src/main/java/org/apache/aurora/scheduler/http/ServletModule.java
index 5b0a0d6..60ce15c 100644
--- a/src/main/java/org/apache/aurora/scheduler/http/ServletModule.java
+++ b/src/main/java/org/apache/aurora/scheduler/http/ServletModule.java
@@ -31,7 +31,6 @@ import com.google.inject.servlet.GuiceFilter;
 import com.sun.jersey.api.container.filter.GZIPContentEncodingFilter;
 import com.sun.jersey.guice.JerseyServletModule;
 import com.sun.jersey.guice.spi.container.servlet.GuiceContainer;
-
 import com.twitter.common.application.http.Registration;
 import com.twitter.common.application.modules.LifecycleModule;
 import com.twitter.common.application.modules.LocalServiceRegistry;
@@ -82,6 +81,9 @@ public class ServletModule extends AbstractModule {
       @Override protected void configureServlets() {
         bind(HttpStatsFilter.class).in(Singleton.class);
         filter("/scheduler*").through(HttpStatsFilter.class);
+        // Servlets may assign a special meaning to trailing /, but this confuses AngularJS's
+        // resource loader. So, removing them for /scheduler* URLs using a UIRedirectFilter.
+        // TODO (skarumuri): Remove UIRedirectFilter when the /scheduler servlets are removed.
         bind(UIRedirectFilter.class).in(Singleton.class);
         filter("/scheduler*").through(UIRedirectFilter.class);
         bind(LeaderRedirectFilter.class).in(Singleton.class);
@@ -92,10 +94,7 @@ public class ServletModule extends AbstractModule {
         registerJerseyEndpoint("/offers", Offers.class);
         registerJerseyEndpoint("/pendingtasks", PendingTasks.class);
         registerJerseyEndpoint("/quotas", Quotas.class);
-        registerJerseyEndpoint(
-            "/scheduler/",
-            SchedulerzRole.class,
-            SchedulerzJob.class);
+        registerJerseyEndpoint("/scheduler/", SchedulerzRole.class, SchedulerzJob.class);
         registerJerseyEndpoint("/slaves", Slaves.class);
         registerJerseyEndpoint("/structdump", StructDump.class);
         registerJerseyEndpoint("/utilization", Utilization.class);

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/47cfca00/src/main/java/org/apache/aurora/scheduler/http/UIRedirectFilter.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/http/UIRedirectFilter.java b/src/main/java/org/apache/aurora/scheduler/http/UIRedirectFilter.java
index 194aa53..b35aad8 100644
--- a/src/main/java/org/apache/aurora/scheduler/http/UIRedirectFilter.java
+++ b/src/main/java/org/apache/aurora/scheduler/http/UIRedirectFilter.java
@@ -25,7 +25,8 @@ import javax.servlet.http.HttpServletResponse;
 import com.twitter.common.net.http.filters.AbstractHttpFilter;
 
 /**
- * A filter that maps string template servlet paths to UI client pages.
+ * A filter that maps string template servlet paths to UI client pages. This is needed because
+ * AngularJS's resource loader is confused when there is a trailing / at the end of URL's.
  */
 public class UIRedirectFilter extends AbstractHttpFilter {