Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 23 additions & 2 deletions contrib/native/client/example/querySubmitter.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
Expand All @@ -24,7 +25,7 @@
#include <boost/algorithm/string/join.hpp>
#include "drill/drillc.hpp"

int nOptions=15;
int nOptions=19;

struct Option{
char name[32];
Expand All @@ -45,7 +46,11 @@ struct Option{
{"heartbeatFrequency", "Heartbeat frequency (second). Disabled if set to 0.", false},
{"user", "Username", false},
{"password", "Password", false},
{"saslPluginPath", "Path to where SASL plugins are installed", false}
{"saslPluginPath", "Path to where SASL plugins are installed", false},
{"service_host", "Service host for Kerberos", false},
{"service_name", "Service name for Kerberos", false},
{"auth", "Authentication mechanism to use", false},
{"sasl_encrypt", "Negotiate for encrypted connection", false}
};

std::map<std::string, std::string> qsOptionValues;
Expand Down Expand Up @@ -295,6 +300,10 @@ int main(int argc, char* argv[]) {
std::string user=qsOptionValues["user"];
std::string password=qsOptionValues["password"];
std::string saslPluginPath=qsOptionValues["saslPluginPath"];
std::string sasl_encrypt=qsOptionValues["sasl_encrypt"];
std::string serviceHost=qsOptionValues["service_host"];
std::string serviceName=qsOptionValues["service_name"];
std::string auth=qsOptionValues["auth"];

Drill::QueryType type;

Expand Down Expand Up @@ -371,6 +380,18 @@ int main(int argc, char* argv[]) {
if(password.length()>0){
props.setProperty(USERPROP_PASSWORD, password);
}
if(sasl_encrypt.length()>0){
props.setProperty(USERPROP_SASL_ENCRYPT, sasl_encrypt);
}
if(serviceHost.length()>0){
props.setProperty(USERPROP_SERVICE_HOST, serviceHost);
}
if(serviceName.length()>0){
props.setProperty(USERPROP_SERVICE_NAME, serviceName);
}
if(auth.length()>0){
props.setProperty(USERPROP_AUTH_MECHANISM, auth);
}

if(client.connect(connectStr.c_str(), &props)!=Drill::CONN_SUCCESS){
std::cerr<< "Failed to connect with error: "<< client.getError() << " (Using:"<<connectStr<<")"<<std::endl;
Expand Down
6 changes: 4 additions & 2 deletions contrib/native/client/readme.macos
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ Install Prerequisites
or use brew to install
$> brew install cmake

2.0) Install cppunit
$> brew install cppunit

2.1) Install protobuf 2.5.0 (or higher)
$> brew install protobuf
Expand All @@ -54,7 +56,7 @@ Install Prerequisites
When changes have been introduced to the protocol module, you might need to refresh the protobuf C++ source files too.
$> cd DRILL_DIR/contrib/native/client
$> mkdir build
$> cd build && cmake3 -G "XCode" -D CMAKE_BUILD_TYPE=Debug ..
$> cd build && cmake -G "Xcode" -D CMAKE_BUILD_TYPE=Debug ..
$> xcodebuild -project drillclient.xcodeproj -configuration ${BUILDTYPE} -target fixProtobufs
$> xcodebuild -project drillclient.xcodeproj -configuration ${BUILDTYPE} -target cpProtobufs

Expand All @@ -64,7 +66,7 @@ Build drill client
-------------------
$> cd DRILL_DIR/contrib/native/client
$> mkdir build
$> cd build && cmake3 -G "XCode" -D CMAKE_BUILD_TYPE=Debug ..
$> cd build && cmake -G "Xcode" -D CMAKE_BUILD_TYPE=Debug ..
$> xcodebuild -project drillclient.xcodeproj -configuration ${BUILDTYPE} -target ALL_BUILD


Expand Down
1 change: 1 addition & 0 deletions contrib/native/client/src/clientlib/drillClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ const std::map<std::string, uint32_t> DrillUserProperties::USER_PROPERTIES=boos
( USERPROP_USESSL, USERPROP_FLAGS_BOOLEAN|USERPROP_FLAGS_SSLPROP)
( USERPROP_FILEPATH, USERPROP_FLAGS_STRING|USERPROP_FLAGS_SSLPROP|USERPROP_FLAGS_FILEPATH)
( USERPROP_FILENAME, USERPROP_FLAGS_STRING|USERPROP_FLAGS_SSLPROP|USERPROP_FLAGS_FILENAME)
( USERPROP_SASL_ENCRYPT, USERPROP_FLAGS_STRING)
;

bool DrillUserProperties::validate(std::string& err){
Expand Down
Loading