hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From apurt...@apache.org
Subject svn commit: r731730 - in /hadoop/hbase/trunk: CHANGES.txt src/java/org/apache/hadoop/hbase/regionserver/HStoreScanner.java
Date Mon, 05 Jan 2009 21:28:09 GMT
Author: apurtell
Date: Mon Jan  5 13:28:08 2009
New Revision: 731730

URL: http://svn.apache.org/viewvc?rev=731730&view=rev
Log:
HBASE-1107 NPE in HStoreScanner.updateReaders

Modified:
    hadoop/hbase/trunk/CHANGES.txt
    hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/regionserver/HStoreScanner.java

Modified: hadoop/hbase/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/CHANGES.txt?rev=731730&r1=731729&r2=731730&view=diff
==============================================================================
--- hadoop/hbase/trunk/CHANGES.txt (original)
+++ hadoop/hbase/trunk/CHANGES.txt Mon Jan  5 13:28:08 2009
@@ -127,6 +127,7 @@
    HBASE-1093  NPE in HStore#compact
    HBASE-1097  SequenceFile.Reader keeps around buffer whose size is that of
                largest item read -> results in lots of dead heap
+   HBASE-1107  NPE in HStoreScanner.updateReaders
 
   IMPROVEMENTS
    HBASE-901   Add a limit to key length, check key and value length on client side

Modified: hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/regionserver/HStoreScanner.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/regionserver/HStoreScanner.java?rev=731730&r1=731729&r2=731730&view=diff
==============================================================================
--- hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/regionserver/HStoreScanner.java (original)
+++ hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/regionserver/HStoreScanner.java Mon
Jan  5 13:28:08 2009
@@ -26,6 +26,7 @@
 import java.util.Set;
 import java.util.SortedMap;
 import java.util.TreeMap;
+import java.util.concurrent.atomic.AtomicBoolean;
 import java.util.concurrent.locks.ReentrantReadWriteLock;
 
 import org.apache.commons.logging.Log;
@@ -59,6 +60,9 @@
   
   // Used around transition from no storefile to the first.
   private final ReentrantReadWriteLock lock = new ReentrantReadWriteLock();
+
+  // Used to indicate that the scanner has closed (see HBASE-1107)
+  private final AtomicBoolean closing = new AtomicBoolean(false);
   
   /** Create an Scanner with a handle on the memcache and HStore files. */
   @SuppressWarnings("unchecked")
@@ -294,6 +298,7 @@
   }
 
   public void close() {
+    this.closing.set(true);
     this.store.deleteChangedReaderObserver(this);
     doClose();
   }
@@ -309,6 +314,9 @@
   // Implementation of ChangedReadersObserver
   
   public void updateReaders() throws IOException {
+    if (this.closing.get()) {
+      return;
+    }
     this.lock.writeLock().lock();
     try {
       MapFile.Reader [] readers = this.store.getReaders();



Mime
View raw message