hawq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From w...@apache.org
Subject incubator-hawq git commit: HAWQ-51. Support Kerberos for libyarn
Date Mon, 19 Oct 2015 04:31:03 GMT
Repository: incubator-hawq
Updated Branches:
  refs/heads/master 6061349ae -> 52e970628


HAWQ-51. Support Kerberos for libyarn


Project: http://git-wip-us.apache.org/repos/asf/incubator-hawq/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-hawq/commit/52e97062
Tree: http://git-wip-us.apache.org/repos/asf/incubator-hawq/tree/52e97062
Diff: http://git-wip-us.apache.org/repos/asf/incubator-hawq/diff/52e97062

Branch: refs/heads/master
Commit: 52e970628d7e90a7320eac9e9135b4fae41a91c4
Parents: 6061349
Author: Wen Lin <wlin@pivotal.io>
Authored: Mon Oct 19 11:48:45 2015 +0800
Committer: Wen Lin <wlin@pivotal.io>
Committed: Mon Oct 19 11:48:45 2015 +0800

----------------------------------------------------------------------
 depends/libyarn/src/CMakeLists.txt              |  2 +-
 .../src/libyarnclient/ApplicationClient.cpp     | 12 ++---
 .../src/libyarnclient/ApplicationClient.h       | 57 +++++++++++++++++++-
 .../src/libyarnclient/ApplicationMaster.cpp     |  5 +-
 .../libyarn/src/libyarnclient/LibYarnClient.cpp | 40 ++++++++------
 .../libyarn/src/libyarnclient/LibYarnClient.h   |  4 +-
 .../src/libyarnclient/LibYarnClientC.cpp        |  9 ++--
 .../libyarn/src/libyarnclient/LibYarnClientC.h  |  2 +-
 .../libyarnserver/ApplicationClientProtocol.cpp | 29 +++++++---
 .../libyarnserver/ApplicationClientProtocol.h   | 11 ++--
 depends/libyarn/src/rpc/RpcChannel.cpp          |  4 +-
 depends/libyarn/src/rpc/SaslClient.cpp          | 23 ++------
 depends/libyarn/src/rpc/SaslClient.h            |  2 -
 13 files changed, 135 insertions(+), 65 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/52e97062/depends/libyarn/src/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/depends/libyarn/src/CMakeLists.txt b/depends/libyarn/src/CMakeLists.txt
index ecfa8bb..1ecf6ba 100644
--- a/depends/libyarn/src/CMakeLists.txt
+++ b/depends/libyarn/src/CMakeLists.txt
@@ -2,7 +2,7 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
 
 SET(libyarn_VERSION_MAJOR 0)
 SET(libyarn_VERSION_MINOR 1)
-SET(libyarn_VERSION_PATCH 3)
+SET(libyarn_VERSION_PATCH 4)
 SET(libyarn_VERSION_STRING "${libyarn_VERSION_MAJOR}.${libyarn_VERSION_MINOR}.${libyarn_VERSION_PATCH}")
 SET(libyarn_VERSION_API 1)
 SET(libyarn_ROOT_SOURCES_DIR ${CMAKE_SOURCE_DIR}/src)

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/52e97062/depends/libyarn/src/libyarnclient/ApplicationClient.cpp
----------------------------------------------------------------------
diff --git a/depends/libyarn/src/libyarnclient/ApplicationClient.cpp b/depends/libyarn/src/libyarnclient/ApplicationClient.cpp
index 4d586ea..cc72c5b 100644
--- a/depends/libyarn/src/libyarnclient/ApplicationClient.cpp
+++ b/depends/libyarn/src/libyarnclient/ApplicationClient.cpp
@@ -9,14 +9,12 @@
 
 namespace libyarn {
 
-ApplicationClient::ApplicationClient(string &host, string &port) {
+ApplicationClient::ApplicationClient(string &user, string &host, string &port)
{
 	std::string tokenService = "";
-	Yarn::Config config;
-	Yarn::Internal::SessionConfig sessionConfig(config);
-	Yarn::Internal::UserInfo user = Yarn::Internal::UserInfo::LocalUser();
-	Yarn::Internal::RpcAuth rpcAuth(user, Yarn::Internal::AuthMethod::SIMPLE);
-	appClient = (void*) new ApplicationClientProtocol(host, port, tokenService,
-			sessionConfig, rpcAuth);
+	Yarn::Internal::shared_ptr<Yarn::Config> conf = DefaultConfig().getConfig();
+	Yarn::Internal::SessionConfig sessionConfig(*conf);
+	LOG(INFO, "ApplicationClient session auth method : %s", sessionConfig.getRpcAuthMethod().c_str());
+	appClient = (void*) new ApplicationClientProtocol(user, host, port, tokenService, sessionConfig);
 }
 
 ApplicationClient::ApplicationClient(ApplicationClientProtocol *appclient){

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/52e97062/depends/libyarn/src/libyarnclient/ApplicationClient.h
----------------------------------------------------------------------
diff --git a/depends/libyarn/src/libyarnclient/ApplicationClient.h b/depends/libyarn/src/libyarnclient/ApplicationClient.h
index 2c3b9c1..ae81ea0 100644
--- a/depends/libyarn/src/libyarnclient/ApplicationClient.h
+++ b/depends/libyarn/src/libyarnclient/ApplicationClient.h
@@ -15,9 +15,58 @@ using namespace std;
 
 namespace libyarn {
 
+class DefaultConfig {
+public:
+    DefaultConfig() : conf(new Yarn::Config) {
+        bool reportError = false;
+        const char * env = getenv("LIBYARN_CONF");
+        std::string confPath = env ? env : "";
+
+        if (!confPath.empty()) {
+            size_t pos = confPath.find_first_of('=');
+
+            if (pos != confPath.npos) {
+                confPath = confPath.c_str() + pos + 1;
+            }
+
+            reportError = true;
+        } else {
+            confPath = "yarn-client.xml";
+        }
+
+        init(confPath, reportError);
+    }
+
+    DefaultConfig(const char * path) : conf(new Yarn::Config) {
+        assert(path != NULL && strlen(path) > 0);
+        init(path, true);
+    }
+
+    Yarn::Internal::shared_ptr<Yarn::Config> getConfig() {
+        return conf;
+    }
+
+private:
+    void init(const std::string & confPath, bool reportError) {
+        if (access(confPath.c_str(), R_OK)) {
+            if (reportError) {
+                LOG(LOG_ERROR,
+                    "Environment variable LIBYARN_CONF is set but %s cannot be read",
+                    confPath.c_str());
+            } else {
+                return;
+            }
+        }
+
+        conf->update(confPath.c_str());
+    }
+private:
+    Yarn::Internal::shared_ptr<Yarn::Config> conf;
+};
+
 class ApplicationClient {
 public:
-	ApplicationClient(string &host, string &port);
+	ApplicationClient(string &user, string &host, string &port);
 
 	ApplicationClient(ApplicationClientProtocol *appclient);
 
@@ -45,6 +94,12 @@ public:
 
 	virtual list<QueueUserACLInfo> getQueueAclsInfo();
 
+    const std::string & getUser() const {return ((ApplicationClientProtocol*)appClient)->getUser();};
+
+    AuthMethod getMethod() const {return ((ApplicationClientProtocol*)appClient)->getMethod();};
+
+    const std::string getPrincipal() const {return ((ApplicationClientProtocol*)appClient)->getPrincipal();};
+
 private:
 	void *appClient;
 };

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/52e97062/depends/libyarn/src/libyarnclient/ApplicationMaster.cpp
----------------------------------------------------------------------
diff --git a/depends/libyarn/src/libyarnclient/ApplicationMaster.cpp b/depends/libyarn/src/libyarnclient/ApplicationMaster.cpp
index 6d23f9a..0d26082 100644
--- a/depends/libyarn/src/libyarnclient/ApplicationMaster.cpp
+++ b/depends/libyarn/src/libyarnclient/ApplicationMaster.cpp
@@ -5,12 +5,13 @@
 #include "common/SessionConfig.h"
 
 #include "ApplicationMaster.h"
+#include "ApplicationClient.h"
 
 namespace libyarn {
 ApplicationMaster::ApplicationMaster(string &schedHost, string &schedPort,
 		UserInfo &user, const string &tokenService) {
-	Config config;
-	SessionConfig sessionConfig(config);
+	Yarn::Internal::shared_ptr<Yarn::Config> conf = DefaultConfig().getConfig();
+	Yarn::Internal::SessionConfig sessionConfig(*conf);
 	RpcAuth rpcAuth(user, AuthMethod::TOKEN);
 	rmClient = (void*) new ApplicationMasterProtocol(schedHost,
 			schedPort, tokenService, sessionConfig, rpcAuth);

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/52e97062/depends/libyarn/src/libyarnclient/LibYarnClient.cpp
----------------------------------------------------------------------
diff --git a/depends/libyarn/src/libyarnclient/LibYarnClient.cpp b/depends/libyarn/src/libyarnclient/LibYarnClient.cpp
index cce0a04..eb5718c 100644
--- a/depends/libyarn/src/libyarnclient/LibYarnClient.cpp
+++ b/depends/libyarn/src/libyarnclient/LibYarnClient.cpp
@@ -17,17 +17,17 @@ using namespace Yarn::Internal;
 
 namespace libyarn {
 
-LibYarnClient::LibYarnClient(string &rmHost, string &rmPort,
+LibYarnClient::LibYarnClient(string &user, string &rmHost, string &rmPort,
 		string &schedHost, string &schedPort, string &amHost,
 		int32_t amPort, string &am_tracking_url,int heartbeatInterval) :
-		schedHost(schedHost), schedPort(schedPort), amHost(amHost),
+		amUser(user), schedHost(schedHost), schedPort(schedPort), amHost(amHost),
 		amPort(amPort), am_tracking_url(am_tracking_url),
 		heartbeatInterval(heartbeatInterval),clientJobId(""),response_id(0),
 		keepRun(true){
         pthread_mutex_init( &(heartbeatLock), NULL );
 
 		amrmClient = NULL;
-		appClient = (void*) new ApplicationClient(rmHost, rmPort);
+		appClient = (void*) new ApplicationClient(user, rmHost, rmPort);
 		nmClient = (void*) new ContainerManagement();
 }
 #ifdef MOCKTEST
@@ -107,10 +107,10 @@ int LibYarnClient::createJob(string &jobName, string &queue,string
&jobId) {
     	if (clientJobId != ""){
     		throw std::invalid_argument( "Exist an application for the client");
     	}
-        ApplicationClient *appClientAlias = (ApplicationClient*)appClient;
+        ApplicationClient *applicationClient = (ApplicationClient*)appClient;
 
         //1. getNewApplication
-        ApplicationID appId = appClientAlias->getNewApplication();
+        ApplicationID appId = applicationClient->getNewApplication();
         LOG(INFO, "LibYarnClient::createJob, getNewApplication finished, appId:[clusterTimeStamp:%lld,id:%d]",
                 appId.getClusterTimestamp(), appId.getId());
 
@@ -129,13 +129,13 @@ int LibYarnClient::createJob(string &jobName, string &queue,string
&jobId) {
         appSubmitCtx.setUnmanagedAM(true);
         appSubmitCtx.setMaxAppAttempts(1);
 
-        appClientAlias->submitApplication(appSubmitCtx);
+        applicationClient->submitApplication(appSubmitCtx);
         LOG(INFO, "LibYarnClient::createJob, submitApplication finished");
 
         //3. wait util AM is ACCEPTED and return the AMRMToken
         ApplicationReport report;
         while (true) {
-            report = appClientAlias->getApplicationReport(appId);
+            report = applicationClient->getApplicationReport(appId);
             LOG(INFO,"LibYarnClient::createJob, appId[cluster_timestamp:%lld,id:%d], appState:%d",
                     appId.getClusterTimestamp(), appId.getId(), report.getYarnApplicationState());
             if ((report.getAMRMToken().getPassword() != "") && report.getYarnApplicationState()
== YarnApplicationState::ACCEPTED) {
@@ -150,15 +150,23 @@ int LibYarnClient::createJob(string &jobName, string &queue,string
&jobId) {
 
         //4.1 new ApplicationMaster
         Token token = report.getAMRMToken();
-        UserInfo user = UserInfo::LocalUser();
-        Yarn::Token anotherToken;
-        anotherToken.setIdentifier(token.getIdentifier());
-        anotherToken.setKind(token.getKind());
-        anotherToken.setPassword(token.getPassword());
-        anotherToken.setService(token.getService());
-
-        //LOG(INFO,"%s",token.getIdentifier());
-        user.addToken(anotherToken);
+        UserInfo user;
+        if (applicationClient->getMethod() == SIMPLE)
+			user = UserInfo::LocalUser();
+		else if (applicationClient->getMethod() == KERBEROS) {
+			user.setEffectiveUser(applicationClient->getPrincipal());
+			user.setRealUser(applicationClient->getUser());
+		} else {
+			LOG(WARNING, "LibYarnClient::createJob: unsupported RPC method:%d. ", applicationClient->getMethod());
+		}
+
+		Yarn::Token AMToken;
+		AMToken.setIdentifier(token.getIdentifier());
+		AMToken.setKind(token.getKind());
+		AMToken.setPassword(token.getPassword());
+		AMToken.setService(token.getService());
+
+        user.addToken(AMToken);
 #ifndef MOCKTEST
         amrmClient = (void*) new ApplicationMaster(this->schedHost, this->schedPort,
                 user, token.getService());

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/52e97062/depends/libyarn/src/libyarnclient/LibYarnClient.h
----------------------------------------------------------------------
diff --git a/depends/libyarn/src/libyarnclient/LibYarnClient.h b/depends/libyarn/src/libyarnclient/LibYarnClient.h
index d6cec20..ce6a213 100644
--- a/depends/libyarn/src/libyarnclient/LibYarnClient.h
+++ b/depends/libyarn/src/libyarnclient/LibYarnClient.h
@@ -25,7 +25,7 @@
 namespace libyarn {
 	class LibYarnClient {
 	public:
-		LibYarnClient(string &rmHost, string &rmPort, string &schedHost,
+		LibYarnClient(string &user, string &rmHost, string &rmPort, string &schedHost,
 				string &schedPort, string &amHost, int32_t amPort,
 				string &am_tracking_url, int heartbeatInterval);
 
@@ -99,6 +99,8 @@ namespace libyarn {
 		ApplicationID clientAppId;
 		ApplicationAttemptId clientAppAttempId;
 
+		// the user of running AM, default is postgres
+		string amUser;
 		string schedHost;
 		string schedPort;
 

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/52e97062/depends/libyarn/src/libyarnclient/LibYarnClientC.cpp
----------------------------------------------------------------------
diff --git a/depends/libyarn/src/libyarnclient/LibYarnClientC.cpp b/depends/libyarn/src/libyarnclient/LibYarnClientC.cpp
index 72b4e1f..916b2c6 100644
--- a/depends/libyarn/src/libyarnclient/LibYarnClientC.cpp
+++ b/depends/libyarn/src/libyarnclient/LibYarnClientC.cpp
@@ -15,10 +15,10 @@ extern "C" {
 
 	struct LibYarnClient_wrapper {
 		public:
-			LibYarnClient_wrapper(string &rmHost, string &rmPort, string &schedHost,
+			LibYarnClient_wrapper(string &rmUser, string &rmHost, string &rmPort, string
&schedHost,
 							string &schedPort, string &amHost, int32_t amPort,
 							string &am_tracking_url,int heartbeatInterval) {
-				client = new LibYarnClient(rmHost, rmPort, schedHost, schedPort, amHost,
+				client = new LibYarnClient(rmUser, rmHost, rmPort, schedHost, schedPort, amHost,
 								amPort, am_tracking_url,heartbeatInterval);
 			}
 
@@ -121,16 +121,17 @@ extern "C" {
 		errorMessage = errorMsg;
 	}
 
-	int  newLibYarnClient(char *rmHost, char *rmPort,
+	int  newLibYarnClient(char* user, char *rmHost, char *rmPort,
 					char *schedHost, char *schedPort, char *amHost,
 					int32_t amPort, char *am_tracking_url,LibYarnClient_t **client,int heartbeatInterval)
{
+		string userStr(user);
 		string rmHostStr(rmHost);
 		string rmPortStr(rmPort);
 		string schedHostStr(schedHost);
 		string schedPortStr(schedPort);
 		string amHostStr(amHost);
 		string amTrackingUrlStr(am_tracking_url);
-		*client =  new LibYarnClient_t(rmHostStr, rmPortStr, schedHostStr, schedPortStr,
+		*client =  new LibYarnClient_t(userStr, rmHostStr, rmPortStr, schedHostStr, schedPortStr,
 						amHostStr, amPort, amTrackingUrlStr,heartbeatInterval);
 		return FUNCTION_SUCCEEDED;
 	}

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/52e97062/depends/libyarn/src/libyarnclient/LibYarnClientC.h
----------------------------------------------------------------------
diff --git a/depends/libyarn/src/libyarnclient/LibYarnClientC.h b/depends/libyarn/src/libyarnclient/LibYarnClientC.h
index ef40f58..6b02ec7 100644
--- a/depends/libyarn/src/libyarnclient/LibYarnClientC.h
+++ b/depends/libyarn/src/libyarnclient/LibYarnClientC.h
@@ -130,7 +130,7 @@ const char* getErrorMessage();
 
 void setErrorMessage(const char* errorMsg);
 
-int newLibYarnClient(char *rmHost, char *rmPort,
+int newLibYarnClient(char* user, char *rmHost, char *rmPort,
 				char *schedHost, char *schedPort, char *amHost,
 				int32_t amPort, char *am_tracking_url,LibYarnClient_t **client,int heartbeatInterval);
 

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/52e97062/depends/libyarn/src/libyarnserver/ApplicationClientProtocol.cpp
----------------------------------------------------------------------
diff --git a/depends/libyarn/src/libyarnserver/ApplicationClientProtocol.cpp b/depends/libyarn/src/libyarnserver/ApplicationClientProtocol.cpp
index 5b45f7f..71bc3e9 100644
--- a/depends/libyarn/src/libyarnserver/ApplicationClientProtocol.cpp
+++ b/depends/libyarn/src/libyarnserver/ApplicationClientProtocol.cpp
@@ -15,12 +15,29 @@ using namespace Yarn;
 
 namespace libyarn {
 
-ApplicationClientProtocol::ApplicationClientProtocol(const string & rmHost,
-		const string & rmPort, const string & tokenService,
-		const SessionConfig & c, const RpcAuth & a) :
-		auth(a), client(RpcClient::getClient()), conf(c), protocol(
-		APP_CLIENT_PROTOCOL_VERSION, APP_CLIENT_PROTOCOL,
-		APP_CLIENT_DELEGATION_TOKEN_KIND), server(tokenService, rmHost, rmPort) {
+ApplicationClientProtocol::ApplicationClientProtocol(const string &rmUser,
+			const string & rmHost, const string & rmPort,
+			const string & tokenService,const SessionConfig & c) :
+			client(RpcClient::getClient()), conf(c),
+			protocol(APP_CLIENT_PROTOCOL_VERSION, APP_CLIENT_PROTOCOL,APP_CLIENT_DELEGATION_TOKEN_KIND),
+			server(tokenService, rmHost, rmPort) {
+
+	/* create RpcAuth for rpc method,
+	 * can be SIMPLE or KERBEROS
+	 * */
+	if (RpcAuth::ParseMethod(c.getRpcAuthMethod()) == KERBEROS) {
+		/*
+		 * If using KERBEROS, rmUser should be principal name.
+		 */
+		Yarn::Internal::UserInfo user(rmUser);
+		user.setRealUser(user.getEffectiveUser());
+		Yarn::Internal::RpcAuth rpcAuth(user, KERBEROS);
+		auth = rpcAuth;
+	} else {
+		Yarn::Internal::UserInfo user = Yarn::Internal::UserInfo::LocalUser();
+		Yarn::Internal::RpcAuth rpcAuth(user, SIMPLE);
+		auth = rpcAuth;
+	}
 }
 
 ApplicationClientProtocol::~ApplicationClientProtocol() {

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/52e97062/depends/libyarn/src/libyarnserver/ApplicationClientProtocol.h
----------------------------------------------------------------------
diff --git a/depends/libyarn/src/libyarnserver/ApplicationClientProtocol.h b/depends/libyarn/src/libyarnserver/ApplicationClientProtocol.h
index 840f713..853f85b 100644
--- a/depends/libyarn/src/libyarnserver/ApplicationClientProtocol.h
+++ b/depends/libyarn/src/libyarnserver/ApplicationClientProtocol.h
@@ -44,9 +44,8 @@ namespace libyarn {
 
 class ApplicationClientProtocol {
 public:
-	ApplicationClientProtocol(const string & rmHost, const string & rmPort,
-			const string & tokenService, const SessionConfig & c,
-			const RpcAuth & a);
+	ApplicationClientProtocol(const string &user, const string &rmHost, const string
&rmPort,
+			const string &tokenService, const SessionConfig &c);
 
 	virtual ~ApplicationClientProtocol();
 
@@ -74,6 +73,12 @@ public:
 
 	virtual GetQueueUserAclsInfoResponse getQueueAclsInfo(GetQueueUserAclsInfoRequest &request);
 
+	const string & getUser() {return auth.getUser().getRealUser();};
+
+	AuthMethod getMethod() {return auth.getMethod();};
+
+	const string getPrincipal() {return auth.getUser().getPrincipal();};
+
 private:
 	void invoke(const RpcCall & call);
 

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/52e97062/depends/libyarn/src/rpc/RpcChannel.cpp
----------------------------------------------------------------------
diff --git a/depends/libyarn/src/rpc/RpcChannel.cpp b/depends/libyarn/src/rpc/RpcChannel.cpp
index 3e48cf7..00f45b1 100644
--- a/depends/libyarn/src/rpc/RpcChannel.cpp
+++ b/depends/libyarn/src/rpc/RpcChannel.cpp
@@ -634,7 +634,7 @@ void RpcChannelImpl::sendConnectionHeader(const RpcAuth &auth) {
 void RpcChannelImpl::buildConnectionContext(
     hadoop::common::IpcConnectionContextProto & connectionContext, const RpcAuth &
auth) {
     connectionContext.set_protocol(key.getProtocol().getProtocol());
-    std::string euser = key.getAuth().getUser().getPrincipal();
+    std::string euser = key.getAuth().getUser().getEffectiveUser();
     std::string ruser = key.getAuth().getUser().getRealUser();
 
     if (auth.getMethod() != AuthMethod::TOKEN) {
@@ -686,8 +686,10 @@ RpcRemoteCallPtr RpcChannelImpl::getPendingCall(int32_t id) {
 bool RpcChannelImpl::getResponse() {
     int idleTimeout = key.getConf().getMaxIdleTime();
     int pingTimeout = key.getConf().getPingTimeout();
+    int timeout = key.getConf().getRpcTimeout();
     int interval = pingTimeout < idleTimeout ? pingTimeout : idleTimeout;
     interval /= 2;
+    interval = interval < timeout ? interval : timeout;
     steady_clock::time_point s = steady_clock::now();
 
     while (client.isRunning()) {

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/52e97062/depends/libyarn/src/rpc/SaslClient.cpp
----------------------------------------------------------------------
diff --git a/depends/libyarn/src/rpc/SaslClient.cpp b/depends/libyarn/src/rpc/SaslClient.cpp
index 865f907..14d5276 100644
--- a/depends/libyarn/src/rpc/SaslClient.cpp
+++ b/depends/libyarn/src/rpc/SaslClient.cpp
@@ -122,6 +122,9 @@ std::string SaslClient::evaluateChallenge(const std::string & challenge)
{
             free(output);
         }
     } else {
+        if (output) {
+            free(output);
+        }
         THROW(AccessControlException, "Failed to evaluate challenge: %s", gsasl_strerror(rc));
     }
 
@@ -136,26 +139,6 @@ bool SaslClient::isComplete() {
     return complete;
 }
 
-std::string SaslClient::getQOP() {
-    const char * retval = gsasl_property_get(session, GSASL_QOP);
-    std::string qop = retval == NULL ? "" : retval;
-    std::transform(qop.begin(), qop.end(), qop.begin(), ::tolower);
-
-    if (qop.find("auth") != qop.npos) {
-        return "auth";
-    }
-
-    if (qop.find("int") != qop.npos) {
-        return "int";
-    }
-
-    if (qop.find("conf") != qop.npos) {
-        return "conf";
-    }
-
-    return "auth";
-}
-
 }
 }
 

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/52e97062/depends/libyarn/src/rpc/SaslClient.h
----------------------------------------------------------------------
diff --git a/depends/libyarn/src/rpc/SaslClient.h b/depends/libyarn/src/rpc/SaslClient.h
index 4cd7754..0424b43 100644
--- a/depends/libyarn/src/rpc/SaslClient.h
+++ b/depends/libyarn/src/rpc/SaslClient.h
@@ -30,8 +30,6 @@ public:
 
     bool isComplete();
 
-    std::string getQOP();
-
 private:
     void initKerberos(const hadoop::common::RpcSaslProto_SaslAuth & auth,
                       const std::string & principal);


Mime
View raw message