From f246c3cad7f44baeb8153913052ebc963c62276a Mon Sep 17 00:00:00 2001 From: Parth Chandra Date: Mon, 24 Jul 2017 12:55:02 -0700 Subject: DRILL-5431: SSL Support (C++) - Update DrillClientImpl to use Channel implementation Also remove ChannelContextFactory and merge it into ChannelFactory --- contrib/native/client/src/include/drill/common.hpp | 7 ++++++- .../client/src/include/drill/drillConfig.hpp | 22 +--------------------- .../client/src/include/drill/userProperties.hpp | 9 +++------ 3 files changed, 10 insertions(+), 28 deletions(-) (limited to 'contrib/native/client/src/include') diff --git a/contrib/native/client/src/include/drill/common.hpp b/contrib/native/client/src/include/drill/common.hpp index 012bd1974..d8e2da78d 100644 --- a/contrib/native/client/src/include/drill/common.hpp +++ b/contrib/native/client/src/include/drill/common.hpp @@ -165,6 +165,10 @@ typedef enum{ RET_FAILURE=1 } ret_t; +// Connect string protocol types +#define PROTOCOL_TYPE_ZK "zk" +#define PROTOCOL_TYPE_DIRECT "drillbit" +#define PROTOCOL_TYPE_DIRECT_2 "local" // User Property Names #define USERPROP_USERNAME "userName" @@ -173,7 +177,8 @@ typedef enum{ #define USERPROP_USESSL "enableTLS" #define USERPROP_TLSPROTOCOL "TLSProtocol" //TLS version #define USERPROP_CERTFILEPATH "certFilePath" // pem file path and name -#define USERPROP_CERTPASSWORD "certPassword" // Password for certificate file +// TODO: support truststore protected by password. +// #define USERPROP_CERTPASSWORD "certPassword" // Password for certificate file. #define USERPROP_DISABLE_HOSTVERIFICATION "disableHostVerification" #define USERPROP_DISABLE_CERTVERIFICATION "disableCertVerification" #define USERPROP_USESYSTEMTRUSTSTORE "useSystemTrustStore" //Windows only, use the system trust store diff --git a/contrib/native/client/src/include/drill/drillConfig.hpp b/contrib/native/client/src/include/drill/drillConfig.hpp index 669267d86..46bbbb2d2 100644 --- a/contrib/native/client/src/include/drill/drillConfig.hpp +++ b/contrib/native/client/src/include/drill/drillConfig.hpp @@ -21,27 +21,7 @@ #define DRILL_CONFIG_H #include "drill/common.hpp" -#include - - - -#if defined _WIN32 || defined __CYGWIN__ - #ifdef DRILL_CLIENT_EXPORTS - #define DECLSPEC_DRILL_CLIENT __declspec(dllexport) - #else - #ifdef USE_STATIC_LIBDRILL - #define DECLSPEC_DRILL_CLIENT - #else - #define DECLSPEC_DRILL_CLIENT __declspec(dllimport) - #endif - #endif -#else - #if __GNUC__ >= 4 - #define DECLSPEC_DRILL_CLIENT __attribute__ ((visibility ("default"))) - #else - #define DECLSPEC_DRILL_CLIENT - #endif -#endif +#include namespace exec{ namespace shared{ diff --git a/contrib/native/client/src/include/drill/userProperties.hpp b/contrib/native/client/src/include/drill/userProperties.hpp index 3490dce7a..62a04f787 100644 --- a/contrib/native/client/src/include/drill/userProperties.hpp +++ b/contrib/native/client/src/include/drill/userProperties.hpp @@ -36,20 +36,17 @@ class DECLSPEC_DRILL_CLIENT DrillUserProperties{ size_t size() const { return m_properties.size(); } - //const std::string& keyAt(size_t i) const { return m_properties.at(i).first; } - - //const std::string& valueAt(size_t i) const { return m_properties.at(i).second; } - const bool isPropSet(const std::string& key) const{ bool isSet=true; - auto f= m_properties.find(key); + std::map::const_iterator f=m_properties.find(key); if(f==m_properties.end()){ isSet=false; } return isSet; } + const std::string& getProp(const std::string& key, std::string& value) const{ - auto f= m_properties.find(key); + std::map::const_iterator f=m_properties.find(key); if(f!=m_properties.end()){ value=f->second; } -- cgit v1.2.3