You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@storm.apache.org by ka...@apache.org on 2018/02/01 14:16:05 UTC
[2/3] storm git commit: STORM-2906 Pick HBase delegation token
properly while handling HBase auth via delegation token
STORM-2906 Pick HBase delegation token properly while handling HBase auth via delegation token
* log to warn if there's more than one HBase auth tokens
Project: http://git-wip-us.apache.org/repos/asf/storm/repo
Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/609a4a78
Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/609a4a78
Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/609a4a78
Branch: refs/heads/master
Commit: 609a4a78f2a762f784648a6a57af060abd089d7c
Parents: d291f39
Author: Jungtaek Lim <ka...@gmail.com>
Authored: Wed Jan 24 14:40:15 2018 +0900
Committer: Jungtaek Lim <ka...@gmail.com>
Committed: Wed Jan 24 14:40:15 2018 +0900
----------------------------------------------------------------------
.../main/java/org/apache/storm/hbase/common/Utils.java | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/storm/blob/609a4a78/external/storm-hbase/src/main/java/org/apache/storm/hbase/common/Utils.java
----------------------------------------------------------------------
diff --git a/external/storm-hbase/src/main/java/org/apache/storm/hbase/common/Utils.java b/external/storm-hbase/src/main/java/org/apache/storm/hbase/common/Utils.java
index f56f9e0..981d4ff 100644
--- a/external/storm-hbase/src/main/java/org/apache/storm/hbase/common/Utils.java
+++ b/external/storm-hbase/src/main/java/org/apache/storm/hbase/common/Utils.java
@@ -57,12 +57,17 @@ public class Utils {
// which ensures toString() implementation
if (token.getKind().toString().equals(TOKEN_KIND_HBASE_AUTH_TOKEN)) {
// use UGI from token
- LOG.debug("Found HBASE_AUTH_TOKEN - using the token to replace current user.");
+ if (!foundHBaseAuthToken) {
+ LOG.debug("Found HBASE_AUTH_TOKEN - using the token to replace current user.");
- ugi = token.decodeIdentifier().getUser();
- ugi.addToken(token);
+ ugi = token.decodeIdentifier().getUser();
+ ugi.addToken(token);
- foundHBaseAuthToken = true;
+ foundHBaseAuthToken = true;
+ } else {
+ LOG.warn("Found multiple HBASE_AUTH_TOKEN - will use already found token. " +
+ "Please enable DEBUG log level to track delegation tokens.");
+ }
}
}