FAQ
Repository: hive
Updated Branches:
   refs/heads/master f6ea8cb6f -> f66478973


HIVE-11164 WebHCat should log contents of HiveConf on startup (Eugene Koifman, reviewed by Thejas Nair)


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

Branch: refs/heads/master
Commit: f664789737d516ac664462732664121acc111a1e
Parents: f6ea8cb
Author: Eugene Koifman <ekoifman@hortonworks.com>
Authored: Wed Jul 8 17:53:55 2015 -0700
Committer: Eugene Koifman <ekoifman@hortonworks.com>
Committed: Wed Jul 8 17:53:55 2015 -0700

----------------------------------------------------------------------
  .../hive/hcatalog/templeton/AppConfig.java | 28 +++++++++++++++-----
  .../hcatalog/templeton/SecureProxySupport.java | 6 +++--
  2 files changed, 25 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/f6647897/hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/AppConfig.java
----------------------------------------------------------------------
diff --git a/hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/AppConfig.java b/hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/AppConfig.java
index 8244274..062d5a0 100644
--- a/hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/AppConfig.java
+++ b/hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/AppConfig.java
@@ -239,8 +239,24 @@ public class AppConfig extends Configuration {
    private String dumpEnvironent() {
      StringBuilder sb = TempletonUtils.dumpPropMap("========WebHCat System.getenv()========", System.getenv());
      sb.append("START========WebHCat AppConfig.iterator()========: \n");
- Iterator<Map.Entry<String, String>> configIter = this.iterator();
- List<Map.Entry<String, String>> configVals = new ArrayList<Map.Entry<String, String>>();
+ dumpConfig(this, sb);
+ sb.append("END========WebHCat AppConfig.iterator()========: \n");
+
+ sb.append(TempletonUtils.dumpPropMap("========WebHCat System.getProperties()========", System.getProperties()));
+
+ sb.append("START========\"new HiveConf()\"========\n");
+ HiveConf c = new HiveConf();
+ sb.append("hiveDefaultUrl=").append(c.getHiveDefaultLocation()).append('\n');
+ sb.append("hiveSiteURL=").append(HiveConf.getHiveSiteLocation()).append('\n');
+ sb.append("hiveServer2SiteUrl=").append(HiveConf.getHiveServer2SiteLocation()).append('\n');
+ sb.append("hivemetastoreSiteUrl=").append(HiveConf.getMetastoreSiteLocation()).append('\n');
+ dumpConfig(c, sb);
+ sb.append("END========\"new HiveConf()\"========\n");
+ return sb.toString();
+ }
+ private static void dumpConfig(Configuration conf, StringBuilder sb) {
+ Iterator<Map.Entry<String, String>> configIter = conf.iterator();
+ List<Map.Entry<String, String>>configVals = new ArrayList<>();
      while(configIter.hasNext()) {
        configVals.add(configIter.next());
      }
@@ -253,20 +269,18 @@ public class AppConfig extends Configuration {
      for(Map.Entry<String, String> entry : configVals) {
        //use get() to make sure variable substitution works
        if(entry.getKey().toLowerCase().contains("path")) {
- StringTokenizer st = new StringTokenizer(get(entry.getKey()), File.pathSeparator);
+ StringTokenizer st = new StringTokenizer(conf.get(entry.getKey()), File.pathSeparator);
          sb.append(entry.getKey()).append("=\n");
          while(st.hasMoreTokens()) {
            sb.append(" ").append(st.nextToken()).append(File.pathSeparator).append('\n');
          }
        }
        else {
- sb.append(entry.getKey()).append('=').append(get(entry.getKey())).append('\n');
+ sb.append(entry.getKey()).append('=').append(conf.get(entry.getKey())).append('\n');
        }
      }
- sb.append("END========WebHCat AppConfig.iterator()========: \n");
- sb.append(TempletonUtils.dumpPropMap("========WebHCat System.getProperties()========", System.getProperties()));
- return sb.toString();
    }
+
    public void startCleanup() {
      JobState.getStorageInstance(this).startCleanup(this);
    }

http://git-wip-us.apache.org/repos/asf/hive/blob/f6647897/hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/SecureProxySupport.java
----------------------------------------------------------------------
diff --git a/hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/SecureProxySupport.java b/hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/SecureProxySupport.java
index b4687b5..1ef5f27 100644
--- a/hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/SecureProxySupport.java
+++ b/hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/SecureProxySupport.java
@@ -86,6 +86,9 @@ public class SecureProxySupport {
        } catch (Exception e) {
          throw new IOException(e);
        }
+ if(hcatTokenStr == null) {
+ LOG.error("open(" + user + ") token=null");
+ }
        Token<?> msToken = new Token();
        msToken.decodeFromUrlString(hcatTokenStr);
        msToken.setService(new Text(HCAT_SERVICE));
@@ -175,11 +178,10 @@ public class SecureProxySupport {
    }

    private String buildHcatDelegationToken(String user)
- throws IOException, InterruptedException, MetaException, TException {
+ throws IOException, InterruptedException, TException {
      final HiveConf c = new HiveConf();
      final IMetaStoreClient client = HCatUtil.getHiveMetastoreClient(c);
      LOG.info("user: " + user + " loginUser: " + UserGroupInformation.getLoginUser().getUserName());
- final TokenWrapper twrapper = new TokenWrapper();
      final UserGroupInformation ugi = UgiFactory.getUgi(user);
      String s = ugi.doAs(new PrivilegedExceptionAction<String>() {
        public String run()

Search Discussions

  • Ekoifman at Jul 9, 2015 at 1:08 am
    Repository: hive
    Updated Branches:
       refs/heads/branch-1 4b0ebfad0 -> c84f86136


    HIVE-11164 WebHCat should log contents of HiveConf on startup (Eugene Koifman, reviewed by Thejas Nair)


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

    Branch: refs/heads/branch-1
    Commit: c84f86136e91090b517f37ff61149c366b2a4d77
    Parents: 4b0ebfa
    Author: Eugene Koifman <ekoifman@hortonworks.com>
    Authored: Wed Jul 8 18:07:55 2015 -0700
    Committer: Eugene Koifman <ekoifman@hortonworks.com>
    Committed: Wed Jul 8 18:07:55 2015 -0700

    ----------------------------------------------------------------------
      .../hive/hcatalog/templeton/AppConfig.java | 28 +++++++++++++++-----
      .../hcatalog/templeton/SecureProxySupport.java | 6 +++--
      2 files changed, 25 insertions(+), 9 deletions(-)
    ----------------------------------------------------------------------


    http://git-wip-us.apache.org/repos/asf/hive/blob/c84f8613/hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/AppConfig.java
    ----------------------------------------------------------------------
    diff --git a/hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/AppConfig.java b/hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/AppConfig.java
    index 8244274..062d5a0 100644
    --- a/hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/AppConfig.java
    +++ b/hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/AppConfig.java
    @@ -239,8 +239,24 @@ public class AppConfig extends Configuration {
        private String dumpEnvironent() {
          StringBuilder sb = TempletonUtils.dumpPropMap("========WebHCat System.getenv()========", System.getenv());
          sb.append("START========WebHCat AppConfig.iterator()========: \n");
    - Iterator<Map.Entry<String, String>> configIter = this.iterator();
    - List<Map.Entry<String, String>> configVals = new ArrayList<Map.Entry<String, String>>();
    + dumpConfig(this, sb);
    + sb.append("END========WebHCat AppConfig.iterator()========: \n");
    +
    + sb.append(TempletonUtils.dumpPropMap("========WebHCat System.getProperties()========", System.getProperties()));
    +
    + sb.append("START========\"new HiveConf()\"========\n");
    + HiveConf c = new HiveConf();
    + sb.append("hiveDefaultUrl=").append(c.getHiveDefaultLocation()).append('\n');
    + sb.append("hiveSiteURL=").append(HiveConf.getHiveSiteLocation()).append('\n');
    + sb.append("hiveServer2SiteUrl=").append(HiveConf.getHiveServer2SiteLocation()).append('\n');
    + sb.append("hivemetastoreSiteUrl=").append(HiveConf.getMetastoreSiteLocation()).append('\n');
    + dumpConfig(c, sb);
    + sb.append("END========\"new HiveConf()\"========\n");
    + return sb.toString();
    + }
    + private static void dumpConfig(Configuration conf, StringBuilder sb) {
    + Iterator<Map.Entry<String, String>> configIter = conf.iterator();
    + List<Map.Entry<String, String>>configVals = new ArrayList<>();
          while(configIter.hasNext()) {
            configVals.add(configIter.next());
          }
    @@ -253,20 +269,18 @@ public class AppConfig extends Configuration {
          for(Map.Entry<String, String> entry : configVals) {
            //use get() to make sure variable substitution works
            if(entry.getKey().toLowerCase().contains("path")) {
    - StringTokenizer st = new StringTokenizer(get(entry.getKey()), File.pathSeparator);
    + StringTokenizer st = new StringTokenizer(conf.get(entry.getKey()), File.pathSeparator);
              sb.append(entry.getKey()).append("=\n");
              while(st.hasMoreTokens()) {
                sb.append(" ").append(st.nextToken()).append(File.pathSeparator).append('\n');
              }
            }
            else {
    - sb.append(entry.getKey()).append('=').append(get(entry.getKey())).append('\n');
    + sb.append(entry.getKey()).append('=').append(conf.get(entry.getKey())).append('\n');
            }
          }
    - sb.append("END========WebHCat AppConfig.iterator()========: \n");
    - sb.append(TempletonUtils.dumpPropMap("========WebHCat System.getProperties()========", System.getProperties()));
    - return sb.toString();
        }
    +
        public void startCleanup() {
          JobState.getStorageInstance(this).startCleanup(this);
        }

    http://git-wip-us.apache.org/repos/asf/hive/blob/c84f8613/hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/SecureProxySupport.java
    ----------------------------------------------------------------------
    diff --git a/hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/SecureProxySupport.java b/hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/SecureProxySupport.java
    index b4687b5..1ef5f27 100644
    --- a/hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/SecureProxySupport.java
    +++ b/hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/SecureProxySupport.java
    @@ -86,6 +86,9 @@ public class SecureProxySupport {
            } catch (Exception e) {
              throw new IOException(e);
            }
    + if(hcatTokenStr == null) {
    + LOG.error("open(" + user + ") token=null");
    + }
            Token<?> msToken = new Token();
            msToken.decodeFromUrlString(hcatTokenStr);
            msToken.setService(new Text(HCAT_SERVICE));
    @@ -175,11 +178,10 @@ public class SecureProxySupport {
        }

        private String buildHcatDelegationToken(String user)
    - throws IOException, InterruptedException, MetaException, TException {
    + throws IOException, InterruptedException, TException {
          final HiveConf c = new HiveConf();
          final IMetaStoreClient client = HCatUtil.getHiveMetastoreClient(c);
          LOG.info("user: " + user + " loginUser: " + UserGroupInformation.getLoginUser().getUserName());
    - final TokenWrapper twrapper = new TokenWrapper();
          final UserGroupInformation ugi = UgiFactory.getUgi(user);
          String s = ugi.doAs(new PrivilegedExceptionAction<String>() {
            public String run()

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupcommits @
categorieshive, hadoop
postedJul 9, '15 at 12:54a
activeJul 9, '15 at 1:08a
posts2
users1
websitehive.apache.org

1 user in discussion

Ekoifman: 2 posts

People

Translate

site design / logo © 2021 Grokbase