Rebase onto trunk - fix some issues. Contributed by Rohith Sharma K S
authorJian He <jianhe@apache.org>
Tue, 5 Sep 2017 05:07:24 +0000 (22:07 -0700)
committerJian He <jianhe@apache.org>
Mon, 6 Nov 2017 21:30:14 +0000 (13:30 -0800)
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/pom.xml
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/pom.xml
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/timelineservice/ServiceTimelinePublisher.java
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/test/java/org/apache/hadoop/yarn/service/timelineservice/TestServiceTimelinePublisher.java
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/pom.xml
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-services.js

index 1077ccd..74d9681 100644 (file)
@@ -19,7 +19,7 @@
   <parent>
     <groupId>org.apache.hadoop</groupId>
     <artifactId>hadoop-yarn-applications</artifactId>
-    <version>3.0.0-beta1-SNAPSHOT</version>
+    <version>3.1.0-SNAPSHOT</version>
   </parent>
   <artifactId>hadoop-yarn-services-api</artifactId>
   <name>Apache Hadoop YARN Services API</name>
index d9b7adb..fb07edc 100644 (file)
@@ -19,7 +19,7 @@
   <parent>
     <groupId>org.apache.hadoop</groupId>
     <artifactId>hadoop-yarn-services</artifactId>
-    <version>3.0.0-beta1-SNAPSHOT</version>
+    <version>3.1.0-SNAPSHOT</version>
   </parent>
   <artifactId>hadoop-yarn-services-core</artifactId>
   <packaging>jar</packaging>
index 5e65ad9..9e7d8e8 100644 (file)
@@ -66,6 +66,7 @@ public class ServiceTimelinePublisher extends CompositeService {
   protected void serviceInit(org.apache.hadoop.conf.Configuration configuration)
       throws Exception {
     addService(timelineClient);
+    super.serviceInit(configuration);
   }
 
 
@@ -95,8 +96,8 @@ public class ServiceTimelinePublisher extends CompositeService {
     // create info keys
     Map<String, Object> entityInfos = new HashMap<String, Object>();
     entityInfos.put(ServiceTimelineMetricsConstants.NAME, service.getName());
-    entityInfos.put(ServiceTimelineMetricsConstants.STATE,
-        service.getState().toString());
+//    entityInfos.put(ServiceTimelineMetricsConstants.STATE,
+//        service.getState().toString());
     entityInfos.put(ServiceTimelineMetricsConstants.LAUNCH_TIME,
         currentTimeMillis);
     entity.addInfo(ServiceTimelineMetricsConstants.QUICK_LINKS,
@@ -232,18 +233,23 @@ public class ServiceTimelinePublisher extends CompositeService {
 
       // create info keys
       Map<String, Object> entityInfos = new HashMap<String, Object>();
-      entityInfos.put(ServiceTimelineMetricsConstants.ARTIFACT_ID,
-          component.getArtifact().getId());
-      entityInfos.put(ServiceTimelineMetricsConstants.ARTIFACT_TYPE,
-          component.getArtifact().getType().toString());
-      if (component.getResource().getProfile() != null) {
-        entityInfos.put(ServiceTimelineMetricsConstants.RESOURCE_PROFILE,
-            component.getResource().getProfile());
+      if (component.getArtifact() != null) {
+        entityInfos.put(ServiceTimelineMetricsConstants.ARTIFACT_ID,
+            component.getArtifact().getId());
+        entityInfos.put(ServiceTimelineMetricsConstants.ARTIFACT_TYPE,
+            component.getArtifact().getType().toString());
+      }
+
+      if (component.getResource() != null) {
+        entityInfos.put(ServiceTimelineMetricsConstants.RESOURCE_CPU,
+            component.getResource().getCpus());
+        entityInfos.put(ServiceTimelineMetricsConstants.RESOURCE_MEMORY,
+            component.getResource().getMemory());
+        if (component.getResource().getProfile() != null) {
+          entityInfos.put(ServiceTimelineMetricsConstants.RESOURCE_PROFILE,
+              component.getResource().getProfile());
+        }
       }
-      entityInfos.put(ServiceTimelineMetricsConstants.RESOURCE_CPU,
-          component.getResource().getCpus());
-      entityInfos.put(ServiceTimelineMetricsConstants.RESOURCE_MEMORY,
-          component.getResource().getMemory());
 
       if (component.getLaunchCommand() != null) {
         entityInfos.put(ServiceTimelineMetricsConstants.LAUNCH_COMMAND,
index 1233804..716fdb7 100644 (file)
@@ -19,7 +19,7 @@
     <parent>
         <artifactId>hadoop-yarn-applications</artifactId>
         <groupId>org.apache.hadoop</groupId>
-        <version>3.0.0-beta1-SNAPSHOT</version>
+        <version>3.1.0-SNAPSHOT</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <artifactId>hadoop-yarn-services</artifactId>
index 0f74f2f..a6535ae 100644 (file)
@@ -23,7 +23,7 @@ export default AbstractRoute.extend({
   model() {
       return Ember.RSVP.hash({
         apps: this.store.query('yarn-app', {
-          applicationTypes: "yarn-native-service"
+          applicationTypes: "yarn-service"
         }),
     });
   },