hadoop.profile=2.0 Index: hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java =================================================================== --- hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java (revision 1460913) +++ hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java (working copy) @@ -1,5 +1,3 @@ - - /** * * Licensed to the Apache Software Foundation (ASF) under one @@ -38,8 +36,10 @@ import java.util.Collection; import java.util.Collections; import java.util.HashSet; +import java.util.Iterator; import java.util.List; import java.util.Map; +import java.util.Map.Entry; import java.util.NavigableSet; import java.util.Random; import java.util.Set; @@ -1632,6 +1632,28 @@ } } + /* + * Copies Configuration entries which are absent in dst from src to dst + * @param src source Configuration + * @param dst destination Configuration + * @return destination Configuration + */ + private Configuration copyNewConfEntries(Configuration src, Configuration dst) { + if (src == null || src.size() == 0) return dst; + Iterator> iter = src.iterator(); + int entriesAdded = 0; + while (iter.hasNext()) { + Entry entry = iter.next(); + if (dst.get(entry.getKey()) == null) { + LOG.debug("copying " + entry.getKey() + " = " + entry.getValue()); + dst.set(entry.getKey(), entry.getValue()); + entriesAdded++; + } + } + LOG.debug("Added " + entriesAdded + " entries to conf"); + return dst; + } + /** * Starts a MiniMRCluster. Call {@link #setFileSystemURI(String)} to use a different * filesystem. @@ -1648,6 +1670,8 @@ forceChangeTaskLogDir(); + conf.setBoolean("yarn.nodemanager.pmem-check-enabled", false); + conf.setBoolean("yarn.nodemanager.vmem-check-enabled", false); // Allow the user to override FS URI for this map-reduce cluster to use. mrCluster = new MiniMRCluster(servers, FS_URI != null ? FS_URI : FileSystem.get(conf).getUri().toString(), 1, @@ -1656,6 +1680,7 @@ if (jobConf == null) { jobConf = mrCluster.createJobConf(); } + copyNewConfEntries(jobConf, this.conf); jobConf.set("mapred.local.dir", conf.get("mapred.local.dir")); //Hadoop MiniMR overwrites this while it should not LOG.info("Mini mapreduce cluster started"); Index: hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestImportExport.java =================================================================== --- hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestImportExport.java (revision 1460913) +++ hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestImportExport.java (working copy) @@ -228,8 +228,11 @@ OUTPUT_DIR }; - GenericOptionsParser opts = new GenericOptionsParser(new Configuration(cluster.getConfiguration()), args); + GenericOptionsParser opts = new GenericOptionsParser(new Configuration( + cluster.getConfiguration()), args); Configuration conf = opts.getConfiguration(); + // copy or add the necessary configuration values from the map reduce config to the hbase config + copyConfigurationValues(UTIL.getConfiguration(), conf); args = opts.getRemainingArgs(); assertEquals(conf.get(Export.EXPORT_BATCHING), EXPORT_BATCH_SIZE); @@ -350,6 +353,8 @@ GenericOptionsParser opts = new GenericOptionsParser(new Configuration( cluster.getConfiguration()), args); Configuration conf = opts.getConfiguration(); + // copy or add the necessary configuration values from the map reduce config to the hbase config + copyConfigurationValues(UTIL.getConfiguration(), conf); args = opts.getRemainingArgs(); Job job = Export.createSubmittableJob(conf, args); @@ -369,6 +374,8 @@ opts = new GenericOptionsParser(new Configuration(cluster.getConfiguration()), args); conf = opts.getConfiguration(); + // copy or add the necessary configuration values from the map reduce config to the hbase config + copyConfigurationValues(UTIL.getConfiguration(), conf); args = opts.getRemainingArgs(); job = Import.createSubmittableJob(conf, args); @@ -392,6 +399,8 @@ opts = new GenericOptionsParser(new Configuration(cluster.getConfiguration()), args); conf = opts.getConfiguration(); + // copy or add the necessary configuration values from the map reduce config to the hbase config + copyConfigurationValues(UTIL.getConfiguration(), conf); args = opts.getRemainingArgs(); job = Import.createSubmittableJob(conf, args); Index: hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java =================================================================== --- hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java (revision 1460913) +++ hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java (working copy) @@ -484,7 +484,7 @@ this.rsAccounting = this.rsServices.getRegionServerAccounting(); // don't initialize coprocessors if not running within a regionserver // TODO: revisit if coprocessors should load in other cases - this.coprocessorHost = new RegionCoprocessorHost(this, rsServices, conf); + this.coprocessorHost = new RegionCoprocessorHost(this, rsServices, baseConf); this.metricsRegionWrapper = new MetricsRegionWrapperImpl(this); this.metricsRegion = new MetricsRegion(this.metricsRegionWrapper); } else { Index: hbase-server/pom.xml =================================================================== --- hbase-server/pom.xml (revision 1460913) +++ hbase-server/pom.xml (working copy) @@ -559,7 +559,8 @@ hadoop-1.0 - !hadoop.profile + hadoop.profile + 1.0 @@ -581,8 +582,7 @@ hadoop-2.0 - hadoop.profile - 2.0 + !hadoop.profile Index: pom.xml =================================================================== --- pom.xml (revision 1460913) +++ pom.xml (working copy) @@ -880,7 +880,7 @@ 1.6 ${project.version} - 2.0.2-alpha + 2.0.4-SNAPSHOT 1.1.2 1.2 1.7 @@ -1430,7 +1430,8 @@ hadoop-1.0 - !hadoop.profile + hadoop.profile + 1.0 @@ -1488,16 +1489,15 @@ hadoop-2.0 - hadoop.profile - 2.0 + !hadoop.profile hbase-hadoop2-compat + ${hadoop-two.version} 1.6.1 - ${hadoop-two.version} hbase-hadoop2-compat src/assembly/hadoop-two-compat.xml Index: hbase-it/pom.xml =================================================================== --- hbase-it/pom.xml (revision 1460913) +++ hbase-it/pom.xml (working copy) @@ -172,7 +172,8 @@ hadoop-1.0 - !hadoop.profile + hadoop.profile + 1.0 @@ -195,8 +196,7 @@ hadoop-2.0 - hadoop.profile - 2.0 + !hadoop.profile Index: hbase-examples/pom.xml =================================================================== --- hbase-examples/pom.xml (revision 1460913) +++ hbase-examples/pom.xml (working copy) @@ -97,7 +97,8 @@ hadoop-1.0 - !hadoop.profile + hadoop.profile + 1.0 @@ -119,8 +120,7 @@ hadoop-2.0 - hadoop.profile - 2.0 + !hadoop.profile Index: hbase-client/pom.xml =================================================================== --- hbase-client/pom.xml (revision 1460913) +++ hbase-client/pom.xml (working copy) @@ -106,7 +106,8 @@ hadoop-1.0 - !hadoop.profile + hadoop.profile + 1.0 @@ -125,8 +126,7 @@ hadoop-2.0 - hadoop.profile - 2.0 + !hadoop.profile Index: hbase-common/pom.xml =================================================================== --- hbase-common/pom.xml (revision 1460913) +++ hbase-common/pom.xml (working copy) @@ -181,7 +181,8 @@ hadoop-1.0 - !hadoop.profile + hadoop.profile + 1.0 @@ -200,8 +201,7 @@ hadoop-2.0 - hadoop.profile - 2.0 + !hadoop.profile