hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From te...@apache.org
Subject svn commit: r1525634 - in /hbase/trunk/hbase-client/src/main/java/org/apache/hadoop/hbase/client: MetaScanner.java Scan.java
Date Mon, 23 Sep 2013 16:05:30 GMT
Author: tedyu
Date: Mon Sep 23 16:05:30 2013
New Revision: 1525634

URL: http://svn.apache.org/r1525634
Log:
HBASE-9606 Apply small scan to meta scan where rowLimit is low


Modified:
    hbase/trunk/hbase-client/src/main/java/org/apache/hadoop/hbase/client/MetaScanner.java
    hbase/trunk/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Scan.java

Modified: hbase/trunk/hbase-client/src/main/java/org/apache/hadoop/hbase/client/MetaScanner.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-client/src/main/java/org/apache/hadoop/hbase/client/MetaScanner.java?rev=1525634&r1=1525633&r2=1525634&view=diff
==============================================================================
--- hbase/trunk/hbase-client/src/main/java/org/apache/hadoop/hbase/client/MetaScanner.java
(original)
+++ hbase/trunk/hbase-client/src/main/java/org/apache/hadoop/hbase/client/MetaScanner.java
Mon Sep 23 16:05:30 2013
@@ -163,8 +163,12 @@ public class MetaScanner {
           HConstants.ZEROES, false);
       }
       final Scan scan = new Scan(startRow).addFamily(HConstants.CATALOG_FAMILY);
-      int rows = Math.min(rowLimit, configuration.getInt(HConstants.HBASE_META_SCANNER_CACHING,
-        HConstants.DEFAULT_HBASE_META_SCANNER_CACHING));
+      int scannerCaching = configuration.getInt(HConstants.HBASE_META_SCANNER_CACHING,
+        HConstants.DEFAULT_HBASE_META_SCANNER_CACHING);
+      if (rowUpperLimit <= scannerCaching) {
+          scan.setSmall(true);
+      }
+      int rows = Math.min(rowLimit, scannerCaching);
       scan.setCaching(rows);
       if (LOG.isTraceEnabled()) {
         LOG.trace("Scanning " + metaTableName.getNameAsString() + " starting at row=" +

Modified: hbase/trunk/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Scan.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Scan.java?rev=1525634&r1=1525633&r2=1525634&view=diff
==============================================================================
--- hbase/trunk/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Scan.java (original)
+++ hbase/trunk/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Scan.java Mon Sep
23 16:05:30 2013
@@ -738,9 +738,11 @@ public class Scan extends OperationWithA
    * considered as a small scan.
    * 
    * @param small
+   * @return this instance
    */
-  public void setSmall(boolean small) {
+  public Scan setSmall(boolean small) {
     this.small = small;
+    return this;
   }
 
   /**



Mime
View raw message