You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by zh...@apache.org on 2018/02/22 06:59:18 UTC
[29/50] [abbrv] hbase git commit: HBASE-20039 MR tests out to
hbase-mapreduce mobile
HBASE-20039 MR tests out to hbase-mapreduce mobile
Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/5d994a24
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/5d994a24
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/5d994a24
Branch: refs/heads/HBASE-19064
Commit: 5d994a24fc570ee5156df0d1356cb7b12305fb78
Parents: 401227b
Author: Mike Drob <md...@apache.org>
Authored: Wed Feb 21 10:53:42 2018 -0600
Committer: Mike Drob <md...@apache.org>
Committed: Wed Feb 21 14:54:30 2018 -0600
----------------------------------------------------------------------
.../mapreduce/TestHBaseMRTestingUtility.java | 73 ++++++++++++++++++++
.../hadoop/hbase/TestHBaseTestingUtility.java | 32 ---------
2 files changed, 73 insertions(+), 32 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/hbase/blob/5d994a24/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestHBaseMRTestingUtility.java
----------------------------------------------------------------------
diff --git a/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestHBaseMRTestingUtility.java b/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestHBaseMRTestingUtility.java
new file mode 100644
index 0000000..2467dca
--- /dev/null
+++ b/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestHBaseMRTestingUtility.java
@@ -0,0 +1,73 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.hadoop.hbase.mapreduce;
+
+import org.apache.hadoop.hbase.HBaseClassTestRule;
+import org.apache.hadoop.hbase.HBaseTestingUtility;
+import org.apache.hadoop.hbase.testclassification.LargeTests;
+import org.apache.hadoop.hbase.testclassification.MapReduceTests;
+import org.junit.ClassRule;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+@Category({MapReduceTests.class, LargeTests.class})
+public class TestHBaseMRTestingUtility {
+ @ClassRule
+ public static final HBaseClassTestRule CLASS_RULE =
+ HBaseClassTestRule.forClass(TestHBaseMRTestingUtility.class);
+
+ @Test
+ public void testMRYarnConfigsPopulation() throws IOException {
+ Map<String, String> dummyProps = new HashMap<>();
+ dummyProps.put("mapreduce.jobtracker.address", "dummyhost:11234");
+ dummyProps.put("yarn.resourcemanager.address", "dummyhost:11235");
+ dummyProps.put("mapreduce.jobhistory.address", "dummyhost:11236");
+ dummyProps.put("yarn.resourcemanager.scheduler.address", "dummyhost:11237");
+ dummyProps.put("mapreduce.jobhistory.webapp.address", "dummyhost:11238");
+ dummyProps.put("yarn.resourcemanager.webapp.address", "dummyhost:11239");
+
+ HBaseTestingUtility hbt = new HBaseTestingUtility();
+
+ // populate the mr props to the Configuration instance
+ for (Map.Entry<String, String> entry : dummyProps.entrySet()) {
+ hbt.getConfiguration().set(entry.getKey(), entry.getValue());
+ }
+
+ for (Map.Entry<String,String> entry : dummyProps.entrySet()) {
+ assertTrue("The Configuration for key " + entry.getKey() +" and value: " + entry.getValue() +
+ " is not populated correctly", hbt.getConfiguration().get(entry.getKey()).equals(entry.getValue()));
+ }
+
+ hbt.startMiniMapReduceCluster();
+
+ // Confirm that MiniMapReduceCluster overwrites the mr properties and updates the Configuration
+ for (Map.Entry<String,String> entry : dummyProps.entrySet()) {
+ assertFalse("The MR prop: " + entry.getValue() + " is not overwritten when map reduce mini"+
+ "cluster is started", hbt.getConfiguration().get(entry.getKey()).equals(entry.getValue()));
+ }
+
+ hbt.shutdownMiniMapReduceCluster();
+ }
+}
http://git-wip-us.apache.org/repos/asf/hbase/blob/5d994a24/hbase-server/src/test/java/org/apache/hadoop/hbase/TestHBaseTestingUtility.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestHBaseTestingUtility.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestHBaseTestingUtility.java
index 4e09e1e..f49171c 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestHBaseTestingUtility.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestHBaseTestingUtility.java
@@ -458,36 +458,4 @@ public class TestHBaseTestingUtility {
assertEquals(nonDefaultRegionServerPort
, htu.getConfiguration().getInt(HConstants.REGIONSERVER_PORT, 0));
}
-
- @Test public void testMRYarnConfigsPopulation() throws IOException {
- Map<String, String> dummyProps = new HashMap<>();
- dummyProps.put("mapreduce.jobtracker.address", "dummyhost:11234");
- dummyProps.put("yarn.resourcemanager.address", "dummyhost:11235");
- dummyProps.put("mapreduce.jobhistory.address", "dummyhost:11236");
- dummyProps.put("yarn.resourcemanager.scheduler.address", "dummyhost:11237");
- dummyProps.put("mapreduce.jobhistory.webapp.address", "dummyhost:11238");
- dummyProps.put("yarn.resourcemanager.webapp.address", "dummyhost:11239");
-
- HBaseTestingUtility hbt = new HBaseTestingUtility();
-
- // populate the mr props to the Configuration instance
- for (Entry<String, String> entry : dummyProps.entrySet()) {
- hbt.getConfiguration().set(entry.getKey(), entry.getValue());
- }
-
- for (Entry<String,String> entry : dummyProps.entrySet()) {
- assertTrue("The Configuration for key " + entry.getKey() +" and value: " + entry.getValue() +
- " is not populated correctly", hbt.getConfiguration().get(entry.getKey()).equals(entry.getValue()));
- }
-
- hbt.startMiniMapReduceCluster();
-
- // Confirm that MiniMapReduceCluster overwrites the mr properties and updates the Configuration
- for (Entry<String,String> entry : dummyProps.entrySet()) {
- assertFalse("The MR prop: " + entry.getValue() + " is not overwritten when map reduce mini"+
- "cluster is started", hbt.getConfiguration().get(entry.getKey()).equals(entry.getValue()));
- }
-
- hbt.shutdownMiniMapReduceCluster();
- }
}