diff options
author | Rob Wu <robwu15@gmail.com> | 2017-11-14 23:27:29 -0800 |
---|---|---|
committer | Parth Chandra <parthc@apache.org> | 2017-11-16 17:28:06 -0800 |
commit | 5490f3dc0133fb9f0f24229e09c4cc053192ac5b (patch) | |
tree | 21f89ee94063e2d8f4a42cd412f4efe2bc54dafb /contrib/native/client/src/include | |
parent | acc5ed927e1fa4011ac1c3724d15197484b9f45b (diff) |
DRILL-5968: Add support for empty service_host user property
This closes #1037
Diffstat (limited to 'contrib/native/client/src/include')
-rw-r--r-- | contrib/native/client/src/include/drill/userProperties.hpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/contrib/native/client/src/include/drill/userProperties.hpp b/contrib/native/client/src/include/drill/userProperties.hpp index 62a04f787..f5d6783ea 100644 --- a/contrib/native/client/src/include/drill/userProperties.hpp +++ b/contrib/native/client/src/include/drill/userProperties.hpp @@ -28,6 +28,17 @@ class DECLSPEC_DRILL_CLIENT DrillUserProperties{ static const std::map<std::string, uint32_t> USER_PROPERTIES; DrillUserProperties(){}; + + /// @brief Update the property value associate with the property key if the value is + /// empty. + /// + /// @param in_propName The property name. + /// @param in_propValue The property value. + void setDefaultProperty(const std::string& in_propName, const std::string& in_propValue){ + if (!isPropSet(in_propName) || m_properties[in_propName].empty()){ + m_properties[in_propName] = in_propValue; + } + } void setProperty( const std::string& propName, const std::string& propValue){ std::pair< std::string, std::string> in = make_pair(propName, propValue); |