Github user HeartSaVioR commented on a diff in the pull request:
https://github.com/apache/storm/pull/2527#discussion_r163216104
--- Diff:
external/storm-hbase/src/main/java/org/apache/storm/hbase/common/Utils.java ---
@@ -47,14 +48,28 @@ public static HTable getTable(UserProvider provider,
Configuration config, Strin
ugi = UserGroupInformation.getCurrentUser();
LOG.debug("UGI for current USER : {}", ugi.getUserName());
+ boolean foundHBaseAuthToken = false;
for (Token<? extends TokenIdentifier> token : ugi.getTokens())
{
LOG.debug("Token in UGI (delegation token): {} / {}",
token.toString(),
token.decodeIdentifier().getUser());
- // use UGI from token
- ugi = token.decodeIdentifier().getUser();
- ugi.addToken(token);
+ // token.getKind() = Text, Text is annotated by @Stringable
+ // 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.");
+
+ ugi = token.decodeIdentifier().getUser();
+ ugi.addToken(token);
+
+ foundHBaseAuthToken = true;
--- End diff --
I don't think if there's one HBase cluster needed to be connected in
worker, but not sure if there're more than one HBase clusters. If we need to
consider and handle multiple tokens, matching token would be completely
different scenario.
---