From ffbb9c7adc6360744bee186e1f69d47dc743f73e Mon Sep 17 00:00:00 2001 From: Parth Chandra Date: Fri, 8 May 2015 17:53:39 -0700 Subject: DRILL-2998: Implement heartbeat in C++ client --- contrib/native/client/src/include/drill/common.hpp | 3 ++- contrib/native/client/src/include/drill/drillClient.hpp | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) (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 2fa09545c..da411499d 100644 --- a/contrib/native/client/src/include/drill/common.hpp +++ b/contrib/native/client/src/include/drill/common.hpp @@ -109,7 +109,8 @@ typedef enum{ CONN_HANDSHAKE_TIMEOUT=5, CONN_HOSTNAME_RESOLUTION_ERROR=6, CONN_AUTH_FAILED=7, - CONN_BAD_RPC_VER=8 + CONN_BAD_RPC_VER=8, + CONN_DEAD=9 } 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 d7bf33c07..4568ca1fc 100644 --- a/contrib/native/client/src/include/drill/drillClient.hpp +++ b/contrib/native/client/src/include/drill/drillClient.hpp @@ -101,9 +101,11 @@ class DECLSPEC_DRILL_CLIENT DrillClientConfig{ static void setSocketTimeout(int32_t l); static void setHandshakeTimeout(int32_t l); static void setQueryTimeout(int32_t l); + static void setHeartbeatFrequency(int32_t l); static int32_t getSocketTimeout(); static int32_t getHandshakeTimeout(); static int32_t getQueryTimeout(); + static int32_t getHeartbeatFrequency(); static logLevel_t getLogLevel(); private: // The logging level @@ -127,10 +129,14 @@ class DECLSPEC_DRILL_CLIENT DrillClientConfig{ * * s_queryTimeout: (default 180) * place a timeout on waiting result of querying. + * + * s_heartbeatFrequency: (default 30) + * Seconds of idle activity after which a heartbeat is sent to the drillbit */ static int32_t s_socketTimeout; static int32_t s_handshakeTimeout; static int32_t s_queryTimeout; + static int32_t s_heartbeatFrequency; static boost::mutex s_mutex; }; @@ -215,6 +221,7 @@ class DECLSPEC_DRILL_CLIENT RecordIterator{ void registerSchemaChangeListener(pfnSchemaListener l); + bool hasError(); /* * Returns the last error message */ -- cgit v1.2.3