hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vino...@apache.org
Subject git commit: YARN-2779. Fixed ResourceManager to not require delegation tokens for communicating with Timeline Service. Contributed by Zhijie Shen.
Date Fri, 31 Oct 2014 06:17:36 GMT
Repository: hadoop
Updated Branches:
  refs/heads/branch-2 0ba8d8c19 -> 97694e78a


YARN-2779. Fixed ResourceManager to not require delegation tokens for communicating with Timeline
Service. Contributed by Zhijie Shen.

(cherry picked from commit d1828d94435eca21761b0ba8458f9de2f125d012)


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

Branch: refs/heads/branch-2
Commit: 97694e78ad3d90a67ee810eabf85c6df2724ec1f
Parents: 0ba8d8c
Author: Vinod Kumar Vavilapalli <vinodkv@apache.org>
Authored: Thu Oct 30 23:16:19 2014 -0700
Committer: Vinod Kumar Vavilapalli <vinodkv@apache.org>
Committed: Thu Oct 30 23:17:16 2014 -0700

----------------------------------------------------------------------
 hadoop-yarn-project/CHANGES.txt                 |  3 +++
 .../metrics/SystemMetricsPublisher.java         | 27 --------------------
 2 files changed, 3 insertions(+), 27 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/97694e78/hadoop-yarn-project/CHANGES.txt
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/CHANGES.txt b/hadoop-yarn-project/CHANGES.txt
index 09a0f74..a78f51e 100644
--- a/hadoop-yarn-project/CHANGES.txt
+++ b/hadoop-yarn-project/CHANGES.txt
@@ -387,6 +387,9 @@ Release 2.6.0 - UNRELEASED
 
     YARN-2503. Added node lablels in web UI. (Wangda Tan via jianhe)
 
+    YARN-2779. Fixed ResourceManager to not require delegation tokens for 
+    communicating with Timeline Service. (Zhijie Shen via vinodkv)
+
   OPTIMIZATIONS
 
   BUG FIXES

http://git-wip-us.apache.org/repos/asf/hadoop/blob/97694e78/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/metrics/SystemMetricsPublisher.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/metrics/SystemMetricsPublisher.java
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/metrics/SystemMetricsPublisher.java
index e2ecf9a..d8e7ef6 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/metrics/SystemMetricsPublisher.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/metrics/SystemMetricsPublisher.java
@@ -28,8 +28,6 @@ import org.apache.commons.logging.LogFactory;
 import org.apache.hadoop.classification.InterfaceAudience.Private;
 import org.apache.hadoop.classification.InterfaceStability.Unstable;
 import org.apache.hadoop.conf.Configuration;
-import org.apache.hadoop.security.UserGroupInformation;
-import org.apache.hadoop.security.token.Token;
 import org.apache.hadoop.service.CompositeService;
 import org.apache.hadoop.yarn.api.records.ApplicationAttemptId;
 import org.apache.hadoop.yarn.api.records.ApplicationId;
@@ -42,7 +40,6 @@ import org.apache.hadoop.yarn.event.AsyncDispatcher;
 import org.apache.hadoop.yarn.event.Dispatcher;
 import org.apache.hadoop.yarn.event.Event;
 import org.apache.hadoop.yarn.event.EventHandler;
-import org.apache.hadoop.yarn.security.client.TimelineDelegationTokenIdentifier;
 import org.apache.hadoop.yarn.server.metrics.AppAttemptMetricsConstants;
 import org.apache.hadoop.yarn.server.metrics.ApplicationMetricsConstants;
 import org.apache.hadoop.yarn.server.metrics.ContainerMetricsConstants;
@@ -65,13 +62,10 @@ public class SystemMetricsPublisher extends CompositeService {
 
   private static final Log LOG = LogFactory
       .getLog(SystemMetricsPublisher.class);
-  private static final int MAX_GET_TIMELINE_DELEGATION_TOKEN_ATTEMPTS = 10;
 
   private Dispatcher dispatcher;
   private TimelineClient client;
   private boolean publishSystemMetrics;
-  private int getTimelineDelegtionTokenAttempts = 0;
-  private boolean hasReceivedTimelineDelegtionToken = false;
 
   public SystemMetricsPublisher() {
     super(SystemMetricsPublisher.class.getName());
@@ -423,27 +417,6 @@ public class SystemMetricsPublisher extends CompositeService {
   }
 
   private void putEntity(TimelineEntity entity) {
-    if (UserGroupInformation.isSecurityEnabled()) {
-      if (!hasReceivedTimelineDelegtionToken
-          && getTimelineDelegtionTokenAttempts < MAX_GET_TIMELINE_DELEGATION_TOKEN_ATTEMPTS)
{
-        try {
-          Token<TimelineDelegationTokenIdentifier> token =
-              client.getDelegationToken(
-                  UserGroupInformation.getCurrentUser().getUserName());
-          UserGroupInformation.getCurrentUser().addToken(token);
-          hasReceivedTimelineDelegtionToken = true;
-        } catch (Exception e) {
-          LOG.error("Error happens when getting timeline delegation token", e);
-        } finally {
-          ++getTimelineDelegtionTokenAttempts;
-          if (!hasReceivedTimelineDelegtionToken
-              && getTimelineDelegtionTokenAttempts == MAX_GET_TIMELINE_DELEGATION_TOKEN_ATTEMPTS)
{
-            LOG.error("Run out of the attempts to get timeline delegation token. " +
-              "Use kerberos authentication only.");
-          }
-        }
-      }
-    }
     try {
       if (LOG.isDebugEnabled()) {
         LOG.debug("Publishing the entity " + entity.getEntityId() +


Mime
View raw message