From f0da1b58aaabef40d3a07f02f2780cdcc5b7d6fa Mon Sep 17 00:00:00 2001 From: Michael Stack Date: Tue, 29 Jan 2008 19:30:22 +0000 Subject: [PATCH] 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/src/contrib/hbase@616492 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES.txt | 3 +++ src/java/org/apache/hadoop/hbase/HBaseConfiguration.java | 8 +++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index 6b828729747..125871abc59 100644 --- a/CHANGES.txt +++ b/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 diff --git a/src/java/org/apache/hadoop/hbase/HBaseConfiguration.java b/src/java/org/apache/hadoop/hbase/HBaseConfiguration.java index d3323db461b..a720a318fd5 100644 --- a/src/java/org/apache/hadoop/hbase/HBaseConfiguration.java +++ b/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 (Entrye: c) { + set(e.getKey(), e.getValue()); } }