You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@drill.apache.org by pa...@apache.org on 2017/02/08 06:24:02 UTC

[4/4] drill git commit: DRILL-5219: Relax user properties validation in C++ client

DRILL-5219: Relax user properties validation in C++ client

Unlike Java client, C++ client only allows user properties present in a
whitelist. Relax this restriction so that user can add extra properties.

This closes #727


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

Branch: refs/heads/master
Commit: 2b5f5428af6951c71461c2bd2253e184ad0c4631
Parents: 478de24
Author: Laurent Goujon <la...@dremio.com>
Authored: Wed Jan 25 10:32:33 2017 -0800
Committer: Parth Chandra <pc...@maprtech.com>
Committed: Tue Feb 7 22:22:53 2017 -0800

----------------------------------------------------------------------
 contrib/native/client/src/clientlib/drillClient.cpp     | 6 +-----
 contrib/native/client/src/clientlib/drillClientImpl.cpp | 9 +++++++--
 2 files changed, 8 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/drill/blob/2b5f5428/contrib/native/client/src/clientlib/drillClient.cpp
----------------------------------------------------------------------
diff --git a/contrib/native/client/src/clientlib/drillClient.cpp b/contrib/native/client/src/clientlib/drillClient.cpp
index b456d17..f97a25c 100644
--- a/contrib/native/client/src/clientlib/drillClient.cpp
+++ b/contrib/native/client/src/clientlib/drillClient.cpp
@@ -367,11 +367,7 @@ connectionStatus_t DrillClient::connect(const char* connectStr, DrillUserPropert
     connectionStatus_t ret=CONN_SUCCESS;
     ret=this->m_pImpl->connect(connectStr);
     if(ret==CONN_SUCCESS){
-        if(properties!=NULL){
-            ret=this->m_pImpl->validateHandshake(properties);
-        }else{
-            ret=this->m_pImpl->validateHandshake(NULL);
-        }
+        ret=this->m_pImpl->validateHandshake(properties);
     }
     return ret;
 }

http://git-wip-us.apache.org/repos/asf/drill/blob/2b5f5428/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 8794044..05171e5 100644
--- a/contrib/native/client/src/clientlib/drillClientImpl.cpp
+++ b/contrib/native/client/src/clientlib/drillClientImpl.cpp
@@ -370,8 +370,13 @@ connectionStatus_t DrillClientImpl::validateHandshake(DrillUserProperties* prope
         for(size_t i=0; i<properties->size(); i++){
             std::map<std::string,uint32_t>::const_iterator it=DrillUserProperties::USER_PROPERTIES.find(properties->keyAt(i));
             if(it==DrillUserProperties::USER_PROPERTIES.end()){
-                DRILL_MT_LOG(DRILL_LOG(LOG_WARNING) << "Connection property ("<< properties->keyAt(i)
-                    << ") is unknown and is being skipped" << std::endl;)
+                DRILL_MT_LOG(DRILL_LOG(LOG_INFO) << "Connection property ("<< properties->keyAt(i)
+                    << ") is unknown" << std::endl;)
+
+                exec::user::Property* connProp = userProperties->add_properties();
+                connProp->set_key(properties->keyAt(i));
+                connProp->set_value(properties->valueAt(i));
+
                 continue;
             }
             if(IS_BITSET((*it).second,USERPROP_FLAGS_SERVERPROP)){