hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject svn commit: r685458 - in /hadoop/hbase: branches/0.2/src/java/org/apache/hadoop/hbase/regionserver/Memcache.java trunk/src/java/org/apache/hadoop/hbase/regionserver/Memcache.java
Date Wed, 13 Aug 2008 06:22:50 GMT
Author: stack
Date: Tue Aug 12 23:22:49 2008
New Revision: 685458

URL: http://svn.apache.org/viewvc?rev=685458&view=rev
Log:
   HBASE-808,809 MAX_VERSIONS not respected, and Deletall doesn't and inserts; fix misapplication
of patch

Modified:
    hadoop/hbase/branches/0.2/src/java/org/apache/hadoop/hbase/regionserver/Memcache.java
    hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/regionserver/Memcache.java

Modified: hadoop/hbase/branches/0.2/src/java/org/apache/hadoop/hbase/regionserver/Memcache.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.2/src/java/org/apache/hadoop/hbase/regionserver/Memcache.java?rev=685458&r1=685457&r2=685458&view=diff
==============================================================================
--- hadoop/hbase/branches/0.2/src/java/org/apache/hadoop/hbase/regionserver/Memcache.java
(original)
+++ hadoop/hbase/branches/0.2/src/java/org/apache/hadoop/hbase/regionserver/Memcache.java
Tue Aug 12 23:22:49 2008
@@ -548,42 +548,27 @@
       final long now) {
     ArrayList<Cell> result = new ArrayList<Cell>();
     List<HStoreKey> victims = new ArrayList<HStoreKey>();
-    // Handle special case where only one version wanted.
-    if (numVersions == 1) {
-      byte [] value = map.get(key);
-      if (!isDeleted(value)) {
-        // Filter out expired results
-        if (HStore.notExpiredAndNotInDeletes(ttl, key, now, deletes)) {
-          result.add(new Cell(value, key.getTimestamp()));
-        } else {
-          addVictim(victims, key);
-        }
-      } else {
-        deletes.add(key);
-      }
-    } else {
-      SortedMap<HStoreKey, byte[]> tailMap = map.tailMap(key);
-      for (Map.Entry<HStoreKey, byte[]> es : tailMap.entrySet()) {
-        HStoreKey itKey = es.getKey();
-        if (itKey.matchesRowCol(key)) {
-          if (!isDeleted(es.getValue())) {
-            // Filter out expired results
-            if (HStore.notExpiredAndNotInDeletes(ttl, itKey, now, deletes)) {
-              result.add(new Cell(tailMap.get(itKey), itKey.getTimestamp()));
-              if (numVersions > 0 && result.size() >= numVersions) {
-                break;
-              }
-            } else {
-              addVictim(victims, itKey);
+    SortedMap<HStoreKey, byte[]> tailMap = map.tailMap(key);
+    for (Map.Entry<HStoreKey, byte[]> es : tailMap.entrySet()) {
+      HStoreKey itKey = es.getKey();
+      if (itKey.matchesRowCol(key)) {
+        if (!isDeleted(es.getValue())) {
+          // Filter out expired results
+          if (HStore.notExpiredAndNotInDeletes(ttl, itKey, now, deletes)) {
+            result.add(new Cell(tailMap.get(itKey), itKey.getTimestamp()));
+            if (numVersions > 0 && result.size() >= numVersions) {
+              break;
             }
           } else {
-            // Cell holds a delete value.
-            deletes.add(itKey);
+            addVictim(victims, itKey);
           }
         } else {
-          // By L.N. HBASE-684, map is sorted, so we can't find match any more.
-          break;
+          // Cell holds a delete value.
+          deletes.add(itKey);
         }
+      } else {
+        // By L.N. HBASE-684, map is sorted, so we can't find match any more.
+        break;
       }
     }
     // Remove expired victims from the map.

Modified: hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/regionserver/Memcache.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/regionserver/Memcache.java?rev=685458&r1=685457&r2=685458&view=diff
==============================================================================
--- hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/regionserver/Memcache.java (original)
+++ hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/regionserver/Memcache.java Tue Aug
12 23:22:49 2008
@@ -548,42 +548,27 @@
       final long now) {
     ArrayList<Cell> result = new ArrayList<Cell>();
     List<HStoreKey> victims = new ArrayList<HStoreKey>();
-    // Handle special case where only one version wanted.
-    if (numVersions == 1) {
-      byte [] value = map.get(key);
-      if (!isDeleted(value)) {
-        // Filter out expired results
-        if (HStore.notExpiredAndNotInDeletes(ttl, key, now, deletes)) {
-          result.add(new Cell(value, key.getTimestamp()));
-        } else {
-          addVictim(victims, key);
-        }
-      } else {
-        deletes.add(key);
-      }
-    } else {
-      SortedMap<HStoreKey, byte[]> tailMap = map.tailMap(key);
-      for (Map.Entry<HStoreKey, byte[]> es : tailMap.entrySet()) {
-        HStoreKey itKey = es.getKey();
-        if (itKey.matchesRowCol(key)) {
-          if (!isDeleted(es.getValue())) {
-            // Filter out expired results
-            if (HStore.notExpiredAndNotInDeletes(ttl, itKey, now, deletes)) {
-              result.add(new Cell(tailMap.get(itKey), itKey.getTimestamp()));
-              if (numVersions > 0 && result.size() >= numVersions) {
-                break;
-              }
-            } else {
-              addVictim(victims, itKey);
+    SortedMap<HStoreKey, byte[]> tailMap = map.tailMap(key);
+    for (Map.Entry<HStoreKey, byte[]> es : tailMap.entrySet()) {
+      HStoreKey itKey = es.getKey();
+      if (itKey.matchesRowCol(key)) {
+        if (!isDeleted(es.getValue())) {
+          // Filter out expired results
+          if (HStore.notExpiredAndNotInDeletes(ttl, itKey, now, deletes)) {
+            result.add(new Cell(tailMap.get(itKey), itKey.getTimestamp()));
+            if (numVersions > 0 && result.size() >= numVersions) {
+              break;
             }
           } else {
-            // Cell holds a delete value.
-            deletes.add(itKey);
+            addVictim(victims, itKey);
           }
         } else {
-          // By L.N. HBASE-684, map is sorted, so we can't find match any more.
-          break;
+          // Cell holds a delete value.
+          deletes.add(itKey);
         }
+      } else {
+        // By L.N. HBASE-684, map is sorted, so we can't find match any more.
+        break;
       }
     }
     // Remove expired victims from the map.



Mime
View raw message