hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject svn commit: r1100095 - in /hbase/trunk/src: main/java/org/apache/hadoop/hbase/client/MetaScanner.java main/java/org/apache/hadoop/hbase/util/HBaseFsckRepair.java test/java/org/apache/hadoop/hbase/util/TestHBaseFsck.java
Date Fri, 06 May 2011 06:25:29 GMT
Author: stack
Date: Fri May  6 06:25:29 2011
New Revision: 1100095

URL: http://svn.apache.org/viewvc?rev=1100095&view=rev
Log:
HBASE-3863 Fix failing TestHBaseFsck.testHBaseFsckMeta unit test

Modified:
    hbase/trunk/src/main/java/org/apache/hadoop/hbase/client/MetaScanner.java
    hbase/trunk/src/main/java/org/apache/hadoop/hbase/util/HBaseFsckRepair.java
    hbase/trunk/src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsck.java

Modified: hbase/trunk/src/main/java/org/apache/hadoop/hbase/client/MetaScanner.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/main/java/org/apache/hadoop/hbase/client/MetaScanner.java?rev=1100095&r1=1100094&r2=1100095&view=diff
==============================================================================
--- hbase/trunk/src/main/java/org/apache/hadoop/hbase/client/MetaScanner.java (original)
+++ hbase/trunk/src/main/java/org/apache/hadoop/hbase/client/MetaScanner.java Fri May  6 06:25:29
2011
@@ -311,7 +311,7 @@ public class MetaScanner {
         return true;
       }
     };
-    metaScan(conf, visitor);
+    metaScan(conf, visitor, tablename);
     return regions;
   }
 

Modified: hbase/trunk/src/main/java/org/apache/hadoop/hbase/util/HBaseFsckRepair.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/main/java/org/apache/hadoop/hbase/util/HBaseFsckRepair.java?rev=1100095&r1=1100094&r2=1100095&view=diff
==============================================================================
--- hbase/trunk/src/main/java/org/apache/hadoop/hbase/util/HBaseFsckRepair.java (original)
+++ hbase/trunk/src/main/java/org/apache/hadoop/hbase/util/HBaseFsckRepair.java Fri May  6
06:25:29 2011
@@ -25,7 +25,6 @@ import java.util.List;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.hbase.HConstants;
 import org.apache.hadoop.hbase.HRegionInfo;
-import org.apache.hadoop.hbase.HServerAddress;
 import org.apache.hadoop.hbase.NotServingRegionException;
 import org.apache.hadoop.hbase.ServerName;
 import org.apache.hadoop.hbase.ZooKeeperConnectionException;
@@ -104,8 +103,8 @@ public class HBaseFsckRepair {
     HConnection connection = HConnectionManager.getConnection(conf);
     boolean success = false;
     try {
-      HRegionInterface rs = connection.getHRegionConnection(new HServerAddress(
-          server.getHostname(), server.getPort()));
+      HRegionInterface rs =
+        connection.getHRegionConnection(server.getHostname(), server.getPort());
       rs.closeRegion(region, false);
       long timeout = conf.getLong("hbase.hbck.close.timeout", 120000);
       long expiration = timeout + System.currentTimeMillis();

Modified: hbase/trunk/src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsck.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsck.java?rev=1100095&r1=1100094&r2=1100095&view=diff
==============================================================================
--- hbase/trunk/src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsck.java (original)
+++ hbase/trunk/src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsck.java Fri May  6 06:25:29
2011
@@ -19,28 +19,34 @@
  */
 package org.apache.hadoop.hbase.util;
 
-import static org.apache.hadoop.hbase.util.HBaseFsck.ErrorReporter.ERROR_CODE;
-import static org.junit.Assert.assertArrayEquals;
 import static org.junit.Assert.assertEquals;
 
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.hadoop.conf.Configuration;
-import org.apache.hadoop.fs.FileStatus;
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.Path;
-import org.apache.hadoop.hbase.*;
-import org.apache.hadoop.hbase.client.*;
-import org.apache.hadoop.hbase.ipc.HRegionInterface;
+import org.apache.hadoop.hbase.HBaseTestingUtility;
+import org.apache.hadoop.hbase.HConstants;
+import org.apache.hadoop.hbase.HRegionInfo;
+import org.apache.hadoop.hbase.HServerAddress;
+import org.apache.hadoop.hbase.HTableDescriptor;
+import org.apache.hadoop.hbase.ServerName;
+import org.apache.hadoop.hbase.client.HTable;
+import org.apache.hadoop.hbase.client.Put;
+import org.apache.hadoop.hbase.client.Result;
+import org.apache.hadoop.hbase.client.ResultScanner;
+import org.apache.hadoop.hbase.client.Scan;
+import org.apache.hadoop.hbase.util.HBaseFsck.ErrorReporter.ERROR_CODE;
 import org.junit.BeforeClass;
 import org.junit.Test;
 
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Random;
-
 public class TestHBaseFsck {
 
   final Log LOG = LogFactory.getLog(getClass());
@@ -142,8 +148,10 @@ public class TestHBaseFsck {
 
     HTable tbl = TEST_UTIL.createTable(Bytes.toBytes("table2"), FAM);
 
-    HRegionInfo hriOrig = tbl.getRegionsInfo().keySet().iterator().next();
-    HServerAddress rsAddressOrig = tbl.getRegionsInfo().get(hriOrig);
+    Map<HRegionInfo, HServerAddress> hris = tbl.getRegionsInfo();
+    HRegionInfo hriOrig = hris.keySet().iterator().next();
+    Map<HRegionInfo, ServerName> locations = tbl.getRegionLocations();
+    ServerName rsAddressOrig = locations.get(hriOrig);
 
     byte[][] startKeys = new byte[][]{
         HConstants.EMPTY_BYTE_ARRAY,



Mime
View raw message