Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id E794C200C05 for ; Mon, 23 Jan 2017 10:52:31 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id E6357160B3E; Mon, 23 Jan 2017 09:52:31 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 3AE97160B49 for ; Mon, 23 Jan 2017 10:52:31 +0100 (CET) Received: (qmail 74861 invoked by uid 500); 23 Jan 2017 09:52:30 -0000 Mailing-List: contact issues-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list issues@hbase.apache.org Received: (qmail 74725 invoked by uid 99); 23 Jan 2017 09:52:30 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 23 Jan 2017 09:52:30 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id AA64FC1313 for ; Mon, 23 Jan 2017 09:52:29 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -1.199 X-Spam-Level: X-Spam-Status: No, score=-1.199 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RP_MATCHES_RCVD=-2.999] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id p4kvCyB3TLfx for ; Mon, 23 Jan 2017 09:52:28 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 4DFD95FAD8 for ; Mon, 23 Jan 2017 09:52:28 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 3F7DBE0389 for ; Mon, 23 Jan 2017 09:52:27 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 988242528B for ; Mon, 23 Jan 2017 09:52:26 +0000 (UTC) Date: Mon, 23 Jan 2017 09:52:26 +0000 (UTC) From: "Heng Chen (JIRA)" To: issues@hbase.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HBASE-17503) [C++] Configuration should be settable and used w/o XML files MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Mon, 23 Jan 2017 09:52:32 -0000 [ https://issues.apache.org/jira/browse/HBASE-17503?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15834162#comment-15834162 ] Heng Chen commented on HBASE-17503: ----------------------------------- {code} +void Configuration::SetInt(const std::string &key, const int32_t value) { + Set(key, boost::lexical_cast(value)); +} + +void Configuration::SetLong(const std::string &key, const int64_t value) { + Set(key, boost::lexical_cast(value)); +} + +void Configuration::SetDouble(const std::string &key, const double value) { + Set(key, boost::lexical_cast(value)); +} + +void Configuration::SetBool(const std::string &key, const bool value) { + Set(key, boost::lexical_cast(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)