Author: tedyu
Date: Wed Jul 20 23:04:48 2011
New Revision: 1148965
URL: http://svn.apache.org/viewvc?rev=1148965&view=rev
Log:
HBASE-4118 method regionserver.MemStore#updateColumnValue: the check for
qualifier and family is missing (N Keywal via Ted Yu)
Modified:
hbase/trunk/CHANGES.txt
hbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/MemStore.java
Modified: hbase/trunk/CHANGES.txt
URL:
http://svn.apache.org/viewvc/hbase/trunk/CHANGES.txt?rev=1148965&r1=1148964&r2=1148965&view=diff
==============================================================================
--- hbase/trunk/CHANGES.txt (original)
+++ hbase/trunk/CHANGES.txt Wed Jul 20 23:04:48 2011
@@ -166,6 +166,8 @@ Release 0.91.0 - Unreleased
HBASE-4112 Creating table may throw NullPointerException (Jinchao via Ted
Yu)
HBASE-4093 When verifyAndAssignRoot throws exception, the deadServers state
cannot be changed (fulin wang via Ted Yu)
+ HBASE-4118 method regionserver.MemStore#updateColumnValue: the check for
+ qualifier and family is missing (N Keywal via Ted Yu)
IMPROVEMENTS
HBASE-3290 Max Compaction Size (Nicolas Spiegelberg via Stack)
Modified:
hbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/MemStore.java
URL:
http://svn.apache.org/viewvc/hbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/MemStore.java?rev=1148965&r1=1148964&r2=1148965&view=diff
==============================================================================
---
hbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/MemStore.java
(original)
+++
hbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/MemStore.java
Wed Jul 20 23:04: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();
}