hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From varunsax...@apache.org
Subject hadoop git commit: YARN-6455. Enhance the timelinewriter.flush() race condition fix (Haibo Chen via Varun Saxena)
Date Thu, 27 Apr 2017 09:39:17 GMT
Repository: hadoop
Updated Branches:
  refs/heads/trunk 62579b69a -> 793bbf216


YARN-6455. Enhance the timelinewriter.flush() race condition fix (Haibo Chen 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/793bbf21
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/793bbf21
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/793bbf21

Branch: refs/heads/trunk
Commit: 793bbf216dc6d44ea57c778037bd461513fa6078
Parents: 62579b6
Author: Varun Saxena <varunsaxena@apache.org>
Authored: Thu Apr 27 15:01:58 2017 +0530
Committer: Varun Saxena <varunsaxena@apache.org>
Committed: Thu Apr 27 15:01:58 2017 +0530

----------------------------------------------------------------------
 .../timelineservice/collector/AppLevelTimelineCollector.java | 8 ++++----
 .../server/timelineservice/collector/TimelineCollector.java  | 4 ----
 2 files changed, 4 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/793bbf21/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice/src/main/java/org/apache/hadoop/yarn/server/timelineservice/collector/AppLevelTimelineCollector.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/collector/AppLevelTimelineCollector.java
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice/src/main/java/org/apache/hadoop/yarn/server/timelineservice/collector/AppLevelTimelineCollector.java
index e62a436..0b05309 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice/src/main/java/org/apache/hadoop/yarn/server/timelineservice/collector/AppLevelTimelineCollector.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice/src/main/java/org/apache/hadoop/yarn/server/timelineservice/collector/AppLevelTimelineCollector.java
@@ -59,6 +59,7 @@ public class AppLevelTimelineCollector extends TimelineCollector {
   private final TimelineCollectorContext context;
   private ScheduledThreadPoolExecutor appAggregationExecutor;
   private AppLevelAggregator appAggregator;
+  private UserGroupInformation currentUser;
 
   public AppLevelTimelineCollector(ApplicationId appId) {
     super(AppLevelTimelineCollector.class.getName() + " - " + appId.toString());
@@ -82,7 +83,8 @@ public class AppLevelTimelineCollector extends TimelineCollector {
     // Set the default values, which will be updated with an RPC call to get the
     // context info from NM.
     // Current user usually is not the app user, but keep this field non-null
-    context.setUserId(UserGroupInformation.getCurrentUser().getShortUserName());
+    currentUser = UserGroupInformation.getCurrentUser();
+    context.setUserId(currentUser.getShortUserName());
     context.setAppId(appId.toString());
     super.serviceInit(conf);
   }
@@ -149,9 +151,7 @@ public class AppLevelTimelineCollector extends TimelineCollector {
             TimelineEntityType.YARN_APPLICATION.toString());
         TimelineEntities entities = new TimelineEntities();
         entities.addEntity(resultEntity);
-        getWriter().write(currContext.getClusterId(), currContext.getUserId(),
-            currContext.getFlowName(), currContext.getFlowVersion(),
-            currContext.getFlowRunId(), currContext.getAppId(), entities);
+        putEntitiesAsync(entities, currentUser);
       } catch (Exception e) {
         LOG.error("Error aggregating timeline metrics", e);
       }

http://git-wip-us.apache.org/repos/asf/hadoop/blob/793bbf21/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice/src/main/java/org/apache/hadoop/yarn/server/timelineservice/collector/TimelineCollector.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/collector/TimelineCollector.java
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice/src/main/java/org/apache/hadoop/yarn/server/timelineservice/collector/TimelineCollector.java
index 4c9e9f8..c94c505 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice/src/main/java/org/apache/hadoop/yarn/server/timelineservice/collector/TimelineCollector.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice/src/main/java/org/apache/hadoop/yarn/server/timelineservice/collector/TimelineCollector.java
@@ -85,10 +85,6 @@ public abstract class TimelineCollector extends CompositeService {
     this.writer = w;
   }
 
-  protected TimelineWriter getWriter() {
-    return writer;
-  }
-
   protected Map<String, AggregationStatusTable> getAggregationGroups() {
     return aggregationGroups;
   }


---------------------------------------------------------------------
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