aboutsummaryrefslogtreecommitdiff
path: root/contrib/native/client/src/include
diff options
context:
space:
mode:
authorLaurent Goujon <laurent@dremio.com>2017-01-25 10:52:31 -0800
committerParth Chandra <pchandra@maprtech.com>2017-02-03 17:41:44 -0800
commit53ca55f91c40dcc488d6ecbd08b3e04907b62399 (patch)
tree50ca561fa05551673abcac9a7fdd7612d03ad37e /contrib/native/client/src/include
parent63ae6cffc23f1de8159217da9a8879b9ffb86423 (diff)
DRILL-5220: Provide API to set application/client names in C++ connector
Add method to DrillClientConfig to set the client and the application names in the C++ connector. Allow the ODBC driver (or any user of the C++ connector) to provide more specific informations like the application using the client. This closes #728
Diffstat (limited to 'contrib/native/client/src/include')
-rw-r--r--contrib/native/client/src/include/drill/drillClient.hpp42
1 files changed, 42 insertions, 0 deletions
diff --git a/contrib/native/client/src/include/drill/drillClient.hpp b/contrib/native/client/src/include/drill/drillClient.hpp
index 29ae6c284..00ff72344 100644
--- a/contrib/native/client/src/include/drill/drillClient.hpp
+++ b/contrib/native/client/src/include/drill/drillClient.hpp
@@ -91,6 +91,43 @@ class DECLSPEC_DRILL_CLIENT DrillClientConfig{
static int32_t getQueryTimeout();
static int32_t getHeartbeatFrequency();
static logLevel_t getLogLevel();
+
+ /**
+ * Return the client name sent to the server when connecting
+ *
+ * @return the current client name
+ */
+ static const std::string& getClientName();
+
+ /**
+ * Set the client name to be sent to the server when connecting.
+ *
+ * Only new connections will use the new value. Existing connections
+ * will be left unchanged.
+ *
+ * @param name the name to be send to the server
+ */
+ static void setClientName(const std::string& name);
+
+ /**
+ * Return the application name sent to the server when connecting
+ *
+ * @return the current application name
+ */
+ static const std::string& getApplicationName();
+
+ /**
+ * Set the application name to be sent to the server when connecting.
+ *
+ * Only new connections will use the new value. Existing connections
+ * will be left unchanged.
+ *
+ * @param name the name to be send to the server
+ */
+ static void setApplicationName(const std::string& name);
+
+
+
private:
// The logging level
static logLevel_t s_logLevel;
@@ -122,6 +159,11 @@ class DECLSPEC_DRILL_CLIENT DrillClientConfig{
static int32_t s_queryTimeout;
static int32_t s_heartbeatFrequency;
static boost::mutex s_mutex;
+
+ // The client name (default to DRILL_CONNECTOR_NAME)
+ static std::string s_clientName;
+ // The application name (default to <empty>)
+ static std::string s_applicationName;
};