hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zhang...@apache.org
Subject [hbase] branch branch-2.1 updated: HBASE-21727 Simplify documentation around client timeout - ADDENDUM
Date Tue, 05 Feb 2019 10:07:34 GMT
This is an automated email from the ASF dual-hosted git repository.

zhangduo pushed a commit to branch branch-2.1
in repository https://gitbox.apache.org/repos/asf/hbase.git


The following commit(s) were added to refs/heads/branch-2.1 by this push:
     new d58630a  HBASE-21727 Simplify documentation around client timeout - ADDENDUM
d58630a is described below

commit d58630aa4a54e0d5f80af7ddba6b5c288e632086
Author: Peter Somogyi <psomogyi@apache.org>
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 <zhangduo@apache.org>
---
 .../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 <code>name</code> property as an <code>int</code>,
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 <code>int</code>,
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 <code>int</code>, or <code>defaultValue</code>.
+   * @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.


Mime
View raw message