hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject svn commit: r752569 - in /hadoop/hbase/branches/0.19/src: java/org/apache/hadoop/hbase/regionserver/StoreFileScanner.java test/org/apache/hadoop/hbase/regionserver/TestScanner.java
Date Wed, 11 Mar 2009 18:49:42 GMT
Author: stack
Date: Wed Mar 11 18:49:42 2009
New Revision: 752569

URL: http://svn.apache.org/viewvc?rev=752569&view=rev
Log:
HBASE-1256  NPE in StoreFileScanner durring cache flush -- part 2

Modified:
    hadoop/hbase/branches/0.19/src/java/org/apache/hadoop/hbase/regionserver/StoreFileScanner.java
    hadoop/hbase/branches/0.19/src/test/org/apache/hadoop/hbase/regionserver/TestScanner.java

Modified: hadoop/hbase/branches/0.19/src/java/org/apache/hadoop/hbase/regionserver/StoreFileScanner.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.19/src/java/org/apache/hadoop/hbase/regionserver/StoreFileScanner.java?rev=752569&r1=752568&r2=752569&view=diff
==============================================================================
--- hadoop/hbase/branches/0.19/src/java/org/apache/hadoop/hbase/regionserver/StoreFileScanner.java
(original)
+++ hadoop/hbase/branches/0.19/src/java/org/apache/hadoop/hbase/regionserver/StoreFileScanner.java
Wed Mar 11 18:49:42 2009
@@ -98,9 +98,9 @@
         }
         MapFile.Reader [] newReaders = new MapFile.Reader[nonulls + 1];
         newReaders[0] = hsf.getReader(store.fs, false, false);
-        int j = 0;
-        for (int i = 1; i < this.readers.length + 1; i++) {
-          MapFile.Reader r = this.readers[i - 1];
+        int j = 1;
+        for (int i = 0; i < this.readers.length; i++) {
+          MapFile.Reader r = this.readers[i];
           if (r != null) {
             newReaders[j++] = r;
           }

Modified: hadoop/hbase/branches/0.19/src/test/org/apache/hadoop/hbase/regionserver/TestScanner.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.19/src/test/org/apache/hadoop/hbase/regionserver/TestScanner.java?rev=752569&r1=752568&r2=752569&view=diff
==============================================================================
--- hadoop/hbase/branches/0.19/src/test/org/apache/hadoop/hbase/regionserver/TestScanner.java
(original)
+++ hadoop/hbase/branches/0.19/src/test/org/apache/hadoop/hbase/regionserver/TestScanner.java
Wed Mar 11 18:49:42 2009
@@ -159,6 +159,9 @@
       assertEquals(count, count(hri, 100));
       assertEquals(count, count(hri, 0));
       assertEquals(count, count(hri, count - 1));
+    } catch (Exception e) {
+      LOG.error("Failed with this exception", e);
+      throw e;
     } finally {
       this.r.close();
       this.r.getLog().closeAndDelete();
@@ -180,6 +183,9 @@
     HStoreKey key = new HStoreKey();
     SortedMap<byte [], Cell> values =
       new TreeMap<byte [], Cell>(Bytes.BYTES_COMPARATOR);
+    if (flushIndex == -1) {
+      hri.flushcache();
+    }
     int count = 0;
     while (s.next(key, values)) {
       count++;



Mime
View raw message