hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject svn commit: r671676 - in /hadoop/hbase/branches/0.1/src/java/org/apache/hadoop/hbase: HRegionServer.java HTable.java
Date Wed, 25 Jun 2008 22:45:34 GMT
Author: jimk
Date: Wed Jun 25 15:45:33 2008
New Revision: 671676

URL: http://svn.apache.org/viewvc?rev=671676&view=rev
Log:
HBASE-613   Timestamp-anchored scanning fails to find all records

Problem was two fold:
- HRegionServer did not return null if no results were found, it returned empty results
- HTable$ClientScanner.next loop termination condition was incorrect

Modified:
    hadoop/hbase/branches/0.1/src/java/org/apache/hadoop/hbase/HRegionServer.java
    hadoop/hbase/branches/0.1/src/java/org/apache/hadoop/hbase/HTable.java

Modified: hadoop/hbase/branches/0.1/src/java/org/apache/hadoop/hbase/HRegionServer.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.1/src/java/org/apache/hadoop/hbase/HRegionServer.java?rev=671676&r1=671675&r2=671676&view=diff
==============================================================================
--- hadoop/hbase/branches/0.1/src/java/org/apache/hadoop/hbase/HRegionServer.java (original)
+++ hadoop/hbase/branches/0.1/src/java/org/apache/hadoop/hbase/HRegionServer.java Wed Jun
25 15:45:33 2008
@@ -1523,7 +1523,7 @@
         // No data for this row, go get another.
         results.clear();
       }
-      return values;
+      return values.size() == 0 ? null : values;
       
     } catch (IOException e) {
       checkFileSystem();

Modified: hadoop/hbase/branches/0.1/src/java/org/apache/hadoop/hbase/HTable.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.1/src/java/org/apache/hadoop/hbase/HTable.java?rev=671676&r1=671675&r2=671676&view=diff
==============================================================================
--- hadoop/hbase/branches/0.1/src/java/org/apache/hadoop/hbase/HTable.java (original)
+++ hadoop/hbase/branches/0.1/src/java/org/apache/hadoop/hbase/HTable.java Wed Jun 25 15:45:33
2008
@@ -848,7 +848,7 @@
         startRow : oldLocation.getRegionInfo().getEndKey();
 
       // advance to the region that starts with the current region's end key
-      LOG.debug("Advancing internal scanner to startKey " + localStartKey);
+      LOG.debug("Advancing internal scanner to startKey '" + localStartKey + "'");
       this.currentRegionLocation = getRegionLocation(localStartKey);
       
       LOG.debug("New region: " + this.currentRegionLocation);
@@ -924,7 +924,7 @@
       results.clear();
       do {
         values = server.next(scannerId);
-      } while (values != null && values.size() == 0 && nextScanner());
+      } while ((values == null || values.size() == 0) && nextScanner());
 
       if (values != null && values.size() != 0) {
         for (Map.Entry<Writable, Writable> e: values.entrySet()) {
@@ -1046,16 +1046,15 @@
               " attempts.\n";
             int i = 1;
             for (IOException e2 : exceptions) {
-              message = message + "Exception " + i + ":\n" + e;
+              message = message + "Exception " + i + ":\n" + e2;
             }
             LOG.debug(message);
           }
           throw e;
-        } else {
-          if (LOG.isDebugEnabled()) {
-            exceptions.add(e);
-            LOG.debug("reloading table servers because: " + e.getMessage());
-          }
+        }
+        if (LOG.isDebugEnabled()) {
+          exceptions.add(e);
+          LOG.debug("reloading table servers because: " + e.getMessage());
         }
 
       } catch (Exception e) {



Mime
View raw message