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/10 00:46:35 UTC

svn commit: r665929 - in /hadoop/hbase/branches/0.1: CHANGES.txt conf/hbase-env.sh src/java/org/apache/hadoop/hbase/HTable.java src/test/org/apache/hadoop/hbase/TestHMemcache.java

Author: stack
Date: Mon Jun  9 15:46:34 2008
New Revision: 665929

URL: http://svn.apache.org/viewvc?rev=665929&view=rev
Log:
HBASE-665 server side scanner doesn't honor stop row

Modified:
    hadoop/hbase/branches/0.1/CHANGES.txt
    hadoop/hbase/branches/0.1/conf/hbase-env.sh
    hadoop/hbase/branches/0.1/src/java/org/apache/hadoop/hbase/HTable.java
    hadoop/hbase/branches/0.1/src/test/org/apache/hadoop/hbase/TestHMemcache.java

Modified: hadoop/hbase/branches/0.1/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.1/CHANGES.txt?rev=665929&r1=665928&r2=665929&view=diff
==============================================================================
--- hadoop/hbase/branches/0.1/CHANGES.txt (original)
+++ hadoop/hbase/branches/0.1/CHANGES.txt Mon Jun  9 15:46:34 2008
@@ -12,6 +12,7 @@
    HBASE-663   Incorrect sequence number for cache flush
    HBASE-652   Dropping table fails silently if table isn't disabled 
    HBASE-674   Memcache size unreliable
+   HBASE-665   server side scanner doesn't honor stop row
 
 Release 0.1.2 - 05/13/2008
 

Modified: hadoop/hbase/branches/0.1/conf/hbase-env.sh
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.1/conf/hbase-env.sh?rev=665929&r1=665928&r2=665929&view=diff
==============================================================================
--- hadoop/hbase/branches/0.1/conf/hbase-env.sh (original)
+++ hadoop/hbase/branches/0.1/conf/hbase-env.sh Mon Jun  9 15:46:34 2008
@@ -23,6 +23,7 @@
 
 # The java implementation to use.  Required.
 # export JAVA_HOME=/usr/lib/j2sdk1.5-sun
+export JAVA_HOME=/usr
 
 # Extra Java CLASSPATH elements.  Optional.
 # export HBASE_CLASSPATH=

Modified: hadoop/hbase/branches/0.1/src/java/org/apache/hadoop/hbase/HTable.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.1/src/java/org/apache/hadoop/hbase/HTable.java?rev=665929&r1=665928&r2=665929&view=diff
==============================================================================
--- hadoop/hbase/branches/0.1/src/java/org/apache/hadoop/hbase/HTable.java (original)
+++ hadoop/hbase/branches/0.1/src/java/org/apache/hadoop/hbase/HTable.java Mon Jun  9 15:46:34 2008
@@ -835,10 +835,8 @@
       if (this.currentRegionLocation != null){
         LOG.debug("Advancing forward from region " 
           + this.currentRegionLocation.getRegionInfo());
-        
-        if (this.currentRegionLocation.getRegionInfo().getEndKey() == null
-          || this.currentRegionLocation.getRegionInfo().getEndKey().equals(EMPTY_TEXT)) {
-            LOG.debug("We're at the end of the region, returning.");
+        Text endKey =  this.currentRegionLocation.getRegionInfo().getEndKey();
+        if (endKey == null || endKey.equals(EMPTY_TEXT) || filterSaysStop(endKey)) {
             close();
             return false;
         }
@@ -899,6 +897,20 @@
       return true;
     }
 
+    /**
+     * @param endKey
+     * @return Returns true if the passed region endkey is judged beyond
+     * filter.
+     */
+    private boolean filterSaysStop(final Text endKey) {
+      if (this.filter == null) {
+        return false;
+      }
+      // Let the filter see current row.
+      this.filter.filter(endKey);
+      return this.filter.filterAllRemaining();
+    }
+
     /** {@inheritDoc} */
     public boolean next(HStoreKey key, SortedMap<Text, byte[]> results)
     throws IOException {

Modified: hadoop/hbase/branches/0.1/src/test/org/apache/hadoop/hbase/TestHMemcache.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.1/src/test/org/apache/hadoop/hbase/TestHMemcache.java?rev=665929&r1=665928&r2=665929&view=diff
==============================================================================
--- hadoop/hbase/branches/0.1/src/test/org/apache/hadoop/hbase/TestHMemcache.java (original)
+++ hadoop/hbase/branches/0.1/src/test/org/apache/hadoop/hbase/TestHMemcache.java Mon Jun  9 15:46:34 2008
@@ -61,8 +61,7 @@
    * @param hmc Instance to add rows to.
    */
   private void addRows(final HStore.Memcache hmc)
-    throws UnsupportedEncodingException {
-    
+  throws UnsupportedEncodingException {
     for (int i = 0; i < ROW_COUNT; i++) {
       long timestamp = System.currentTimeMillis();
       for (int ii = 0; ii < COLUMNS_COUNT; ii++) {
@@ -100,8 +99,7 @@
   }
   
   private void isExpectedRow(final int rowIndex, TreeMap<Text, byte []> row)
-    throws UnsupportedEncodingException {
-    
+  throws UnsupportedEncodingException {
     int i = 0;
     for (Text colname: row.keySet()) {
       String expectedColname = getColumnName(rowIndex, i++).toString();
@@ -242,4 +240,4 @@
   private HStoreKey getHSKForRow(Text row) {
     return new HStoreKey(row, new Text("test_col:"), HConstants.LATEST_TIMESTAMP);
   }
-}
+}
\ No newline at end of file