You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by te...@apache.org on 2011/07/21 01:05:49 UTC

svn commit: r1148966 - in /hbase/branches/0.90: CHANGES.txt src/main/java/org/apache/hadoop/hbase/regionserver/MemStore.java

Author: tedyu
Date: Wed Jul 20 23:05:48 2011
New Revision: 1148966

URL: http://svn.apache.org/viewvc?rev=1148966&view=rev
Log:
HBASE-4118  method regionserver.MemStore#updateColumnValue: the check for 
               qualifier and family is missing (N Keywal via Ted Yu)

Modified:
    hbase/branches/0.90/CHANGES.txt
    hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/regionserver/MemStore.java

Modified: hbase/branches/0.90/CHANGES.txt
URL: http://svn.apache.org/viewvc/hbase/branches/0.90/CHANGES.txt?rev=1148966&r1=1148965&r2=1148966&view=diff
==============================================================================
--- hbase/branches/0.90/CHANGES.txt (original)
+++ hbase/branches/0.90/CHANGES.txt Wed Jul 20 23:05:48 2011
@@ -78,6 +78,8 @@ Release 0.90.4 - Unreleased
                back even if it seems like they didn't make it
    HBASE-4115  HBase shell assign and unassign unusable if region name includes
                binary-encoded data (Ryan Brush)
+   HBASE-4118  method regionserver.MemStore#updateColumnValue: the check for 
+               qualifier and family is missing (N Keywal via Ted Yu)
 
   IMPROVEMENT
    HBASE-3882  hbase-config.sh needs to be updated so it can auto-detects the

Modified: hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/regionserver/MemStore.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/regionserver/MemStore.java?rev=1148966&r1=1148965&r2=1148966&view=diff
==============================================================================
--- hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/regionserver/MemStore.java (original)
+++ hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/regionserver/MemStore.java Wed Jul 20 23:05:48 2011
@@ -458,25 +458,22 @@ public class MemStore implements HeapSiz
         KeyValue kv = it.next();
 
         // if this isnt the row we are interested in, then bail:
-        if (!firstKv.matchingColumn(family,qualifier) || !firstKv.matchingRow(kv) ) {
+        if (!kv.matchingColumn(family,qualifier) || !kv.matchingRow(firstKv) ) {
           break; // rows dont match, bail.
         }
 
         // if the qualifier matches and it's a put, just RM it out of the kvset.
-        if (firstKv.matchingQualifier(kv)) {
-          // to be extra safe we only remove Puts that have a memstoreTS==0
-          if (kv.getType() == KeyValue.Type.Put.getCode()) {
-            now = Math.max(now, kv.getTimestamp());
-          }
+        if (kv.getType() == KeyValue.Type.Put.getCode() &&
+            kv.getTimestamp() > now && firstKv.matchingQualifier(kv)) {
+          now = kv.getTimestamp();
         }
       }
 
       // create or update (upsert) a new KeyValue with
       // 'now' and a 0 memstoreTS == immediately visible
-      return upsert(Arrays.asList(new KeyValue [] {
-          new KeyValue(row, family, qualifier, now,
-              Bytes.toBytes(newValue))
-      }));
+      return upsert(Arrays.asList(
+          new KeyValue(row, family, qualifier, now, Bytes.toBytes(newValue)))
+      );
     } finally {
       this.lock.readLock().unlock();
     }