hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From la...@apache.org
Subject svn commit: r1183018 - in /hbase/branches/0.92: CHANGES.txt src/main/java/org/apache/hadoop/hbase/regionserver/Store.java src/main/java/org/apache/hadoop/hbase/util/HMerge.java
Date Thu, 13 Oct 2011 18:14:10 GMT
Author: larsh
Date: Thu Oct 13 18:14:10 2011
New Revision: 1183018

URL: http://svn.apache.org/viewvc?rev=1183018&view=rev
Log:
HBASE-4556 Fix all incorrect uses of InternalScanner.next(...)

Modified:
    hbase/branches/0.92/CHANGES.txt
    hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/regionserver/Store.java
    hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/util/HMerge.java

Modified: hbase/branches/0.92/CHANGES.txt
URL: http://svn.apache.org/viewvc/hbase/branches/0.92/CHANGES.txt?rev=1183018&r1=1183017&r2=1183018&view=diff
==============================================================================
--- hbase/branches/0.92/CHANGES.txt (original)
+++ hbase/branches/0.92/CHANGES.txt Thu Oct 13 18:14:10 2011
@@ -334,6 +334,7 @@ Release 0.92.0 - Unreleased
    HBASE-4555  TestShell seems passed, but actually errors seen in test
                output file (Mingjie Lai)
    HBASE-4582  Store.java cleanup (failing TestHeapSize and has warnings)
+   HBASE-4556  Fix all incorrect uses of InternalScanner.next(...) (Lars H)
 
   TESTS
    HBASE-4492  TestRollingRestart fails intermittently

Modified: hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/regionserver/Store.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/regionserver/Store.java?rev=1183018&r1=1183017&r2=1183018&view=diff
==============================================================================
--- hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/regionserver/Store.java (original)
+++ hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/regionserver/Store.java Thu
Oct 13 18:14:10 2011
@@ -1146,7 +1146,9 @@ public class Store implements HeapSize {
         // we have to use a do/while loop.
         ArrayList<KeyValue> kvs = new ArrayList<KeyValue>();
         // Limit to "hbase.hstore.compaction.kv.max" (default 10) to avoid OOME
-        while (scanner.next(kvs,this.compactionKVMax)) {
+        boolean hasMore;
+        do {
+          hasMore = scanner.next(kvs, this.compactionKVMax);
           if (writer == null && !kvs.isEmpty()) {
             writer = createWriterInTmp(maxKeyCount,
               this.compactionCompression);
@@ -1176,7 +1178,7 @@ public class Store implements HeapSize {
             }
           }
           kvs.clear();
-        }
+        } while (hasMore);
       } finally {
         if (scanner != null) {
           scanner.close();

Modified: hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/util/HMerge.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/util/HMerge.java?rev=1183018&r1=1183017&r2=1183018&view=diff
==============================================================================
--- hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/util/HMerge.java (original)
+++ hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/util/HMerge.java Thu Oct 13
18:14:10 2011
@@ -19,6 +19,12 @@
  */
 package org.apache.hadoop.hbase.util;
 
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.NoSuchElementException;
+import java.util.Random;
+
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.hadoop.conf.Configuration;
@@ -44,12 +50,6 @@ import org.apache.hadoop.hbase.regionser
 import org.apache.hadoop.hbase.regionserver.InternalScanner;
 import org.apache.hadoop.hbase.regionserver.wal.HLog;
 
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.NoSuchElementException;
-import java.util.Random;
-
 /**
  * A non-instantiable class that has a static method capable of compacting
  * a table by merging adjacent regions.
@@ -370,14 +370,16 @@ class HMerge {
 
       try {
         List<KeyValue> results = new ArrayList<KeyValue>();
-        while(rootScanner.next(results)) {
+        boolean hasMore;
+        do {
+          hasMore = rootScanner.next(results);
           for(KeyValue kv: results) {
             HRegionInfo info = Writables.getHRegionInfoOrNull(kv.getValue());
             if (info != null) {
               metaRegions.add(info);
             }
           }
-        }
+        } while (hasMore);
       } finally {
         rootScanner.close();
         try {



Mime
View raw message