hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From da...@apache.org
Subject svn commit: r1519875 - in /hive/trunk: ./ hcatalog/webhcat/svr/src/main/java/org/apache/hcatalog/templeton/ shims/src/0.20/java/org/apache/hadoop/hive/shims/ shims/src/0.20S/java/org/apache/hadoop/hive/shims/ shims/src/0.20S/java/org/apache/hadoop/mapr...
Date Tue, 03 Sep 2013 22:42:49 GMT
Author: daijy
Date: Tue Sep  3 22:42:48 2013
New Revision: 1519875

URL: http://svn.apache.org/r1519875
Log:
HIVE-4442: WebHCat should not override user.name parameter for Queue call (Daniel Dai)

Modified:
    hive/trunk/RELEASE_NOTES.txt
    hive/trunk/hcatalog/webhcat/svr/src/main/java/org/apache/hcatalog/templeton/DeleteDelegator.java
    hive/trunk/hcatalog/webhcat/svr/src/main/java/org/apache/hcatalog/templeton/ListDelegator.java
    hive/trunk/hcatalog/webhcat/svr/src/main/java/org/apache/hcatalog/templeton/Server.java
    hive/trunk/hcatalog/webhcat/svr/src/main/java/org/apache/hcatalog/templeton/StatusDelegator.java
    hive/trunk/shims/src/0.20/java/org/apache/hadoop/hive/shims/Hadoop20Shims.java
    hive/trunk/shims/src/0.20S/java/org/apache/hadoop/hive/shims/Hadoop20SShims.java
    hive/trunk/shims/src/0.20S/java/org/apache/hadoop/mapred/WebHCatJTShim20S.java
    hive/trunk/shims/src/0.23/java/org/apache/hadoop/hive/shims/Hadoop23Shims.java
    hive/trunk/shims/src/0.23/java/org/apache/hadoop/mapred/WebHCatJTShim23.java
    hive/trunk/shims/src/common/java/org/apache/hadoop/hive/shims/HadoopShims.java

Modified: hive/trunk/RELEASE_NOTES.txt
URL: http://svn.apache.org/viewvc/hive/trunk/RELEASE_NOTES.txt?rev=1519875&r1=1519874&r2=1519875&view=diff
==============================================================================
--- hive/trunk/RELEASE_NOTES.txt (original)
+++ hive/trunk/RELEASE_NOTES.txt Tue Sep  3 22:42:48 2013
@@ -15,6 +15,7 @@ Release Notes - Hive - Version 0.11.0
     * [HIVE-4326] - Clean up remaining items in hive/hcatalog/historical/trunk
 
 ** Bug
+    * [HIVE-4442] - WebHCat should not override user.name parameter for Queue call
     * [HIVE-4586] - WebHCat should return 404 error for undefined resource
     * [HIVE-4820] - webhcat_config.sh should set default values for HIVE_HOME and HCAT_PREFIX
that work with default build tree structure
     * [HIVE-2264] - Hive server is SHUTTING DOWN when invalid queries beeing executed.

Modified: hive/trunk/hcatalog/webhcat/svr/src/main/java/org/apache/hcatalog/templeton/DeleteDelegator.java
URL: http://svn.apache.org/viewvc/hive/trunk/hcatalog/webhcat/svr/src/main/java/org/apache/hcatalog/templeton/DeleteDelegator.java?rev=1519875&r1=1519874&r2=1519875&view=diff
==============================================================================
--- hive/trunk/hcatalog/webhcat/svr/src/main/java/org/apache/hcatalog/templeton/DeleteDelegator.java
(original)
+++ hive/trunk/hcatalog/webhcat/svr/src/main/java/org/apache/hcatalog/templeton/DeleteDelegator.java
Tue Sep  3 22:42:48 2013
@@ -37,11 +37,11 @@ public class DeleteDelegator extends Tem
     public QueueStatusBean run(String user, String id)
         throws NotAuthorizedException, BadParam, IOException, InterruptedException
     {
-        UserGroupInformation ugi = UserGroupInformation.createRemoteUser(user);
+        UserGroupInformation ugi = UgiFactory.getUgi(user);
         WebHCatJTShim tracker = null;
         JobState state = null;
         try {
-            tracker = ShimLoader.getHadoopShims().getWebHCatShim(appConf);
+            tracker = ShimLoader.getHadoopShims().getWebHCatShim(appConf, ugi);
             JobID jobid = StatusDelegator.StringToJobID(id);
             if (jobid == null)
                 throw new BadParam("Invalid jobid: " + id);

Modified: hive/trunk/hcatalog/webhcat/svr/src/main/java/org/apache/hcatalog/templeton/ListDelegator.java
URL: http://svn.apache.org/viewvc/hive/trunk/hcatalog/webhcat/svr/src/main/java/org/apache/hcatalog/templeton/ListDelegator.java?rev=1519875&r1=1519874&r2=1519875&view=diff
==============================================================================
--- hive/trunk/hcatalog/webhcat/svr/src/main/java/org/apache/hcatalog/templeton/ListDelegator.java
(original)
+++ hive/trunk/hcatalog/webhcat/svr/src/main/java/org/apache/hcatalog/templeton/ListDelegator.java
Tue Sep  3 22:42:48 2013
@@ -36,13 +36,13 @@ public class ListDelegator extends Templ
         super(appConf);
     }
 
-    public List<String> run(String user)
+    public List<String> run(String user, boolean showall)
         throws NotAuthorizedException, BadParam, IOException, InterruptedException {
         
-        UserGroupInformation ugi = UserGroupInformation.createRemoteUser(user);
+        UserGroupInformation ugi = UgiFactory.getUgi(user);
         WebHCatJTShim tracker = null;
         try {
-            tracker = ShimLoader.getHadoopShims().getWebHCatShim(appConf);
+            tracker = ShimLoader.getHadoopShims().getWebHCatShim(appConf, ugi);
 
             ArrayList<String> ids = new ArrayList<String>();
 
@@ -54,7 +54,7 @@ public class ListDelegator extends Templ
                     try {
                         String id = job.getJobID().toString();
                         state = new JobState(id, Main.getAppConfigInstance());
-                        if (user.equals(state.getUser()))
+                        if (showall || user.equals(state.getUser()))
                             ids.add(id);
                     } finally {
                         if (state != null) {

Modified: hive/trunk/hcatalog/webhcat/svr/src/main/java/org/apache/hcatalog/templeton/Server.java
URL: http://svn.apache.org/viewvc/hive/trunk/hcatalog/webhcat/svr/src/main/java/org/apache/hcatalog/templeton/Server.java?rev=1519875&r1=1519874&r2=1519875&view=diff
==============================================================================
--- hive/trunk/hcatalog/webhcat/svr/src/main/java/org/apache/hcatalog/templeton/Server.java
(original)
+++ hive/trunk/hcatalog/webhcat/svr/src/main/java/org/apache/hcatalog/templeton/Server.java
Tue Sep  3 22:42:48 2013
@@ -717,13 +717,13 @@ public class Server {
     @GET
     @Path("queue")
     @Produces({MediaType.APPLICATION_JSON})
-    public List<String> showQueueList()
+    public List<String> showQueueList(@QueryParam("showall") boolean showall)
         throws NotAuthorizedException, BadParam, IOException, InterruptedException {
         
         verifyUser();
 
         ListDelegator d = new ListDelegator(appConf);
-        return d.run(getDoAsUser());
+        return d.run(getDoAsUser(), showall);
     }
 
     /**

Modified: hive/trunk/hcatalog/webhcat/svr/src/main/java/org/apache/hcatalog/templeton/StatusDelegator.java
URL: http://svn.apache.org/viewvc/hive/trunk/hcatalog/webhcat/svr/src/main/java/org/apache/hcatalog/templeton/StatusDelegator.java?rev=1519875&r1=1519874&r2=1519875&view=diff
==============================================================================
--- hive/trunk/hcatalog/webhcat/svr/src/main/java/org/apache/hcatalog/templeton/StatusDelegator.java
(original)
+++ hive/trunk/hcatalog/webhcat/svr/src/main/java/org/apache/hcatalog/templeton/StatusDelegator.java
Tue Sep  3 22:42:48 2013
@@ -24,6 +24,7 @@ import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.hadoop.hive.shims.HadoopShims.WebHCatJTShim;
 import org.apache.hadoop.hive.shims.ShimLoader;
+import org.apache.hadoop.security.UserGroupInformation;
 import org.apache.hadoop.mapred.JobID;
 import org.apache.hadoop.mapred.JobProfile;
 import org.apache.hadoop.mapred.JobStatus;
@@ -45,7 +46,8 @@ public class StatusDelegator extends Tem
         WebHCatJTShim tracker = null;
         JobState state = null;
         try {
-            tracker = ShimLoader.getHadoopShims().getWebHCatShim(appConf);
+            UserGroupInformation ugi = UgiFactory.getUgi(user);
+            tracker = ShimLoader.getHadoopShims().getWebHCatShim(appConf, ugi);
             JobID jobid = StatusDelegator.StringToJobID(id);
             if (jobid == null)
                 throw new BadParam("Invalid jobid: " + id);

Modified: hive/trunk/shims/src/0.20/java/org/apache/hadoop/hive/shims/Hadoop20Shims.java
URL: http://svn.apache.org/viewvc/hive/trunk/shims/src/0.20/java/org/apache/hadoop/hive/shims/Hadoop20Shims.java?rev=1519875&r1=1519874&r2=1519875&view=diff
==============================================================================
--- hive/trunk/shims/src/0.20/java/org/apache/hadoop/hive/shims/Hadoop20Shims.java (original)
+++ hive/trunk/shims/src/0.20/java/org/apache/hadoop/hive/shims/Hadoop20Shims.java Tue Sep
 3 22:42:48 2013
@@ -740,7 +740,7 @@ public class Hadoop20Shims implements Ha
       throw new UnsupportedOperationException("HCatalog does not support Hadoop 0.20.x");
   }
   @Override
-  public WebHCatJTShim getWebHCatShim(Configuration conf) throws IOException {
+  public WebHCatJTShim getWebHCatShim(Configuration conf, UserGroupInformation ugi) throws
IOException {
       throw new UnsupportedOperationException("WebHCat does not support Hadoop 0.20.x");
   }
 }

Modified: hive/trunk/shims/src/0.20S/java/org/apache/hadoop/hive/shims/Hadoop20SShims.java
URL: http://svn.apache.org/viewvc/hive/trunk/shims/src/0.20S/java/org/apache/hadoop/hive/shims/Hadoop20SShims.java?rev=1519875&r1=1519874&r2=1519875&view=diff
==============================================================================
--- hive/trunk/shims/src/0.20S/java/org/apache/hadoop/hive/shims/Hadoop20SShims.java (original)
+++ hive/trunk/shims/src/0.20S/java/org/apache/hadoop/hive/shims/Hadoop20SShims.java Tue Sep
 3 22:42:48 2013
@@ -44,6 +44,7 @@ import org.apache.hadoop.mapreduce.TaskA
 import org.apache.hadoop.mapreduce.TaskID;
 import org.apache.hadoop.util.Progressable;
 import org.apache.hadoop.mapred.lib.TotalOrderPartitioner;
+import org.apache.hadoop.security.UserGroupInformation;
 
 
 /**
@@ -326,7 +327,7 @@ public class Hadoop20SShims extends Hado
     }
   }
   @Override
-  public WebHCatJTShim getWebHCatShim(Configuration conf) throws IOException {
-    return new WebHCatJTShim20S(conf);//this has state, so can't be cached
+  public WebHCatJTShim getWebHCatShim(Configuration conf, UserGroupInformation ugi) throws
IOException {
+    return new WebHCatJTShim20S(conf, ugi);//this has state, so can't be cached
   }
 }

Modified: hive/trunk/shims/src/0.20S/java/org/apache/hadoop/mapred/WebHCatJTShim20S.java
URL: http://svn.apache.org/viewvc/hive/trunk/shims/src/0.20S/java/org/apache/hadoop/mapred/WebHCatJTShim20S.java?rev=1519875&r1=1519874&r2=1519875&view=diff
==============================================================================
--- hive/trunk/shims/src/0.20S/java/org/apache/hadoop/mapred/WebHCatJTShim20S.java (original)
+++ hive/trunk/shims/src/0.20S/java/org/apache/hadoop/mapred/WebHCatJTShim20S.java Tue Sep
 3 22:42:48 2013
@@ -19,9 +19,8 @@ public class WebHCatJTShim20S implements
     /**
      * Create a connection to the Job Tracker.
      */
-    public WebHCatJTShim20S(Configuration conf)
+    public WebHCatJTShim20S(Configuration conf, UserGroupInformation ugi)
             throws IOException {
-      UserGroupInformation ugi = UserGroupInformation.getLoginUser();
       cnx = (JobSubmissionProtocol)
               RPC.getProxy(JobSubmissionProtocol.class,
                       JobSubmissionProtocol.versionID,

Modified: hive/trunk/shims/src/0.23/java/org/apache/hadoop/hive/shims/Hadoop23Shims.java
URL: http://svn.apache.org/viewvc/hive/trunk/shims/src/0.23/java/org/apache/hadoop/hive/shims/Hadoop23Shims.java?rev=1519875&r1=1519874&r2=1519875&view=diff
==============================================================================
--- hive/trunk/shims/src/0.23/java/org/apache/hadoop/hive/shims/Hadoop23Shims.java (original)
+++ hive/trunk/shims/src/0.23/java/org/apache/hadoop/hive/shims/Hadoop23Shims.java Tue Sep
 3 22:42:48 2013
@@ -49,6 +49,7 @@ import org.apache.hadoop.mapreduce.util.
 import org.apache.hadoop.net.NetUtils;
 import org.apache.hadoop.util.Progressable;
 import org.apache.hadoop.mapred.lib.TotalOrderPartitioner;
+import org.apache.hadoop.security.UserGroupInformation;
 
 
 /**
@@ -335,7 +336,7 @@ public class Hadoop23Shims extends Hadoo
     }
   }
   @Override
-  public WebHCatJTShim getWebHCatShim(Configuration conf) throws IOException {
-    return new WebHCatJTShim23(conf);//this has state, so can't be cached
+  public WebHCatJTShim getWebHCatShim(Configuration conf, UserGroupInformation ugi) throws
IOException {
+    return new WebHCatJTShim23(conf, ugi);//this has state, so can't be cached
   }
 }

Modified: hive/trunk/shims/src/0.23/java/org/apache/hadoop/mapred/WebHCatJTShim23.java
URL: http://svn.apache.org/viewvc/hive/trunk/shims/src/0.23/java/org/apache/hadoop/mapred/WebHCatJTShim23.java?rev=1519875&r1=1519874&r2=1519875&view=diff
==============================================================================
--- hive/trunk/shims/src/0.23/java/org/apache/hadoop/mapred/WebHCatJTShim23.java (original)
+++ hive/trunk/shims/src/0.23/java/org/apache/hadoop/mapred/WebHCatJTShim23.java Tue Sep 
3 22:42:48 2013
@@ -1,6 +1,7 @@
 package org.apache.hadoop.mapred;
 
 import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.security.UserGroupInformation;
 import org.apache.hadoop.hive.shims.HadoopShims.WebHCatJTShim;
 
 import java.io.IOException;
@@ -11,7 +12,7 @@ public class WebHCatJTShim23 implements 
   /**
    * Create a connection to the Job Tracker.
    */
-  public WebHCatJTShim23(Configuration conf)
+  public WebHCatJTShim23(Configuration conf, final UserGroupInformation ugi)
           throws IOException {
 
     jc = new JobClient(conf);

Modified: hive/trunk/shims/src/common/java/org/apache/hadoop/hive/shims/HadoopShims.java
URL: http://svn.apache.org/viewvc/hive/trunk/shims/src/common/java/org/apache/hadoop/hive/shims/HadoopShims.java?rev=1519875&r1=1519874&r2=1519875&view=diff
==============================================================================
--- hive/trunk/shims/src/common/java/org/apache/hadoop/hive/shims/HadoopShims.java (original)
+++ hive/trunk/shims/src/common/java/org/apache/hadoop/hive/shims/HadoopShims.java Tue Sep
 3 22:42:48 2013
@@ -509,7 +509,7 @@ public interface HadoopShims {
    * Provides a Hadoop JobTracker shim.
    * @param conf not {@code null}
    */
-  public WebHCatJTShim getWebHCatShim(Configuration conf) throws IOException;
+  public WebHCatJTShim getWebHCatShim(Configuration conf, UserGroupInformation ugi) throws
IOException;
   public interface WebHCatJTShim {
     /**
      * Grab a handle to a job that is already known to the JobTracker.



Mime
View raw message