You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by st...@apache.org on 2008/06/13 21:53:23 UTC

svn commit: r667631 - in /hadoop/hbase/trunk: CHANGES.txt src/java/org/apache/hadoop/hbase/regionserver/Memcache.java

Author: stack
Date: Fri Jun 13 12:53:23 2008
New Revision: 667631

URL: http://svn.apache.org/viewvc?rev=667631&view=rev
Log:
HBASE-682 unnecessary iteration in HMemcache.internalGet? got much better reading performance after break it.

Modified:
    hadoop/hbase/trunk/CHANGES.txt
    hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/regionserver/Memcache.java

Modified: hadoop/hbase/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/CHANGES.txt?rev=667631&r1=667630&r2=667631&view=diff
==============================================================================
--- hadoop/hbase/trunk/CHANGES.txt (original)
+++ hadoop/hbase/trunk/CHANGES.txt Fri Jun 13 12:53:23 2008
@@ -47,8 +47,11 @@
    HBASE-662   UI in table.jsp gives META locations, not the table's regions
                location (Jean-Daniel Cryans via Stack)
    HBASE-676   Bytes.getInt returns a long (Clint Morgan via Stack)
-   HBASE-680   config parameter hbase.io.index.interval  should be
+   HBASE-680   Config parameter hbase.io.index.interval  should be
                hbase.index.interval, according to HBaseMapFile.HbaseWriter
+               (LN via Stack)
+   HBASE-682   Unnecessary iteration in HMemcache.internalGet? got much better
+               reading performance after break it (LN via Stack)
    
   IMPROVEMENTS
    HBASE-559   MR example job to count table rows

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=667631&r1=667630&r2=667631&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 Fri Jun 13 12:53:23 2008
@@ -514,6 +514,9 @@
           if (ttl == HConstants.FOREVER ||
                 now < itKey.getTimestamp() + ttl) {
             result.add(new Cell(tailMap.get(itKey), itKey.getTimestamp()));
+            if (numVersions > 0 && result.size() >= numVersions) {
+              break;
+            }
           } else {
             victims.add(itKey);
             if (LOG.isDebugEnabled()) {
@@ -521,15 +524,15 @@
             }
           }
         }
-      }
-      if (numVersions > 0 && result.size() >= numVersions) {
+      } else {
+        // By L.N. HBASE-684, map is sorted, so we can't find match any more.
         break;
       }
     }
     // Remove expired victims from the map.
-    for (HStoreKey v: victims)
+    for (HStoreKey v: victims) {
       map.remove(v);
-
+    }
     return result;
   }
 
@@ -735,4 +738,4 @@
       }
     }
   }
-}
\ No newline at end of file
+}