hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject svn commit: r1021237 - in /hbase/trunk/src: main/java/org/apache/hadoop/hbase/client/HTable.java main/java/org/apache/hadoop/hbase/mapreduce/TableInputFormat.java test/java/org/apache/hadoop/hbase/mapreduce/TestTableInputFormatScan.java
Date Mon, 11 Oct 2010 03:38:26 GMT
Author: stack
Date: Mon Oct 11 03:38:26 2010
New Revision: 1021237

URL: http://svn.apache.org/viewvc?rev=1021237&view=rev
Log:
Logging to see if can figure why the TestTableInputFormatScan failures up on hudson

Modified:
    hbase/trunk/src/main/java/org/apache/hadoop/hbase/client/HTable.java
    hbase/trunk/src/main/java/org/apache/hadoop/hbase/mapreduce/TableInputFormat.java
    hbase/trunk/src/test/java/org/apache/hadoop/hbase/mapreduce/TestTableInputFormatScan.java

Modified: hbase/trunk/src/main/java/org/apache/hadoop/hbase/client/HTable.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/main/java/org/apache/hadoop/hbase/client/HTable.java?rev=1021237&r1=1021236&r2=1021237&view=diff
==============================================================================
--- hbase/trunk/src/main/java/org/apache/hadoop/hbase/client/HTable.java (original)
+++ hbase/trunk/src/main/java/org/apache/hadoop/hbase/client/HTable.java Mon Oct 11 03:38:26
2010
@@ -34,6 +34,7 @@ import org.apache.hadoop.hbase.NotServin
 import org.apache.hadoop.hbase.UnknownScannerException;
 import org.apache.hadoop.hbase.ZooKeeperConnectionException;
 import org.apache.hadoop.hbase.client.MetaScanner.MetaScannerVisitor;
+import org.apache.hadoop.hbase.mapreduce.TestTableInputFormatScan;
 import org.apache.hadoop.hbase.util.Bytes;
 import org.apache.hadoop.hbase.util.Pair;
 import org.apache.hadoop.hbase.util.Writables;
@@ -81,6 +82,7 @@ import java.io.DataOutput;
  * @see HBaseAdmin for create, drop, list, enable and disable of tables.
  */
 public class HTable implements HTableInterface {
+  private static final Log LOG = LogFactory.getLog(HTable.class);
   private final HConnection connection;
   private final byte [] tableName;
   protected final int scannerTimeout;
@@ -348,9 +350,14 @@ public class HTable implements HTableInt
     final List<byte[]> endKeyList = new ArrayList<byte[]>();
     MetaScannerVisitor visitor = new MetaScannerVisitor() {
       public boolean processRow(Result rowResult) throws IOException {
-        HRegionInfo info = Writables.getHRegionInfo(
-            rowResult.getValue(HConstants.CATALOG_FAMILY,
-                HConstants.REGIONINFO_QUALIFIER));
+        byte [] bytes = rowResult.getValue(HConstants.CATALOG_FAMILY,
+          HConstants.REGIONINFO_QUALIFIER);
+        if (bytes == null) {
+          LOG.warn("Null " + HConstants.REGIONINFO_QUALIFIER + " cell in " +
+            rowResult);
+          return true;
+        }
+        HRegionInfo info = Writables.getHRegionInfo(bytes);
         if (Bytes.equals(info.getTableDesc().getName(), getTableName())) {
           if (!(info.isOffline() || info.isSplit())) {
             startKeyList.add(info.getStartKey());

Modified: hbase/trunk/src/main/java/org/apache/hadoop/hbase/mapreduce/TableInputFormat.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/main/java/org/apache/hadoop/hbase/mapreduce/TableInputFormat.java?rev=1021237&r1=1021236&r2=1021237&view=diff
==============================================================================
--- hbase/trunk/src/main/java/org/apache/hadoop/hbase/mapreduce/TableInputFormat.java (original)
+++ hbase/trunk/src/main/java/org/apache/hadoop/hbase/mapreduce/TableInputFormat.java Mon
Oct 11 03:38:26 2010
@@ -89,7 +89,7 @@ implements Configurable {
     this.conf = configuration;
     String tableName = conf.get(INPUT_TABLE);
     try {
-      setHTable(new HTable(HBaseConfiguration.create(conf), tableName));
+      setHTable(new HTable(new Configuration(conf), tableName));
     } catch (Exception e) {
       LOG.error(StringUtils.stringifyException(e));
     }

Modified: hbase/trunk/src/test/java/org/apache/hadoop/hbase/mapreduce/TestTableInputFormatScan.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/test/java/org/apache/hadoop/hbase/mapreduce/TestTableInputFormatScan.java?rev=1021237&r1=1021236&r2=1021237&view=diff
==============================================================================
--- hbase/trunk/src/test/java/org/apache/hadoop/hbase/mapreduce/TestTableInputFormatScan.java
(original)
+++ hbase/trunk/src/test/java/org/apache/hadoop/hbase/mapreduce/TestTableInputFormatScan.java
Mon Oct 11 03:38:26 2010
@@ -326,13 +326,12 @@ public class TestTableInputFormatScan {
    * @throws ClassNotFoundException
    * @throws InterruptedException
    */
-  @SuppressWarnings("deprecation")
   private void testScan(String start, String stop, String last)
   throws IOException, InterruptedException, ClassNotFoundException {
     String jobName = "Scan" + (start != null ? start.toUpperCase() : "Empty") +
     "To" + (stop != null ? stop.toUpperCase() : "Empty");
     LOG.info("Before map/reduce startup - job " + jobName);
-    Configuration c = TEST_UTIL.getConfiguration();
+    Configuration c = new Configuration(TEST_UTIL.getConfiguration());
     Scan scan = new Scan();
     scan.addFamily(INPUT_FAMILY);
     if (start != null) {
@@ -356,4 +355,4 @@ public class TestTableInputFormatScan {
     assertTrue(job.isComplete());
     LOG.info("After map/reduce completion - job " + jobName);
   }
-}
+}
\ No newline at end of file



Mime
View raw message