hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject svn commit: r817911 - in /hadoop/hbase/branches/0.20: CHANGES.txt src/java/org/apache/hadoop/hbase/regionserver/Store.java
Date Wed, 23 Sep 2009 00:13:36 GMT
Author: stack
Date: Wed Sep 23 00:13:35 2009
New Revision: 817911

URL: http://svn.apache.org/viewvc?rev=817911&view=rev
Log:
HBASE-1809 NPE thrown in BoundedRangeFileInputStream

Modified:
    hadoop/hbase/branches/0.20/CHANGES.txt
    hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/regionserver/Store.java

Modified: hadoop/hbase/branches/0.20/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.20/CHANGES.txt?rev=817911&r1=817910&r2=817911&view=diff
==============================================================================
--- hadoop/hbase/branches/0.20/CHANGES.txt (original)
+++ hadoop/hbase/branches/0.20/CHANGES.txt Wed Sep 23 00:13:35 2009
@@ -27,6 +27,7 @@
                (Lars George via Stack)
    HBASE-1857  WrongRegionException when setting region online after .META.
                split (Cosmin Lehane via Stack)
+   HBASE-1809  NPE thrown in BoundedRangeFileInputStream
 
   IMPROVEMENTS
    HBASE-1819  Update to 0.20.1 hadoop and zk 3.2.1

Modified: hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/regionserver/Store.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/regionserver/Store.java?rev=817911&r1=817910&r2=817911&view=diff
==============================================================================
--- hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/regionserver/Store.java (original)
+++ hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/regionserver/Store.java Wed
Sep 23 00:13:35 2009
@@ -1432,34 +1432,38 @@
     // Column matching and version enforcement
     QueryMatcher matcher = new QueryMatcher(get, this.family.getName(), columns,
       this.ttl, keyComparator, versionsToReturn(get.getMaxVersions()));
+    this.lock.readLock().lock();
+    try {
+      // Read from memstore
+      if(this.memstore.get(matcher, result)) {
+        // Received early-out from memstore
+        return;
+      }
     
-    // Read from memstore
-    if(this.memstore.get(matcher, result)) {
-      // Received early-out from memstore
-      return;
-    }
-    
-    // Check if we even have storefiles
-    if (this.storefiles.isEmpty()) {
-      return;
-    }
+      // Check if we even have storefiles
+      if (this.storefiles.isEmpty()) {
+        return;
+      }
     
-    // Get storefiles for this store
-    List<HFileScanner> storefileScanners = new ArrayList<HFileScanner>();
-    for (StoreFile sf : this.storefiles.descendingMap().values()) {
-      HFile.Reader r = sf.getReader();
-      if (r == null) {
-        LOG.warn("StoreFile " + sf + " has a null Reader");
-        continue;
+      // Get storefiles for this store
+      List<HFileScanner> storefileScanners = new ArrayList<HFileScanner>();
+      for (StoreFile sf : this.storefiles.descendingMap().values()) {
+        HFile.Reader r = sf.getReader();
+        if (r == null) {
+          LOG.warn("StoreFile " + sf + " has a null Reader");
+          continue;
+        }
+        storefileScanners.add(r.getScanner());
       }
-      storefileScanners.add(r.getScanner());
-    }
     
-    // StoreFileGetScan will handle reading this store's storefiles
-    StoreFileGetScan scanner = new StoreFileGetScan(storefileScanners, matcher);
+      // StoreFileGetScan will handle reading this store's storefiles
+      StoreFileGetScan scanner = new StoreFileGetScan(storefileScanners, matcher);
     
-    // Run a GET scan and put results into the specified list 
-    scanner.get(result);
+      // Run a GET scan and put results into the specified list 
+      scanner.get(result);
+    } finally {
+      this.lock.readLock().unlock();
+    }
   }
 
   /**



Mime
View raw message