aurora-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject [37/50] [abbrv] git commit: Added statsURL to serverInfo.
Date Sat, 05 Apr 2014 00:05:23 GMT
Added statsURL to serverInfo.


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

Branch: refs/heads/mansu/job_page
Commit: e3aacdd203fce67acbb7f98b11a6b4449c12dcd0
Parents: 7045f69
Author: Suman Karumuri <skarumuri@twitter.com>
Authored: Mon Mar 31 12:50:15 2014 -0700
Committer: Suman Karumuri <skarumuri@twitter.com>
Committed: Mon Mar 31 13:41:14 2014 -0700

----------------------------------------------------------------------
 build.gradle                                    |  1 +
 .../apache/aurora/scheduler/app/AppModule.java  | 12 ++++++--
 .../aurora/scheduler/app/SchedulerMain.java     | 31 +++++++++++++++-----
 .../aurora/scheduler/http/ui/js/directives.js   |  6 ++--
 .../thrift/org/apache/aurora/gen/api.thrift     |  1 +
 .../aurora/scheduler/app/SchedulerIT.java       |  4 ++-
 .../thrift/SchedulerThriftInterfaceTest.java    |  7 +++--
 .../thrift/aop/ServerInfoInterceptorTest.java   | 13 ++++----
 .../org/apache/aurora/gen/api.thrift.md5        |  2 +-
 9 files changed, 55 insertions(+), 22 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/e3aacdd2/build.gradle
----------------------------------------------------------------------
diff --git a/build.gradle b/build.gradle
index c2a70b0..659f2eb 100644
--- a/build.gradle
+++ b/build.gradle
@@ -338,6 +338,7 @@ run {
     '-vlog=INFO',
     '-testing_isolated_scheduler=true',
     '-testing_log_file_path=/tmp/testing_log_file',
+    '-viz_job_url_prefix=http://fake_viz_domain.com'
   ]
 }
 

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/e3aacdd2/src/main/java/org/apache/aurora/scheduler/app/AppModule.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/app/AppModule.java b/src/main/java/org/apache/aurora/scheduler/app/AppModule.java
index eeafc78..d3cbdfa 100644
--- a/src/main/java/org/apache/aurora/scheduler/app/AppModule.java
+++ b/src/main/java/org/apache/aurora/scheduler/app/AppModule.java
@@ -72,11 +72,18 @@ class AppModule extends AbstractModule {
 
   private final String clusterName;
   private final String serverSetPath;
+  private final String statsURLPrefix;
   private final ClientConfig zkClientConfig;
 
-  AppModule(String clusterName, String serverSetPath, ClientConfig zkClientConfig) {
+  AppModule(
+      String clusterName,
+      String serverSetPath,
+      ClientConfig zkClientConfig,
+      String statsURLPrefix) {
+
     this.clusterName = checkNotBlank(clusterName);
     this.serverSetPath = checkNotBlank(serverSetPath);
+    this.statsURLPrefix = checkNotBlank(statsURLPrefix);
     this.zkClientConfig = checkNotNull(zkClientConfig);
   }
 
@@ -93,7 +100,8 @@ class AppModule extends AbstractModule {
         IServerInfo.build(
             new ServerInfo()
                 .setClusterName(clusterName)
-                .setThriftAPIVersion(THRIFT_API_VERSION)));
+                .setThriftAPIVersion(THRIFT_API_VERSION)
+                .setStatsURLPrefix(statsURLPrefix)));
 
     // Filter layering: notifier filter -> base impl
     PubsubEventModule.bind(binder(), SchedulingFilterImpl.class);

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/e3aacdd2/src/main/java/org/apache/aurora/scheduler/app/SchedulerMain.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/app/SchedulerMain.java b/src/main/java/org/apache/aurora/scheduler/app/SchedulerMain.java
index ec56c64..d4e8f63 100644
--- a/src/main/java/org/apache/aurora/scheduler/app/SchedulerMain.java
+++ b/src/main/java/org/apache/aurora/scheduler/app/SchedulerMain.java
@@ -131,11 +131,20 @@ public class SchedulerMain extends AbstractApplication {
   private static final Arg<List<Class<? extends Module>>> EXTRA_MODULES
=
       Arg.create((List<Class<? extends Module>>) ImmutableList.<Class<?
extends Module>>of());
 
-  @Inject private SingletonService schedulerService;
-  @Inject private LocalServiceRegistry serviceRegistry;
-  @Inject private SchedulerLifecycle schedulerLifecycle;
-  @Inject private Lifecycle appLifecycle;
-  @Inject private Optional<RootLogConfig.Configuration> glogConfig;
+  // TODO(Suman Karumuri): Rename viz_job_url_prefix to stats_job_url_prefix for consistency.
+  @CmdLine(name = "viz_job_url_prefix", help = "URL prefix for job container stats.")
+  private static final Arg<String> STATS_URL_PREFIX = Arg.create("");
+
+  @Inject
+  private SingletonService schedulerService;
+  @Inject
+  private LocalServiceRegistry serviceRegistry;
+  @Inject
+  private SchedulerLifecycle schedulerLifecycle;
+  @Inject
+  private Lifecycle appLifecycle;
+  @Inject
+  private Optional<RootLogConfig.Configuration> glogConfig;
 
   private static Iterable<? extends Module> getSystemModules() {
     return ImmutableList.of(
@@ -160,11 +169,12 @@ public class SchedulerMain extends AbstractApplication {
   static Iterable<? extends Module> getModules(
       String clusterName,
       String serverSetPath,
-      ClientConfig zkClientConfig) {
+      ClientConfig zkClientConfig,
+      String statsURLPrefix) {
 
     return ImmutableList.<Module>builder()
         .addAll(getSystemModules())
-        .add(new AppModule(clusterName, serverSetPath, zkClientConfig))
+        .add(new AppModule(clusterName, serverSetPath, zkClientConfig, statsURLPrefix))
         .addAll(getExtraModules())
         .add(new LogStorageModule())
         .add(new MemStorageModule(Bindings.annotatedKeyFactory(LogStorage.WriteBehind.class)))
@@ -215,7 +225,12 @@ public class SchedulerMain extends AbstractApplication {
 
     return ImmutableList.<Module>builder()
         .add(new BackupModule(SnapshotStoreImpl.class))
-        .addAll(getModules(CLUSTER_NAME.get(), SERVERSET_PATH.get(), zkClientConfig))
+        .addAll(
+            getModules(
+                CLUSTER_NAME.get(),
+                SERVERSET_PATH.get(),
+                zkClientConfig,
+                STATS_URL_PREFIX.get()))
         .add(new ZooKeeperClientModule(zkClientConfig))
         .add(configModule)
         .add(additional)

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/e3aacdd2/src/main/resources/org/apache/aurora/scheduler/http/ui/js/directives.js
----------------------------------------------------------------------
diff --git a/src/main/resources/org/apache/aurora/scheduler/http/ui/js/directives.js b/src/main/resources/org/apache/aurora/scheduler/http/ui/js/directives.js
index 4d912be..2c0634d 100644
--- a/src/main/resources/org/apache/aurora/scheduler/http/ui/js/directives.js
+++ b/src/main/resources/org/apache/aurora/scheduler/http/ui/js/directives.js
@@ -17,8 +17,8 @@ auroraUI.directive('roleEnvLink', function () {
 auroraUI.directive('jobLink', function () {
   return {
     restrict: 'C',
-    template: '<a ng-href="/scheduler/{{dataRow.role}}/{{dataRow.environment}}/{{formatedValue}}"'
-      + ' target="_blank">{{formatedValue}}</a>'
+    template: '<a ng-href="/scheduler/{{dataRow.role}}/{{dataRow.environment}}/{{formatedValue}}">'
+      + '{{formatedValue}}</a>'
   };
 });
 
@@ -59,7 +59,7 @@ auroraUI.directive('taskStatus', function () {
 auroraUI.directive('taskLink', function () {
   return {
     restrict: 'C',
-    template: '<a ng-href="/scheduler/structdump/task/{{formatedValue}}" target="_blank">'
+
+    template: '<a ng-href="/scheduler/structdump/task/{{formatedValue}}">' +
       '<i class="icon-cog"></i></a>'
   };
 });

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/e3aacdd2/src/main/thrift/org/apache/aurora/gen/api.thrift
----------------------------------------------------------------------
diff --git a/src/main/thrift/org/apache/aurora/gen/api.thrift b/src/main/thrift/org/apache/aurora/gen/api.thrift
index c0618e4..0225330 100644
--- a/src/main/thrift/org/apache/aurora/gen/api.thrift
+++ b/src/main/thrift/org/apache/aurora/gen/api.thrift
@@ -436,6 +436,7 @@ struct JobSummaryResult {
 struct ServerInfo {
   1: string clusterName
   2: i32 thriftAPIVersion
+  3: string statsURLPrefix  // A url prefix for job container stats.
 }
 
 union Result {

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/e3aacdd2/src/test/java/org/apache/aurora/scheduler/app/SchedulerIT.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/aurora/scheduler/app/SchedulerIT.java b/src/test/java/org/apache/aurora/scheduler/app/SchedulerIT.java
index a4e9464..a48029e 100644
--- a/src/test/java/org/apache/aurora/scheduler/app/SchedulerIT.java
+++ b/src/test/java/org/apache/aurora/scheduler/app/SchedulerIT.java
@@ -116,6 +116,7 @@ public class SchedulerIT extends BaseZooKeeperTest {
 
   private static final String CLUSTER_NAME = "integration_test_cluster";
   private static final String SERVERSET_PATH = "/fake/service/path";
+  private static final String STATS_URL_PREFIX = "fake_url";
   private static final String FRAMEWORK_ID = "integration_test_framework_id";
 
   private ExecutorService executor = Executors.newCachedThreadPool(
@@ -200,7 +201,8 @@ public class SchedulerIT extends BaseZooKeeperTest {
         .withCredentials(ZooKeeperClient.digestCredentials("mesos", "mesos"));
     injector = Guice.createInjector(
         ImmutableList.<Module>builder()
-            .addAll(SchedulerMain.getModules(CLUSTER_NAME, SERVERSET_PATH, zkClientConfig))
+            .addAll(SchedulerMain.getModules(
+                CLUSTER_NAME, SERVERSET_PATH, zkClientConfig, STATS_URL_PREFIX))
             .add(new LifecycleModule())
             .add(new AppLauncherModule())
             .add(new ZooKeeperClientModule(zkClientConfig))

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/e3aacdd2/src/test/java/org/apache/aurora/scheduler/thrift/SchedulerThriftInterfaceTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/aurora/scheduler/thrift/SchedulerThriftInterfaceTest.java
b/src/test/java/org/apache/aurora/scheduler/thrift/SchedulerThriftInterfaceTest.java
index c89965c..83bc8d4 100644
--- a/src/test/java/org/apache/aurora/scheduler/thrift/SchedulerThriftInterfaceTest.java
+++ b/src/test/java/org/apache/aurora/scheduler/thrift/SchedulerThriftInterfaceTest.java
@@ -144,7 +144,10 @@ public class SchedulerThriftInterfaceTest extends EasyMockTest {
   private static final IResourceAggregate CONSUMED =
       IResourceAggregate.build(new ResourceAggregate(0.0, 0, 0));
   private static final ServerInfo SERVER_INFO =
-      new ServerInfo().setClusterName("test").setThriftAPIVersion(THRIFT_API_VERSION);
+      new ServerInfo()
+          .setClusterName("test")
+          .setThriftAPIVersion(THRIFT_API_VERSION)
+          .setStatsURLPrefix("fake_url");
   private static final APIVersion API_VERSION = new APIVersion().setMajor(THRIFT_API_VERSION);
   private static final String CRON_SCHEDULE = "0 * * * *";
 
@@ -318,7 +321,7 @@ public class SchedulerThriftInterfaceTest extends EasyMockTest {
   }
 
   private static IScheduledTask buildScheduledTask(String jobName) {
-     return IScheduledTask.build(new ScheduledTask()
+    return IScheduledTask.build(new ScheduledTask()
         .setAssignedTask(new AssignedTask()
             .setTask(new TaskConfig()
                 .setOwner(ROLE_IDENTITY)

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/e3aacdd2/src/test/java/org/apache/aurora/scheduler/thrift/aop/ServerInfoInterceptorTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/aurora/scheduler/thrift/aop/ServerInfoInterceptorTest.java
b/src/test/java/org/apache/aurora/scheduler/thrift/aop/ServerInfoInterceptorTest.java
index dd991fb..7a8baa4 100644
--- a/src/test/java/org/apache/aurora/scheduler/thrift/aop/ServerInfoInterceptorTest.java
+++ b/src/test/java/org/apache/aurora/scheduler/thrift/aop/ServerInfoInterceptorTest.java
@@ -45,8 +45,11 @@ public class ServerInfoInterceptorTest extends EasyMockTest {
   private AuroraAdmin.Iface realThrift;
   private AuroraAdmin.Iface decoratedThrift;
 
-  private static final IServerInfo SERVER_INFO =
-      IServerInfo.build(new ServerInfo().setClusterName("test").setThriftAPIVersion(1));
+  private static final IServerInfo SERVER_INFO = IServerInfo.build(
+      new ServerInfo()
+          .setClusterName("test")
+          .setThriftAPIVersion(1)
+          .setStatsURLPrefix("fake_url"));
 
   private ServerInfoInterceptor interceptor;
 
@@ -86,9 +89,9 @@ public class ServerInfoInterceptorTest extends EasyMockTest {
         new ServerInfo().setClusterName("FAKECLUSTER").setThriftAPIVersion(100000);
 
     Response response = okResponse(
-            Result.getJobsResult(
-                new GetJobsResult().setConfigs(ImmutableSet.<JobConfiguration>of())))
-            .setServerInfo(previousServerInfo);
+        Result.getJobsResult(
+            new GetJobsResult().setConfigs(ImmutableSet.<JobConfiguration>of())))
+        .setServerInfo(previousServerInfo);
 
     expect(realThrift.getJobs(ROLE)).andReturn(response);
 

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/e3aacdd2/src/test/resources/org/apache/aurora/gen/api.thrift.md5
----------------------------------------------------------------------
diff --git a/src/test/resources/org/apache/aurora/gen/api.thrift.md5 b/src/test/resources/org/apache/aurora/gen/api.thrift.md5
index 05c6e8a..2fedcca 100644
--- a/src/test/resources/org/apache/aurora/gen/api.thrift.md5
+++ b/src/test/resources/org/apache/aurora/gen/api.thrift.md5
@@ -1 +1 @@
-f91209ac428266e87dac5430bf46ed10
+1553d6dfbed91acf42c735d19b236f69


Mime
View raw message