Repository: hive Updated Branches: refs/heads/master 8fb805225 -> db69525e7
HIVE-10564 : webhcat should use webhcat-site.xml properties for controller job submission (Thejas Nair, reivewed by Eugene Koifman) Project: http://git-wip-us.apache.org/repos/asf/hive/repo Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/db69525e Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/db69525e Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/db69525e Branch: refs/heads/master Commit: db69525e7265ec28590218b8fa9e0d40606a1c10 Parents: 8fb8052 Author: Thejas Nair <the...@hortonworks.com> Authored: Mon May 4 15:16:12 2015 -0700 Committer: Thejas Nair <the...@hortonworks.com> Committed: Mon May 4 15:16:12 2015 -0700 ---------------------------------------------------------------------- .../hcatalog/templeton/tool/TempletonControllerJob.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hive/blob/db69525e/hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/tool/TempletonControllerJob.java ---------------------------------------------------------------------- diff --git a/hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/tool/TempletonControllerJob.java b/hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/tool/TempletonControllerJob.java index 92e45cb..1f8ebf3 100644 --- a/hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/tool/TempletonControllerJob.java +++ b/hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/tool/TempletonControllerJob.java @@ -56,7 +56,7 @@ import org.apache.thrift.TException; * - run a keep alive thread so the job doesn't end. * - Optionally, store the stdout, stderr, and exit value of the child * in hdfs files. - * + * * A note on security. When jobs are submitted through WebHCat that use HCatalog, it means that * metastore access is required. Hive queries, of course, need metastore access. This in turn * requires delegation token to be obtained for metastore in a <em>secure cluster</em>. Since we @@ -80,6 +80,11 @@ public class TempletonControllerJob extends Configured implements Tool, JobSubmi this.appConf = conf; } + @Override + public Configuration getConf() { + return appConf; + } + private JobID submittedJobId; public String getSubmittedId() { @@ -95,7 +100,7 @@ public class TempletonControllerJob extends Configured implements Tool, JobSubmi * @see org.apache.hive.hcatalog.templeton.CompleteDelegator */ @Override - public int run(String[] args) throws IOException, InterruptedException, ClassNotFoundException, + public int run(String[] args) throws IOException, InterruptedException, ClassNotFoundException, TException { if(LOG.isDebugEnabled()) { LOG.debug("Preparing to submit job: " + Arrays.toString(args)); @@ -169,9 +174,11 @@ public class TempletonControllerJob extends Configured implements Tool, JobSubmi final UserGroupInformation ugi = UgiFactory.getUgi(user); UserGroupInformation real = ugi.getRealUser(); return real.doAs(new PrivilegedExceptionAction<String>() { + @Override public String run() throws IOException, TException, InterruptedException { final HiveMetaStoreClient client = new HiveMetaStoreClient(c); return ugi.doAs(new PrivilegedExceptionAction<String>() { + @Override public String run() throws IOException, TException, InterruptedException { String u = ugi.getUserName(); return client.getDelegationToken(u);