Jelajahi Sumber

HADOOP-2718 Copy Constructor HBaseConfiguration(Configuration) will override
hbase configurations if argumant is not an instance of HBaseConfiguration.


git-svn-id: https://svn.apache.org/repos/asf/hadoop/core/trunk@616492 13f79535-47bb-0310-9956-ffa450edef68

Michael Stack 17 tahun lalu
induk
melakukan
74ea486234

+ 3 - 0
src/contrib/hbase/CHANGES.txt

@@ -152,6 +152,9 @@ Trunk (unreleased changes)
    HADOOP-2712 under load, regions won't split
    HADOOP-2675 Options not passed to rest/thrift
    HADOOP-2722 Prevent unintentional thread exit in region server and master
+   HADOOP-2718 Copy Constructor HBaseConfiguration(Configuration) will override
+               hbase configurations if argumant is not an instance of
+               HBaseConfiguration.
    
   IMPROVEMENTS
    HADOOP-2401 Add convenience put method that takes writable

+ 5 - 3
src/contrib/hbase/src/java/org/apache/hadoop/hbase/HBaseConfiguration.java

@@ -19,6 +19,8 @@
  */
 package org.apache.hadoop.hbase;
 
+import java.util.Map.Entry;
+
 import org.apache.hadoop.conf.Configuration;
 
 /**
@@ -36,9 +38,9 @@ public class HBaseConfiguration extends Configuration {
    * @param c Configuration to clone.
    */
   public HBaseConfiguration(final Configuration c) {
-    super(c);
-    if (!(c instanceof HBaseConfiguration)) {
-      addHbaseResources();
+    super();
+    for (Entry<String, String>e: c) {
+      set(e.getKey(), e.getValue());
     }
   }