From commits-return-82920-archive-asf-public=cust-asf.ponee.io@hbase.apache.org Tue Feb 5 10:08:38 2019 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id B310D180608 for ; Tue, 5 Feb 2019 11:08:37 +0100 (CET) Received: (qmail 9668 invoked by uid 500); 5 Feb 2019 10:08:36 -0000 Mailing-List: contact commits-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hbase.apache.org Delivered-To: mailing list commits@hbase.apache.org Received: (qmail 9659 invoked by uid 99); 5 Feb 2019 10:08:36 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 05 Feb 2019 10:08:36 +0000 Received: by gitbox.apache.org (ASF Mail Server at gitbox.apache.org, from userid 33) id 15EFE881DD; Tue, 5 Feb 2019 10:08:36 +0000 (UTC) Date: Tue, 05 Feb 2019 10:08:36 +0000 To: "commits@hbase.apache.org" Subject: [hbase] branch branch-2.0 updated: HBASE-21727 Simplify documentation around client timeout - ADDENDUM MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Message-ID: <154936131597.16975.524017933678809084@gitbox.apache.org> From: zhangduo@apache.org X-Git-Host: gitbox.apache.org X-Git-Repo: hbase X-Git-Refname: refs/heads/branch-2.0 X-Git-Reftype: branch X-Git-Oldrev: 0578666756701506f27521d794d06f451f66a568 X-Git-Newrev: 6b618b42067769baa55d0bc4caef6d5d3dcf8a8e X-Git-Rev: 6b618b42067769baa55d0bc4caef6d5d3dcf8a8e X-Git-NotificationType: ref_changed_plus_diff X-Git-Multimail-Version: 1.5.dev Auto-Submitted: auto-generated This is an automated email from the ASF dual-hosted git repository. zhangduo pushed a commit to branch branch-2.0 in repository https://gitbox.apache.org/repos/asf/hbase.git The following commit(s) were added to refs/heads/branch-2.0 by this push: new 6b618b4 HBASE-21727 Simplify documentation around client timeout - ADDENDUM 6b618b4 is described below commit 6b618b42067769baa55d0bc4caef6d5d3dcf8a8e Author: Peter Somogyi AuthorDate: Tue Feb 5 09:38:59 2019 +0100 HBASE-21727 Simplify documentation around client timeout - ADDENDUM Add back HBaseConfiguration#getInt with deprecation Signed-off-by: zhangduo --- .../apache/hadoop/hbase/HBaseConfiguration.java | 26 ++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/HBaseConfiguration.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/HBaseConfiguration.java index 8d8b7ac..02c36ab 100644 --- a/hbase-common/src/main/java/org/apache/hadoop/hbase/HBaseConfiguration.java +++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/HBaseConfiguration.java @@ -170,6 +170,32 @@ public class HBaseConfiguration extends Configuration { } /** + * Get the value of the name property as an int, possibly referring to + * the deprecated name of the configuration property. If no such property exists, the provided + * default value is returned, or if the specified value is not a valid int, then an + * error is thrown. + * @param name property name. + * @param deprecatedName a deprecatedName for the property to use if non-deprecated name is not + * used + * @param defaultValue default value. + * @throws NumberFormatException when the value is invalid + * @return property value as an int, or defaultValue. + * @deprecated it will be removed in 3.0.0. Use + * {@link Configuration#addDeprecation(String, String)} instead. + */ + @Deprecated + public static int getInt(Configuration conf, String name, + String deprecatedName, int defaultValue) { + if (conf.get(deprecatedName) != null) { + LOG.warn(String.format("Config option \"%s\" is deprecated. Instead, use \"%s\"" + , deprecatedName, name)); + return conf.getInt(deprecatedName, defaultValue); + } else { + return conf.getInt(name, defaultValue); + } + } + + /** * Get the password from the Configuration instance using the * getPassword method if it exists. If not, then fall back to the * general get method for configuration elements.