[ https://issues.apache.org/jira/browse/HBASE-17503?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15834162#comment-15834162 ]
Heng Chen edited comment on HBASE-17503 at 1/23/17 10:05 AM: ------------------------------------------------------------- {code} +void Configuration::SetInt(const std::string &key, const int32_t value) { + Set(key, boost::lexical_cast<std::string>(value)); +} + +void Configuration::SetLong(const std::string &key, const int64_t value) { + Set(key, boost::lexical_cast<std::string>(value)); +} + +void Configuration::SetDouble(const std::string &key, const double value) { + Set(key, boost::lexical_cast<std::string>(value)); +} + +void Configuration::SetBool(const std::string &key, const bool value) { + Set(key, boost::lexical_cast<std::string>(value)); +} {code} Hints: * According to google c++ code style, pass-in value should not use "const", only reference need it. :) * About GTest EXPECT_EQ function, the first param should the expected one, it seems we make the wrong order in the patch. :) was (Author: chenheng): {code} +void Configuration::SetInt(const std::string &key, const int32_t value) { + Set(key, boost::lexical_cast<std::string>(value)); +} + +void Configuration::SetLong(const std::string &key, const int64_t value) { + Set(key, boost::lexical_cast<std::string>(value)); +} + +void Configuration::SetDouble(const std::string &key, const double value) { + Set(key, boost::lexical_cast<std::string>(value)); +} + +void Configuration::SetBool(const std::string &key, const bool value) { + Set(key, boost::lexical_cast<std::string>(value)); +} {code} Hints: According to google c++ code style, pass-in value should not use "const", only reference need it. :) > [C++] Configuration should be settable and used w/o XML files > ------------------------------------------------------------- > > Key: HBASE-17503 > URL: https://issues.apache.org/jira/browse/HBASE-17503 > Project: HBase > Issue Type: Sub-task > Reporter: Enis Soztutar > Assignee: Enis Soztutar > Fix For: HBASE-14850 > > Attachments: hbase-17503_v1.patch > > > Configuration right now is read-only, and there is only XML based > configuration loader. > However, in testing, we need the Config object w/o the XML files, and we need > to be able to set specific values in the conf. -- This message was sent by Atlassian JIRA (v6.3.4#6332)