hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From te...@apache.org
Subject svn commit: r1449819 - in /hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/thrift: ThriftServer.java ThriftServerRunner.java
Date Mon, 25 Feb 2013 19:21:22 GMT
Author: tedyu
Date: Mon Feb 25 19:21:22 2013
New Revision: 1449819

URL: http://svn.apache.org/r1449819
Log:
HBASE-7915 Secure ThriftServer needs to login before calling HBaseHandler (Arpit)


Modified:
    hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/thrift/ThriftServer.java
    hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/thrift/ThriftServerRunner.java

Modified: hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/thrift/ThriftServer.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/thrift/ThriftServer.java?rev=1449819&r1=1449818&r2=1449819&view=diff
==============================================================================
--- hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/thrift/ThriftServer.java (original)
+++ hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/thrift/ThriftServer.java Mon
Feb 25 19:21:22 2013
@@ -30,9 +30,12 @@ import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.hbase.HBaseConfiguration;
+import org.apache.hadoop.hbase.security.User;
 import org.apache.hadoop.hbase.thrift.ThriftServerRunner.ImplType;
 import org.apache.hadoop.hbase.util.InfoServer;
+import org.apache.hadoop.hbase.util.Strings;
 import org.apache.hadoop.hbase.util.VersionInfo;
+import org.apache.hadoop.net.DNS;
 import org.apache.hadoop.util.Shell.ExitCodeException;
 
 /**
@@ -86,6 +89,14 @@ public class ThriftServer {
    */
    void doMain(final String[] args) throws Exception {
      processOptions(args);
+     // login the server principal (if using secure Hadoop)
+     if (User.isSecurityEnabled() && User.isHBaseSecurityEnabled(conf)) {
+       String machineName = Strings.domainNamePointerToHostName(
+         DNS.getDefaultHost(conf.get("hbase.thrift.dns.interface", "default"),
+           conf.get("hbase.thrift.dns.nameserver", "default")));
+       User.login(conf, "hbase.thrift.keytab.file",
+           "hbase.thrift.kerberos.principal", machineName);
+     }
      serverRunner = new ThriftServerRunner(conf);
 
      // Put up info server.

Modified: hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/thrift/ThriftServerRunner.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/thrift/ThriftServerRunner.java?rev=1449819&r1=1449818&r2=1449819&view=diff
==============================================================================
--- hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/thrift/ThriftServerRunner.java
(original)
+++ hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/thrift/ThriftServerRunner.java
Mon Feb 25 19:21:22 2013
@@ -66,7 +66,6 @@ import org.apache.hadoop.hbase.filter.Fi
 import org.apache.hadoop.hbase.filter.ParseFilter;
 import org.apache.hadoop.hbase.filter.PrefixFilter;
 import org.apache.hadoop.hbase.filter.WhileMatchFilter;
-import org.apache.hadoop.hbase.security.User;
 import org.apache.hadoop.hbase.thrift.CallQueue.Call;
 import org.apache.hadoop.hbase.thrift.generated.AlreadyExists;
 import org.apache.hadoop.hbase.thrift.generated.BatchMutation;
@@ -82,9 +81,7 @@ import org.apache.hadoop.hbase.thrift.ge
 import org.apache.hadoop.hbase.thrift.generated.TScan;
 import org.apache.hadoop.hbase.util.Addressing;
 import org.apache.hadoop.hbase.util.Bytes;
-import org.apache.hadoop.hbase.util.Strings;
 import org.apache.hadoop.hbase.util.Writables;
-import org.apache.hadoop.net.DNS;
 import org.apache.thrift.TException;
 import org.apache.thrift.protocol.TBinaryProtocol;
 import org.apache.thrift.protocol.TCompactProtocol;
@@ -366,15 +363,6 @@ public class ThriftServerRunner implemen
           tserver.getClass().getName());
     }
 
-    // login the server principal (if using secure Hadoop)
-    if (User.isSecurityEnabled() && User.isHBaseSecurityEnabled(conf)) {
-      String machineName = Strings.domainNamePointerToHostName(
-        DNS.getDefaultHost(conf.get("hbase.thrift.dns.interface", "default"),
-          conf.get("hbase.thrift.dns.nameserver", "default")));
-      User.login(conf, "hbase.thrift.keytab.file",
-          "hbase.thrift.kerberos.principal", machineName);
-    }
-
     registerFilters(conf);
   }
 



Mime
View raw message