hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From su...@apache.org
Subject [03/50] [abbrv] hadoop git commit: YARN-6170. TimelineReaderServer should wait to join with HttpServer2 (Sangjin Lee via Varun Saxena)
Date Wed, 15 Feb 2017 00:56:40 GMT
YARN-6170. TimelineReaderServer should wait to join with HttpServer2 (Sangjin Lee via Varun
Saxena)


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/649deb72
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/649deb72
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/649deb72

Branch: refs/heads/YARN-2915
Commit: 649deb72fbb62568b4ea0d67444df6faaaed169d
Parents: 0aacd8f
Author: Varun Saxena <varunsaxena@apache.org>
Authored: Sat Feb 11 19:21:45 2017 +0530
Committer: Varun Saxena <varunsaxena@apache.org>
Committed: Sat Feb 11 19:21:45 2017 +0530

----------------------------------------------------------------------
 .../timelineservice/reader/TimelineReaderServer.java   | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/649deb72/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice/src/main/java/org/apache/hadoop/yarn/server/timelineservice/reader/TimelineReaderServer.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice/src/main/java/org/apache/hadoop/yarn/server/timelineservice/reader/TimelineReaderServer.java
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice/src/main/java/org/apache/hadoop/yarn/server/timelineservice/reader/TimelineReaderServer.java
index 76f7495..2835c1b 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice/src/main/java/org/apache/hadoop/yarn/server/timelineservice/reader/TimelineReaderServer.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice/src/main/java/org/apache/hadoop/yarn/server/timelineservice/reader/TimelineReaderServer.java
@@ -110,6 +110,16 @@ public class TimelineReaderServer extends CompositeService {
     startTimelineReaderWebApp();
   }
 
+  private void join() {
+    // keep the main thread that started the server up until it receives a stop
+    // signal
+    if (readerWebServer != null) {
+      try {
+        readerWebServer.join();
+      } catch (InterruptedException ignore) {}
+    }
+  }
+
   @Override
   protected void serviceStop() throws Exception {
     if (readerWebServer != null) {
@@ -194,6 +204,7 @@ public class TimelineReaderServer extends CompositeService {
     Configuration conf = new YarnConfiguration();
     conf.setBoolean(YarnConfiguration.TIMELINE_SERVICE_ENABLED, true);
     conf.setFloat(YarnConfiguration.TIMELINE_SERVICE_VERSION, 2.0f);
-    startTimelineReaderServer(args, conf);
+    TimelineReaderServer server = startTimelineReaderServer(args, conf);
+    server.join();
   }
 }
\ No newline at end of file


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org


Mime
View raw message