drill-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject [10/27] drill git commit: DRILL-5301: Add C++ client support for Server metadata API
Date Thu, 02 Mar 2017 20:59:37 GMT
DRILL-5301: Add C++ client support for Server metadata API

Add support to the Server metadata API to the C++ client if
available. If the API is not supported to the server, fallback
to the previous hard-coded values.

Update the querySubmitter example program to query the information.

close #764


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

Branch: refs/heads/master
Commit: d3238b1b2270533285025d69b35906506212f492
Parents: d2e0f41
Author: Laurent Goujon <laurent@dremio.com>
Authored: Sun Feb 26 10:23:59 2017 -0800
Committer: Jinfeng Ni <jni@apache.org>
Committed: Wed Mar 1 23:15:32 2017 -0800

----------------------------------------------------------------------
 .../native/client/example/querySubmitter.cpp    |   88 +-
 contrib/native/client/readme.boost              |    2 +-
 .../client/src/clientlib/drillClientImpl.cpp    |  119 +-
 .../client/src/clientlib/drillClientImpl.hpp    |   17 +-
 .../native/client/src/clientlib/metadata.cpp    | 1680 +--
 .../native/client/src/clientlib/metadata.hpp    |  215 +-
 .../client/src/include/drill/drillClient.hpp    |   43 +-
 contrib/native/client/src/protobuf/User.pb.cc   | 3844 ++++++-
 contrib/native/client/src/protobuf/User.pb.h    | 9971 +++++++++++-------
 9 files changed, 11565 insertions(+), 4414 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/drill/blob/d3238b1b/contrib/native/client/example/querySubmitter.cpp
----------------------------------------------------------------------
diff --git a/contrib/native/client/example/querySubmitter.cpp b/contrib/native/client/example/querySubmitter.cpp
index 5b85a3e..5990897 100644
--- a/contrib/native/client/example/querySubmitter.cpp
+++ b/contrib/native/client/example/querySubmitter.cpp
@@ -21,6 +21,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <boost/thread.hpp>
+#include <boost/algorithm/string/join.hpp>
 #include "drill/drillc.hpp"
 
 int nOptions=15;
@@ -32,12 +33,12 @@ struct Option{
 }qsOptions[]= {
     {"plan", "Plan files separated by semicolons", false},
     {"query", "Query strings, separated by semicolons", false},
-    {"type", "Query type [physical|logical|sql]", true},
+    {"type", "Query type [physical|logical|sql|server]", true},
     {"connectStr", "Connect string", true},
     {"schema", "Default schema", false},
-    {"api", "API type [sync|async]", true},
+    {"api", "API type [sync|async|meta]", true},
     {"logLevel", "Logging level [trace|debug|info|warn|error|fatal]", false},
-    {"testCancel", "Cancel the query afterthe first record batch.", false},
+    {"testCancel", "Cancel the query after the first record batch.", false},
     {"syncSend", "Send query only after previous result is received", false},
     {"hshakeTimeout", "Handshake timeout (second).", false},
     {"queryTimeout", "Query timeout (second).", false},
@@ -55,12 +56,12 @@ bool bSyncSend=false;
 
 Drill::status_t SchemaListener(void* ctx, Drill::FieldDefPtr fields, Drill::DrillClientError*
err){
     if(!err){
-        printf("SCHEMA CHANGE DETECTED:\n");
+        std::cout<< "SCHEMA CHANGE DETECTED:" << std::endl;
         for(size_t i=0; i<fields->size(); i++){
             std::string name= fields->at(i)->getName();
-            printf("%s\t", name.c_str());
+            std::cout << name << "\t";
         }
-        printf("\n");
+        std::cout << std::endl;
         return Drill::QRY_SUCCESS ;
     }else{
         std::cerr<< "ERROR: " << err->msg << std::endl;
@@ -113,6 +114,7 @@ void print(const Drill::FieldMetadata* pFieldMetadata, void* buf, size_t
sz){
             switch (mode) {
                 case common::DM_REQUIRED:
                     sprintf((char*)printBuffer, "%lld", *(uint64_t*)buf);
+                    break;
                 case common::DM_OPTIONAL:
                     break;
                 case common::DM_REPEATED:
@@ -123,6 +125,7 @@ void print(const Drill::FieldMetadata* pFieldMetadata, void* buf, size_t
sz){
             switch (mode) {
                 case common::DM_REQUIRED:
                     memcpy(printBuffer, buf, sz);
+                    break;
                 case common::DM_OPTIONAL:
                     break;
                 case common::DM_REPEATED:
@@ -133,6 +136,7 @@ void print(const Drill::FieldMetadata* pFieldMetadata, void* buf, size_t
sz){
             switch (mode) {
                 case common::DM_REQUIRED:
                     memcpy(printBuffer, buf, sz);
+                    break;
                 case common::DM_OPTIONAL:
                     break;
                 case common::DM_REPEATED:
@@ -233,6 +237,9 @@ int readQueries(const std::string& queryList, std::vector<std::string>&
queries)
 }
 
 bool validate(const std::string& type, const std::string& query, const std::string&
plan){
+	if (type != "sync" || type != "async") {
+		return true;
+	}
     if(query.empty() && plan.empty()){
         std::cerr<< "Either query or plan must be specified"<<std::endl;
         return false;    }
@@ -365,14 +372,77 @@ int main(int argc, char* argv[]) {
             props.setProperty(USERPROP_PASSWORD, password);
         }
 
-        props.setProperty("someRandomProperty", "someRandomValue");
-
         if(client.connect(connectStr.c_str(), &props)!=Drill::CONN_SUCCESS){
             std::cerr<< "Failed to connect with error: "<< client.getError()
<< " (Using:"<<connectStr<<")"<<std::endl;
             return -1;
         }
         std::cout<< "Connected!\n" << std::endl;
-        if(api=="sync"){
+        if(api=="meta") {
+        	Drill::Metadata* metadata = client.getMetadata();
+        	if (metadata) {
+        		std::cout << "Connector:" << std::endl;
+        		std::cout << "\tname:" << metadata->getConnectorName() <<
std::endl;
+        		std::cout << "\tversion:" << metadata->getConnectorVersion() <<
std::endl;
+        		std::cout << std::endl;
+        		std::cout << "Server:" << std::endl;
+        		std::cout << "\tname:" << metadata->getServerName() << std::endl;
+        		std::cout << "\tversion:" << metadata->getServerVersion() <<
std::endl;
+        		std::cout << std::endl;
+        		std::cout << "Metadata:" << std::endl;
+        		std::cout << "\tall tables are selectable: " << metadata->areAllTableSelectable()
<< std::endl;
+        		std::cout << "\tcatalog separator: " << metadata->getCatalogSeparator()
<< std::endl;
+        		std::cout << "\tcatalog term: " << metadata->getCatalogTerm() <<
std::endl;
+        		std::cout << "\tCOLLATE support: " << metadata->getCollateSupport()
<< std::endl;
+        		std::cout << "\tcorrelation names: " << metadata->getCorrelationNames()
<< std::endl;
+        		std::cout << "\tdate time functions: " << boost::algorithm::join(metadata->getDateTimeFunctions(),
", ") << std::endl;
+        		std::cout << "\tdate time literals support: " << metadata->getDateTimeLiteralsSupport()
<< std::endl;
+        		std::cout << "\tGROUP BY support: " << metadata->getGroupBySupport()
<< std::endl;
+        		std::cout << "\tidentifier case: " << metadata->getIdentifierCase()
<< std::endl;
+        		std::cout << "\tidentifier quote string: " << metadata->getIdentifierQuoteString()
<< std::endl;
+        		std::cout << "\tmax binary literal length: " << metadata->getMaxBinaryLiteralLength()
<< std::endl;
+        		std::cout << "\tmax catalog name length: " << metadata->getMaxCatalogNameLength()
<< std::endl;
+        		std::cout << "\tmax char literal length: " << metadata->getMaxCharLiteralLength()
<< std::endl;
+        		std::cout << "\tmax column name length: " << metadata->getMaxColumnNameLength()
<< std::endl;
+        		std::cout << "\tmax columns in GROUP BY: " << metadata->getMaxColumnsInGroupBy()
<< std::endl;
+        		std::cout << "\tmax columns in ORDER BY: " << metadata->getMaxColumnsInOrderBy()
<< std::endl;
+        		std::cout << "\tmax columns in SELECT: " << metadata->getMaxColumnsInSelect()
<< std::endl;
+        		std::cout << "\tmax cursor name length: " << metadata->getMaxCursorNameLength()
<< std::endl;
+        		std::cout << "\tmax logical lob size: " << metadata->getMaxLogicalLobSize()
<< std::endl;
+        		std::cout << "\tmax row size: " << metadata->getMaxRowSize() <<
std::endl;
+        		std::cout << "\tmax schema name length: " << metadata->getMaxSchemaNameLength()
<< std::endl;
+        		std::cout << "\tmax statement length: " << metadata->getMaxStatementLength()
<< std::endl;
+        		std::cout << "\tmax statements: " << metadata->getMaxStatements()
<< std::endl;
+        		std::cout << "\tmax table name length: " << metadata->getMaxTableNameLength()
<< std::endl;
+        		std::cout << "\tmax tables in SELECT: " << metadata->getMaxTablesInSelect()
<< std::endl;
+        		std::cout << "\tmax user name length: " << metadata->getMaxUserNameLength()
<< std::endl;
+        		std::cout << "\tNULL collation: " << metadata->getNullCollation()
<< std::endl;
+        		std::cout << "\tnumeric functions: " << boost::algorithm::join(metadata->getNumericFunctions(),
", ") << std::endl;
+        		std::cout << "\tOUTER JOIN support: " << metadata->getOuterJoinSupport()
<< std::endl;
+        		std::cout << "\tquoted identifier case: " << metadata->getQuotedIdentifierCase()
<< std::endl;
+        		std::cout << "\tSQL keywords: " << boost::algorithm::join(metadata->getSQLKeywords(),
",") << std::endl;
+        		std::cout << "\tschema term: " << metadata->getSchemaTerm() <<
std::endl;
+        		std::cout << "\tsearch escape string: " << metadata->getSearchEscapeString()
<< std::endl;
+        		std::cout << "\tspecial characters: " << metadata->getSpecialCharacters()
<< std::endl;
+        		std::cout << "\tstring functions: " << boost::algorithm::join(metadata->getStringFunctions(),
",") << std::endl;
+        		std::cout << "\tsub query support: " << metadata->getSubQuerySupport()
<< std::endl;
+        		std::cout << "\tsystem functions: " << boost::algorithm::join(metadata->getSystemFunctions(),
",") << std::endl;
+        		std::cout << "\ttable term: " << metadata->getTableTerm() <<
std::endl;
+        		std::cout << "\tUNION support: " << metadata->getUnionSupport()
<< std::endl;
+        		std::cout << "\tBLOB included in max row size: " << metadata->isBlobIncludedInMaxRowSize()
<< std::endl;
+        		std::cout << "\tcatalog at start: " << metadata->isCatalogAtStart()
<< std::endl;
+        		std::cout << "\tcolumn aliasing supported: " << metadata->isColumnAliasingSupported()
<< std::endl;
+        		std::cout << "\tLIKE escape clause supported: " << metadata->isLikeEscapeClauseSupported()
<< std::endl;
+        		std::cout << "\tNULL plus non NULL equals to NULL: " << metadata->isNullPlusNonNullNull()
<< std::endl;
+        		std::cout << "\tread-only: " << metadata->isReadOnly() <<
std::endl;
+        		std::cout << "\tSELECT FOR UPDATE supported: " << metadata->isSelectForUpdateSupported()
<< std::endl;
+        		std::cout << "\ttransaction supported: " << metadata->isTransactionSupported()
<< std::endl;
+        		std::cout << "\tunrelated columns in ORDER BY supported: " << metadata->isUnrelatedColumnsInOrderBySupported()
<< std::endl;
+
+        		client.freeMetadata(&metadata);
+        	} else {
+        		std::cerr << "Cannot get metadata:" << client.getError() << std::endl;
+        	}
+        } else if(api=="sync"){
             Drill::DrillClientError* err=NULL;
             Drill::status_t ret;
             int nQueries=0;

http://git-wip-us.apache.org/repos/asf/drill/blob/d3238b1b/contrib/native/client/readme.boost
----------------------------------------------------------------------
diff --git a/contrib/native/client/readme.boost b/contrib/native/client/readme.boost
index a6035e4..39a7bfb 100644
--- a/contrib/native/client/readme.boost
+++ b/contrib/native/client/readme.boost
@@ -34,7 +34,7 @@ $ cd $BOOST_BUILD_DIR/drill_boost_1_60_0
 # the following builds a subset of boost without icu. You may need to add more modules to
include icu. 
 # bcp documentation can be found here: http://www.boost.org/doc/libs/1_60_0/tools/bcp/doc/html/index.html
 
-$ $BOOST_BUILD_DIR/boost_1_60_0/dist/bin/bcp --namespace=drill_boost --namespace-alias --boost=$BOOST_BUILD_DIR/boost_1_60_0/
shared_ptr random context chrono date_time regex system timer thread asio smart_ptr bind config
build regex config assign functional multiprecision $BOOST_BUILD_DIR/drill_boost_1_60_0 
+$ $BOOST_BUILD_DIR/boost_1_60_0/dist/bin/bcp --namespace=drill_boost --namespace-alias --boost=$BOOST_BUILD_DIR/boost_1_60_0/
shared_ptr random context chrono date_time regex system timer thread asio smart_ptr bind config
build regex config assign functional multiprecision algorithm $BOOST_BUILD_DIR/drill_boost_1_60_0

 
 $ cd $BOOST_BUILD_DIR/drill_boost_1_60_0
 $ ./bootstrap.sh --prefix=$BOOST_BUILD_DIR/drill_boost_1_60_0/

http://git-wip-us.apache.org/repos/asf/drill/blob/d3238b1b/contrib/native/client/src/clientlib/drillClientImpl.cpp
----------------------------------------------------------------------
diff --git a/contrib/native/client/src/clientlib/drillClientImpl.cpp b/contrib/native/client/src/clientlib/drillClientImpl.cpp
index 4486068..808595c 100644
--- a/contrib/native/client/src/clientlib/drillClientImpl.cpp
+++ b/contrib/native/client/src/clientlib/drillClientImpl.cpp
@@ -47,7 +47,7 @@
 #include "saslAuthenticatorImpl.hpp"
 
 namespace Drill{
-
+namespace { // anonymous namespace
 static std::map<exec::shared::QueryResult_QueryState, status_t> QUERYSTATE_TO_STATUS_MAP
= boost::assign::map_list_of
     (exec::shared::QueryResult_QueryState_STARTING, QRY_PENDING)
     (exec::shared::QueryResult_QueryState_RUNNING, QRY_RUNNING)
@@ -60,6 +60,13 @@ static std::string debugPrintQid(const exec::shared::QueryId& qid){
     return std::string("[")+boost::lexical_cast<std::string>(qid.part1()) +std::string(":")
+ boost::lexical_cast<std::string>(qid.part2())+std::string("] ");
 }
 
+// Convertion helper
+struct ToRpcType: public std::unary_function<google::protobuf::int32, exec::user::RpcType>
{
+	exec::user::RpcType operator() (google::protobuf::int32 i) const {
+		return static_cast<exec::user::RpcType>(i);
+	}
+};
+}
 connectionStatus_t DrillClientImpl::connect(const char* connStr, DrillUserProperties* props){
     std::string pathToDrill, protocol, hostPortStr;
     std::string host;
@@ -319,6 +326,9 @@ void DrillClientImpl::handleHandshake(ByteBuf_t _buf,
         this->m_handshakeErrorId=b2u.errorid();
         this->m_handshakeErrorMsg=b2u.errormessage();
         this->m_serverInfos = b2u.server_infos();
+        std::transform(b2u.supported_methods().begin(), b2u.supported_methods().end(),
+        		std::back_inserter(this->m_supportedMethods),
+        		ToRpcType());
         for (int i=0; i<b2u.authenticationmechanisms_size(); i++) {
             std::string mechanism = b2u.authenticationmechanisms(i);
             boost::algorithm::to_lower(mechanism);
@@ -1324,6 +1334,44 @@ status_t DrillClientImpl::processColumnsResult(AllocatedBufferPtr allocatedBuffe
     return ret;
 }
 
+status_t DrillClientImpl::processServerMetaResult(AllocatedBufferPtr allocatedBuffer, const
rpc::InBoundRpcMessage& msg ){
+    DRILL_MT_LOG(DRILL_LOG(LOG_DEBUG) << "Processing GetServerMetaResp with coordination
id:" << msg.m_coord_id << std::endl;)
+    status_t ret=QRY_SUCCESS;
+
+    // make sure to deallocate buffer
+    boost::shared_ptr<AllocatedBuffer> deallocationGuard(allocatedBuffer);
+    boost::lock_guard<boost::mutex> lock(m_dcMutex);
+
+    if(msg.m_coord_id==0){
+         DRILL_MT_LOG(DRILL_LOG(LOG_TRACE) << "DrillClientImpl::processServerMetaResult:
m_coord_id=0. Ignore and return QRY_SUCCESS." << std::endl;)
+        return QRY_SUCCESS;
+    }
+    std::map<int,DrillClientQueryHandle*>::const_iterator it=this->m_queryHandles.find(msg.m_coord_id);
+    if(it!=this->m_queryHandles.end()){
+        DrillClientServerMetaHandle* pHandle=static_cast<DrillClientServerMetaHandle*>((*it).second);
+        exec::user::GetServerMetaResp* resp = new exec::user::GetServerMetaResp();
+        DRILL_MT_LOG(DRILL_LOG(LOG_TRACE)  << "Received GetServerMetaResp result Handle
" << msg.m_pbody.size() << std::endl;)
+        if (!(resp->ParseFromArray(msg.m_pbody.data(), msg.m_pbody.size()))) {
+            return handleQryError(QRY_COMM_ERROR, "Cannot decode GetServerMetaResp results",
pHandle);
+        }
+        if (resp->status() != exec::user::OK) {
+            return handleQryError(QRY_FAILED, resp->error(), pHandle);
+        }
+        pHandle->notifyListener(&(resp->server_meta()), NULL);
+        DRILL_MT_LOG(DRILL_LOG(LOG_DEBUG) << "GetServerMetaResp result " << std::endl;)
+    }else{
+        return handleQryError(QRY_INTERNAL_ERROR, getMessage(ERR_QRY_INVQUERYID), NULL);
+    }
+    m_pendingRequests--;
+    DRILL_MT_LOG(DRILL_LOG(LOG_TRACE) << "DrillClientImpl::processServerMetaResult:
" << m_pendingRequests << " requests pending." << std::endl;)
+    if(m_pendingRequests==0){
+        // signal any waiting client that it can exit because there are no more any query
results to arrive.
+        // We keep the heartbeat going though.
+        m_cv.notify_one();
+    }
+    return ret;
+}
+
 DrillClientQueryResult* DrillClientImpl::findQueryResult(const exec::shared::QueryId&
qid){
     DrillClientQueryResult* pDrillClientQueryResult=NULL;
     DRILL_MT_LOG(DRILL_LOG(LOG_DEBUG) << "Searching for Query Id - " << debugPrintQid(qid)
<< std::endl;)
@@ -1508,6 +1556,10 @@ void DrillClientImpl::handleRead(ByteBuf_t _buf,
             processSaslChallenge(allocatedBuffer, msg);
             break;
 
+        case exec::user::SERVER_META:
+        	processServerMetaResult(allocatedBuffer, msg);
+        	break;
+
         case exec::user::ACK:
             // Cancel requests will result in an ACK sent back.
             // Consume silently
@@ -1722,8 +1774,71 @@ void DrillClientImpl::shutdownSocket(){
     DRILL_MT_LOG(DRILL_LOG(LOG_TRACE) << "Socket shutdown" << std::endl;)
 }
 
+namespace { // anonymous
+
+}
+
+namespace { // anonymous
+// Helper class to wait on ServerMeta results
+struct ServerMetaContext {
+	bool m_done;
+	status_t m_status;
+	exec::user::ServerMeta m_serverMeta;
+	boost::mutex m_mutex;
+	boost::condition_variable m_cv;
+
+	static status_t listener(void* ctx, const exec::user::ServerMeta* serverMeta, DrillClientError*
err) {
+		ServerMetaContext* context = static_cast<ServerMetaContext*>(ctx);
+			if (err) {
+				context->m_status = QRY_FAILURE;
+			} else {
+				context->m_status = QRY_SUCCESS;
+				context->m_serverMeta.CopyFrom(*serverMeta);
+			}
+
+			{
+				boost::lock_guard<boost::mutex> lock(context->m_mutex);
+				context->m_done = true;
+			}
+			context->m_cv.notify_one();
+			return QRY_SUCCESS;
+		}
+};
+}
+
 meta::DrillMetadata* DrillClientImpl::getMetadata() {
-    return new meta::DrillMetadata(*this);
+	DRILL_MT_LOG(DRILL_LOG(LOG_TRACE) << "Getting metadata" << std::endl;)
+	if (std::find(m_supportedMethods.begin(), m_supportedMethods.end(), exec::user::GET_SERVER_META)
== m_supportedMethods.end()) {
+		DRILL_MT_LOG(DRILL_LOG(LOG_TRACE) << "Server metadata not supported " << m_supportedMethods.size()
<< ". Falling back to default." << std::endl;)
+		return new meta::DrillMetadata(*this, meta::DrillMetadata::s_defaultServerMeta);
+	}
+
+	DRILL_MT_LOG(DRILL_LOG(LOG_TRACE) << "Server metadata supported." << std::endl;)
+	exec::user::GetServerMetaReq req;
+	ServerMetaContext ctx;
+	boost::function<DrillClientServerMetaHandle*(int32_t)> factory = boost::bind(
+	            boost::factory<DrillClientServerMetaHandle*>(),
+	            boost::ref(*this),
+	            _1,
+				ServerMetaContext::listener,
+	            &ctx);
+	// Getting a query handle, and make sure to free when done
+	boost::shared_ptr<DrillClientServerMetaHandle> handle = boost::shared_ptr<DrillClientServerMetaHandle>(
+					sendMsg(factory, exec::user::GET_SERVER_META, req),
+					boost::bind(&DrillClientImpl::freeQueryResources, this, _1));
+	{
+		boost::unique_lock<boost::mutex> lock(ctx.m_mutex);
+		while(!ctx.m_done) {
+			ctx.m_cv.wait(lock);
+		}
+	}
+
+	DRILL_MT_LOG(DRILL_LOG(LOG_TRACE) << "Server metadata received." << std::endl;)
+	if (ctx.m_status != QRY_SUCCESS) {
+		return NULL;
+	}
+	return new meta::DrillMetadata(*this, ctx.m_serverMeta);
+
 }
 
 void DrillClientImpl::freeMetadata(meta::DrillMetadata* metadata) {

http://git-wip-us.apache.org/repos/asf/drill/blob/d3238b1b/contrib/native/client/src/clientlib/drillClientImpl.hpp
----------------------------------------------------------------------
diff --git a/contrib/native/client/src/clientlib/drillClientImpl.hpp b/contrib/native/client/src/clientlib/drillClientImpl.hpp
index 262edc9..5eb850d 100644
--- a/contrib/native/client/src/clientlib/drillClientImpl.hpp
+++ b/contrib/native/client/src/clientlib/drillClientImpl.hpp
@@ -201,7 +201,7 @@ class DrillClientQueryResult: public DrillClientBaseHandle<pfnQueryResultsListen
         m_pSchemaListener(NULL) {
     };
 
-    ~DrillClientQueryResult(){
+    virtual ~DrillClientQueryResult(){
         this->clearAndDestroy();
     };
 
@@ -307,6 +307,18 @@ class DrillClientPrepareHandle: public DrillClientBaseHandle<pfnPreparedStatemen
     ::exec::user::PreparedStatementHandle m_preparedStatementHandle;
 };
 
+typedef status_t (*pfnServerMetaListener)(void* ctx, const exec::user::ServerMeta* serverMeta,
DrillClientError* err);
+class DrillClientServerMetaHandle: public DrillClientBaseHandle<pfnServerMetaListener,
const exec::user::ServerMeta*> {
+    public:
+	DrillClientServerMetaHandle(DrillClientImpl& client, int32_t coordId, pfnServerMetaListener
listener, void* listenerCtx):
+    	DrillClientBaseHandle<pfnServerMetaListener, const exec::user::ServerMeta*>(client,
coordId, "server meta", listener, listenerCtx) {
+    };
+
+    private:
+    friend class DrillClientImpl;
+
+};
+
 template<typename Listener, typename MetaType, typename MetaImpl, typename MetadataResult>
 class DrillClientMetadataResult: public DrillClientBaseHandle<Listener, const DrillCollection<MetaType>*>
{
 public:
@@ -364,6 +376,7 @@ class DrillClientImpl : public DrillClientImplBase{
             m_handshakeStatus(exec::user::SUCCESS),
             m_bIsConnected(false),
             m_saslAuthenticator(NULL),
+    		m_saslResultCode(SASL_OK),
             m_saslDone(false),
             m_pendingRequests(0),
             m_pError(NULL),
@@ -487,6 +500,7 @@ class DrillClientImpl : public DrillClientImplBase{
         status_t processSchemasResult(AllocatedBufferPtr allocatedBuffer, const rpc::InBoundRpcMessage&
msg );
         status_t processTablesResult(AllocatedBufferPtr allocatedBuffer, const rpc::InBoundRpcMessage&
msg );
         status_t processColumnsResult(AllocatedBufferPtr allocatedBuffer, const rpc::InBoundRpcMessage&
msg );
+        status_t processServerMetaResult(AllocatedBufferPtr allocatedBuffer, const rpc::InBoundRpcMessage&
msg );
         DrillClientQueryResult* findQueryResult(const exec::shared::QueryId& qid);
         status_t processQueryStatusResult( exec::shared::QueryResult* qr,
                 DrillClientQueryResult* pDrillClientQueryResult);
@@ -533,6 +547,7 @@ class DrillClientImpl : public DrillClientImplBase{
         std::string m_handshakeErrorId;
         std::string m_handshakeErrorMsg;
         exec::user::RpcEndpointInfos m_serverInfos;
+        std::vector<exec::user::RpcType> m_supportedMethods;
         bool m_bIsConnected;
 
         std::vector<std::string> m_serverAuthMechanisms;


Mime
View raw message