flume-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From w...@apache.org
Subject git commit: FLUME-1890. Flume should set the hbase keytab and principal in HBase conf object
Date Fri, 01 Feb 2013 04:54:11 GMT
Updated Branches:
  refs/heads/flume-1.4 3f0971cb9 -> 2419550b3


FLUME-1890. Flume should set the hbase keytab and principal in HBase conf object

(Hari Shreedharan via Will McQueen)


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

Branch: refs/heads/flume-1.4
Commit: 2419550b3497d858a2346d8d840229b8cf310dca
Parents: 3f0971c
Author: Will McQueen <will@cloudera.com>
Authored: Thu Jan 31 20:46:30 2013 -0800
Committer: Will McQueen <will@cloudera.com>
Committed: Thu Jan 31 20:46:30 2013 -0800

----------------------------------------------------------------------
 .../flume/sink/hbase/HBaseSinkSecurityManager.java |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flume/blob/2419550b/flume-ng-sinks/flume-ng-hbase-sink/src/main/java/org/apache/flume/sink/hbase/HBaseSinkSecurityManager.java
----------------------------------------------------------------------
diff --git a/flume-ng-sinks/flume-ng-hbase-sink/src/main/java/org/apache/flume/sink/hbase/HBaseSinkSecurityManager.java
b/flume-ng-sinks/flume-ng-hbase-sink/src/main/java/org/apache/flume/sink/hbase/HBaseSinkSecurityManager.java
index 8bf0509..762fce9 100644
--- a/flume-ng-sinks/flume-ng-hbase-sink/src/main/java/org/apache/flume/sink/hbase/HBaseSinkSecurityManager.java
+++ b/flume-ng-sinks/flume-ng-hbase-sink/src/main/java/org/apache/flume/sink/hbase/HBaseSinkSecurityManager.java
@@ -41,6 +41,8 @@ public class HBaseSinkSecurityManager {
    * this can just be volatile, no need of Atomic reference.
    */
   private volatile static KerberosUser loggedInUser;
+  private static final String FLUME_KEYTAB_KEY = "flume.keytab.key";
+  private static final String FLUME_PRINCIPAL_KEY = "flume.principal.key";
   private static final Logger LOG =
           LoggerFactory.getLogger(HBaseSinkSecurityManager.class);
 
@@ -119,7 +121,9 @@ public class HBaseSinkSecurityManager {
       if (hostname == null || hostname.isEmpty()) {
         hostname = InetAddress.getLocalHost().getCanonicalHostName();
       }
-      User.login(conf, kerberosKeytab, principal, hostname);
+      conf.set(FLUME_KEYTAB_KEY, kerberosKeytab);
+      conf.set(FLUME_PRINCIPAL_KEY, principal);
+      User.login(conf, FLUME_KEYTAB_KEY, FLUME_PRINCIPAL_KEY, hostname);
       hbaseUser = User.create(UserGroupInformation.getLoginUser());
       loggedInUser = newUser;
       //TODO: Set the loggedInUser to the current user.


Mime
View raw message