From df0f0af3d963c1b65eb01c3141fe84532c53f5a5 Mon Sep 17 00:00:00 2001 From: Parth Chandra Date: Fri, 12 Feb 2016 15:42:53 -0800 Subject: DRILL-4313: C++ Client - Thread safe Logging. Improved Drill bit selection. - Update random drill bit selection. Shuffle the list initially, then round robin. Add Utility methods to get random numbers and to shuffle and add vectors. Whitespace cleanup - Add Git properties to build and print to log. - Add interface to get error based on query handle. - Add support for Pooled connections. Allows switching between pooled and unpooled connections based on environment variables --- contrib/native/client/src/include/drill/common.hpp | 9 ++++++++- contrib/native/client/src/include/drill/drillClient.hpp | 7 ++++++- 2 files changed, 14 insertions(+), 2 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 bb8e2b4a3..a617dc71f 100644 --- a/contrib/native/client/src/include/drill/common.hpp +++ b/contrib/native/client/src/include/drill/common.hpp @@ -45,6 +45,11 @@ #define MEM_CHUNK_SIZE 64*1024; // 64K #define MAX_MEM_ALLOC_SIZE 256*1024*1024; // 256 MB +#define MAX_BATCH_SIZE 65536; // see RecordBatch.java +#define ENABLE_CONNECTION_POOL_ENV "DRILL_ENABLE_CONN_POOL" +#define DEFAULT_MAX_CONCURRENT_CONNECTIONS 10 +#define MAX_CONCURRENT_CONNECTIONS_ENV "DRILL_MAX_CONN" + #ifdef _DEBUG #define EXTRA_DEBUGGING #define CODER_DEBUGGING @@ -110,7 +115,9 @@ typedef enum{ CONN_HOSTNAME_RESOLUTION_ERROR=6, CONN_AUTH_FAILED=7, CONN_BAD_RPC_VER=8, - CONN_DEAD=9 + CONN_DEAD=9, + CONN_NOTCONNECTED=10, + CONN_ALREADYCONNECTED=11 } connectionStatus_t; typedef enum{ diff --git a/contrib/native/client/src/include/drill/drillClient.hpp b/contrib/native/client/src/include/drill/drillClient.hpp index 4568ca1fc..a74f4bdc7 100644 --- a/contrib/native/client/src/include/drill/drillClient.hpp +++ b/contrib/native/client/src/include/drill/drillClient.hpp @@ -53,6 +53,7 @@ namespace exec{ namespace Drill{ //struct UserServerEndPoint; +class DrillClientImplBase; class DrillClientImpl; class DrillClientQueryResult; class FieldMetadata; @@ -339,6 +340,10 @@ class DECLSPEC_DRILL_CLIENT DrillClient{ */ std::string& getError(); + /* + * Returns the error message associated with the query handle + */ + const std::string& getError(QueryHandle_t handle); /* * Applications using the async query submit method can register a listener for schema changes * @@ -369,7 +374,7 @@ class DECLSPEC_DRILL_CLIENT DrillClient{ static DrillClientInitializer s_init; static DrillClientConfig s_config; - DrillClientImpl * m_pImpl; + DrillClientImplBase * m_pImpl; }; } // namespace Drill -- cgit v1.2.3