hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From te...@apache.org
Subject svn commit: r1239264 - in /hbase/trunk: pom.xml src/main/java/org/apache/hadoop/hbase/regionserver/wal/HLog.java src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestLogRolling.java
Date Wed, 01 Feb 2012 18:56:35 GMT
Author: tedyu
Date: Wed Feb  1 18:56:34 2012
New Revision: 1239264

URL: http://svn.apache.org/viewvc?rev=1239264&view=rev
Log:
HBASE-5212 Fix test TestTableMapReduce against 0.23 (Ted and Gregory)

Modified:
    hbase/trunk/pom.xml
    hbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/wal/HLog.java
    hbase/trunk/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java
    hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestLogRolling.java

Modified: hbase/trunk/pom.xml
URL: http://svn.apache.org/viewvc/hbase/trunk/pom.xml?rev=1239264&r1=1239263&r2=1239264&view=diff
==============================================================================
--- hbase/trunk/pom.xml (original)
+++ hbase/trunk/pom.xml Wed Feb  1 18:56:34 2012
@@ -1852,6 +1852,13 @@
           <artifactId>hadoop-mapreduce-client-jobclient</artifactId>
           <version>${hadoop.version}</version>
           <optional>true</optional>
+          <scope>test</scope>
+        </dependency>
+        <dependency>
+          <groupId>org.apache.hadoop</groupId>
+          <artifactId>hadoop-mapreduce-client-jobclient</artifactId>
+          <version>${hadoop.version}</version>
+          <optional>true</optional>
           <type>test-jar</type>
           <scope>test</scope>
         </dependency>

Modified: hbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/wal/HLog.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/wal/HLog.java?rev=1239264&r1=1239263&r2=1239264&view=diff
==============================================================================
--- hbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/wal/HLog.java (original)
+++ hbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/wal/HLog.java Wed Feb 
1 18:56:34 2012
@@ -456,7 +456,7 @@ public class HLog implements Syncable {
     if (os != null) {
       try {
         m = os.getWrappedStream().getClass().
-          getMethod("getNumCurrentReplicas", new Class<?> []{});
+          getDeclaredMethod("getNumCurrentReplicas", new Class<?> []{});
         m.setAccessible(true);
       } catch (NoSuchMethodException e) {
         // Thrown if getNumCurrentReplicas() function isn't available
@@ -471,7 +471,7 @@ public class HLog implements Syncable {
       LOG.info("Using getNumCurrentReplicas--HDFS-826");
     } else {
       LOG.info("getNumCurrentReplicas--HDFS-826 not available; hdfs_out=" +
-        os + ", exception=" + exception.getMessage());
+        os, exception);
     }
     return m;
   }

Modified: hbase/trunk/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java?rev=1239264&r1=1239263&r2=1239264&view=diff
==============================================================================
--- hbase/trunk/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java (original)
+++ hbase/trunk/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java Wed Feb  1
18:56:34 2012
@@ -1277,6 +1277,8 @@ public class HBaseTestingUtility {
     LOG.info("Mini mapreduce cluster started");
     conf.set("mapred.job.tracker",
         mrCluster.createJobConf().get("mapred.job.tracker"));
+    /* this for mrv2 support */
+    conf.set("mapreduce.framework.name", "yarn");
   }
 
   /**

Modified: hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestLogRolling.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestLogRolling.java?rev=1239264&r1=1239263&r2=1239264&view=diff
==============================================================================
--- hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestLogRolling.java
(original)
+++ hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestLogRolling.java
Wed Feb  1 18:56:34 2012
@@ -326,13 +326,18 @@ public class TestLogRolling  {
     // We start 3 servers and then stop 2 to avoid a directory naming conflict
     //  when we stop/start a namenode later, as mentioned in HBASE-5163
     List<DataNode> existingNodes = dfsCluster.getDataNodes();
-    dfsCluster
-        .startDataNodes(TEST_UTIL.getConfiguration(), 3, true, null, null);
-    for (DataNode dn: existingNodes){
-      dfsCluster.stopDataNode( dn.dnRegistration.getName() );
+    int numDataNodes = 3;
+    dfsCluster.startDataNodes(TEST_UTIL.getConfiguration(), numDataNodes, true,
+        null, null);
+    List<DataNode> allNodes = dfsCluster.getDataNodes();
+    for (int i = allNodes.size()-1; i >= 0; i--) {
+      if (existingNodes.contains(allNodes.get(i))) {
+        dfsCluster.stopDataNode( i );
+      }
     }
 
-    assertTrue(
+    assertTrue("DataNodes " + dfsCluster.getDataNodes().size() +
+        " default replication " + fs.getDefaultReplication(),
       dfsCluster.getDataNodes().size() >= fs.getDefaultReplication() + 1);
 
     writeData(table, 2);



Mime
View raw message