hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From prasan...@apache.org
Subject hive git commit: HIVE-16054: AMReporter should use application token instead of ugi.getCurrentUser (Prasanth Jayachandran reviewed by Siddharth Seth)
Date Tue, 07 Mar 2017 21:19:27 GMT
Repository: hive
Updated Branches:
  refs/heads/master 9368fece2 -> 301ebbb99


HIVE-16054: AMReporter should use application token instead of ugi.getCurrentUser (Prasanth
Jayachandran reviewed by Siddharth Seth)


Project: http://git-wip-us.apache.org/repos/asf/hive/repo
Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/301ebbb9
Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/301ebbb9
Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/301ebbb9

Branch: refs/heads/master
Commit: 301ebbb99f91ba60c1922a1cb2b07e2977cbfe15
Parents: 9368fec
Author: Prasanth Jayachandran <prasanthj@apache.org>
Authored: Tue Mar 7 13:19:18 2017 -0800
Committer: Prasanth Jayachandran <prasanthj@apache.org>
Committed: Tue Mar 7 13:19:18 2017 -0800

----------------------------------------------------------------------
 .../hadoop/hive/llap/daemon/impl/AMReporter.java    | 16 ++++++++--------
 .../hive/llap/daemon/impl/ContainerRunnerImpl.java  |  4 ++--
 .../hive/llap/daemon/impl/TaskRunnerCallable.java   |  4 ++--
 3 files changed, 12 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/301ebbb9/llap-server/src/java/org/apache/hadoop/hive/llap/daemon/impl/AMReporter.java
----------------------------------------------------------------------
diff --git a/llap-server/src/java/org/apache/hadoop/hive/llap/daemon/impl/AMReporter.java
b/llap-server/src/java/org/apache/hadoop/hive/llap/daemon/impl/AMReporter.java
index e5bd05e..b4c62d5 100644
--- a/llap-server/src/java/org/apache/hadoop/hive/llap/daemon/impl/AMReporter.java
+++ b/llap-server/src/java/org/apache/hadoop/hive/llap/daemon/impl/AMReporter.java
@@ -194,7 +194,7 @@ public class AMReporter extends AbstractService {
     }
   }
 
-  public void registerTask(String amLocation, int port, String user,
+  public void registerTask(String amLocation, int port, String umbilicalUser,
       Token<JobTokenIdentifier> jobToken, QueryIdentifier queryIdentifier,
       TezTaskAttemptID attemptId) {
     if (LOG.isTraceEnabled()) {
@@ -210,7 +210,7 @@ public class AMReporter extends AbstractService {
       LlapNodeId amNodeId = LlapNodeId.getInstance(amLocation, port);
       amNodeInfo = knownAppMasters.get(queryIdentifier);
       if (amNodeInfo == null) {
-        amNodeInfo = new AMNodeInfo(amNodeId, user, jobToken, queryIdentifier,
+        amNodeInfo = new AMNodeInfo(amNodeId, umbilicalUser, jobToken, queryIdentifier,
             retryPolicy, retryTimeout, socketFactory, conf);
         knownAppMasters.put(queryIdentifier, amNodeInfo);
         // Add to the queue only the first time this is registered, and on
@@ -244,14 +244,14 @@ public class AMReporter extends AbstractService {
     }
   }
 
-  public void taskKilled(String amLocation, int port, String user, Token<JobTokenIdentifier>
jobToken,
+  public void taskKilled(String amLocation, int port, String umbilicalUser, Token<JobTokenIdentifier>
jobToken,
                          final QueryIdentifier queryIdentifier, final TezTaskAttemptID taskAttemptId)
{
     LlapNodeId amNodeId = LlapNodeId.getInstance(amLocation, port);
     AMNodeInfo amNodeInfo;
     synchronized (knownAppMasters) {
       amNodeInfo = knownAppMasters.get(queryIdentifier);
       if (amNodeInfo == null) {
-        amNodeInfo = new AMNodeInfo(amNodeId, user, jobToken, queryIdentifier, retryPolicy,
retryTimeout, socketFactory,
+        amNodeInfo = new AMNodeInfo(amNodeId, umbilicalUser, jobToken, queryIdentifier, retryPolicy,
retryTimeout, socketFactory,
           conf);
       }
     }
@@ -424,7 +424,7 @@ public class AMReporter extends AbstractService {
   private static class AMNodeInfo implements Delayed {
     // Serves as lock for itself.
     private final Set<TezTaskAttemptID> tasks = new HashSet<>();
-    private final String user;
+    private final String umbilicalUser;
     private final Token<JobTokenIdentifier> jobToken;
     private final Configuration conf;
     private final LlapNodeId amNodeId;
@@ -438,14 +438,14 @@ public class AMReporter extends AbstractService {
     private final AtomicBoolean isDone = new AtomicBoolean(false);
 
 
-    public AMNodeInfo(LlapNodeId amNodeId, String user,
+    public AMNodeInfo(LlapNodeId amNodeId, String umbilicalUser,
                       Token<JobTokenIdentifier> jobToken,
                       QueryIdentifier currentQueryIdentifier,
                       RetryPolicy retryPolicy,
                       long timeout,
                       SocketFactory socketFactory,
                       Configuration conf) {
-      this.user = user;
+      this.umbilicalUser = umbilicalUser;
       this.jobToken = jobToken;
       this.queryIdentifier = currentQueryIdentifier;
       this.retryPolicy = retryPolicy;
@@ -460,7 +460,7 @@ public class AMReporter extends AbstractService {
         final InetSocketAddress address =
             NetUtils.createSocketAddrForHost(amNodeId.getHostname(), amNodeId.getPort());
         SecurityUtil.setTokenService(this.jobToken, address);
-        UserGroupInformation ugi = UserGroupInformation.createRemoteUser(user);
+        UserGroupInformation ugi = UserGroupInformation.createRemoteUser(umbilicalUser);
         ugi.addToken(jobToken);
         umbilical = ugi.doAs(new PrivilegedExceptionAction<LlapTaskUmbilicalProtocol>()
{
           @Override

http://git-wip-us.apache.org/repos/asf/hive/blob/301ebbb9/llap-server/src/java/org/apache/hadoop/hive/llap/daemon/impl/ContainerRunnerImpl.java
----------------------------------------------------------------------
diff --git a/llap-server/src/java/org/apache/hadoop/hive/llap/daemon/impl/ContainerRunnerImpl.java
b/llap-server/src/java/org/apache/hadoop/hive/llap/daemon/impl/ContainerRunnerImpl.java
index ca476ec..2a69d6a 100644
--- a/llap-server/src/java/org/apache/hadoop/hive/llap/daemon/impl/ContainerRunnerImpl.java
+++ b/llap-server/src/java/org/apache/hadoop/hive/llap/daemon/impl/ContainerRunnerImpl.java
@@ -508,10 +508,10 @@ public class ContainerRunnerImpl extends CompositeService implements
ContainerRu
   private class KilledTaskHandlerImpl implements KilledTaskHandler {
 
     @Override
-    public void taskKilled(String amLocation, int port, String user,
+    public void taskKilled(String amLocation, int port, String umbilicalUser,
                            Token<JobTokenIdentifier> jobToken, QueryIdentifier queryIdentifier,
                            TezTaskAttemptID taskAttemptId) {
-      amReporter.taskKilled(amLocation, port, user, jobToken, queryIdentifier, taskAttemptId);
+      amReporter.taskKilled(amLocation, port, umbilicalUser, jobToken, queryIdentifier, taskAttemptId);
     }
   }
 

http://git-wip-us.apache.org/repos/asf/hive/blob/301ebbb9/llap-server/src/java/org/apache/hadoop/hive/llap/daemon/impl/TaskRunnerCallable.java
----------------------------------------------------------------------
diff --git a/llap-server/src/java/org/apache/hadoop/hive/llap/daemon/impl/TaskRunnerCallable.java
b/llap-server/src/java/org/apache/hadoop/hive/llap/daemon/impl/TaskRunnerCallable.java
index f24a647..18f0db9 100644
--- a/llap-server/src/java/org/apache/hadoop/hive/llap/daemon/impl/TaskRunnerCallable.java
+++ b/llap-server/src/java/org/apache/hadoop/hive/llap/daemon/impl/TaskRunnerCallable.java
@@ -150,7 +150,7 @@ public class TaskRunnerCallable extends CallableWithNdc<TaskRunner2Result>
{
     // Register with the AMReporter when the callable is setup. Unregister once it starts
running.
     if (amReporter != null && jobToken != null) {
       this.amReporter.registerTask(request.getAmHost(), request.getAmPort(),
-          vertex.getUser(), jobToken, fragmentInfo.getQueryInfo().getQueryIdentifier(), attemptId);
+          vertex.getTokenIdentifier(), jobToken, fragmentInfo.getQueryInfo().getQueryIdentifier(),
attemptId);
     }
     this.metrics = metrics;
     this.requestId = taskSpec.getTaskAttemptID().toString();
@@ -377,7 +377,7 @@ public class TaskRunnerCallable extends CallableWithNdc<TaskRunner2Result>
{
    */
   public void reportTaskKilled() {
     killedTaskHandler
-        .taskKilled(request.getAmHost(), request.getAmPort(), vertex.getUser(), jobToken,
+        .taskKilled(request.getAmHost(), request.getAmPort(), vertex.getTokenIdentifier(),
jobToken,
             fragmentInfo.getQueryInfo().getQueryIdentifier(), taskSpec.getTaskAttemptID());
   }
 


Mime
View raw message