Repository: hbase
Updated Branches:
  refs/heads/0.98 53469c95e -> f067c646b


HBASE-13362 Set max result size from client only (like scanner caching).


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/f067c646
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/f067c646
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/f067c646

Branch: refs/heads/0.98
Commit: f067c646bcc28f29e91c7c00c483c5c71f0fb323
Parents: 53469c9
Author: Lars Hofhansl <[email protected]>
Authored: Wed Apr 8 22:01:25 2015 -0700
Committer: Lars Hofhansl <[email protected]>
Committed: Wed Apr 8 22:02:41 2015 -0700

----------------------------------------------------------------------
 .../org/apache/hadoop/hbase/HConstants.java     | 21 ++++++++++++++++++--
 .../hbase/regionserver/HRegionServer.java       |  6 +++---
 2 files changed, 22 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/f067c646/hbase-common/src/main/java/org/apache/hadoop/hbase/HConstants.java
----------------------------------------------------------------------
diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/HConstants.java 
b/hbase-common/src/main/java/org/apache/hadoop/hbase/HConstants.java
index 57957ff..3fc2e8d 100644
--- a/hbase-common/src/main/java/org/apache/hadoop/hbase/HConstants.java
+++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/HConstants.java
@@ -576,13 +576,30 @@ public final class HConstants {
       "hbase.client.scanner.max.result.size";
 
   /**
+   * Parameter name for maximum number of bytes returned when calling a 
scanner's next method.
+   * Controlled by the server.
+   */
+  public static final String HBASE_SERVER_SCANNER_MAX_RESULT_SIZE_KEY =
+      "hbase.server.scanner.max.result.size";
+
+  /**
+   * Maximum number of bytes returned when calling a scanner's next method.
+   * Note that when a single row is larger than this limit the row is still
+   * returned completely.
+   *
+   * The default value is 2MB.
+   */
+  public static final long DEFAULT_HBASE_CLIENT_SCANNER_MAX_RESULT_SIZE = 2 * 
1024 * 1024;
+
+  /**
    * Maximum number of bytes returned when calling a scanner's next method.
    * Note that when a single row is larger than this limit the row is still
    * returned completely.
+   * Safety setting to protect the region server.
    *
-   * The default value is unlimited.
+   * The default value unlimited for backwards compatibility
    */
-  public static final long DEFAULT_HBASE_CLIENT_SCANNER_MAX_RESULT_SIZE = 
Long.MAX_VALUE;
+  public static final long DEFAULT_HBASE_SERVER_SCANNER_MAX_RESULT_SIZE = 
Long.MAX_VALUE;
 
   /**
    * Parameter name for client pause value, used mostly as value to wait

http://git-wip-us.apache.org/repos/asf/hbase/blob/f067c646/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
----------------------------------------------------------------------
diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
index ef9f6f8..6668492 100644
--- 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
+++ 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
@@ -577,8 +577,8 @@ public class HRegionServer implements 
ClientProtos.ClientService.BlockingInterfa
     this.nonceManager = isNoncesEnabled ? new ServerNonceManager(this.conf) : 
null;
 
     this.maxScannerResultSize = conf.getLong(
-      HConstants.HBASE_CLIENT_SCANNER_MAX_RESULT_SIZE_KEY,
-      HConstants.DEFAULT_HBASE_CLIENT_SCANNER_MAX_RESULT_SIZE);
+      HConstants.HBASE_SERVER_SCANNER_MAX_RESULT_SIZE_KEY,
+      HConstants.DEFAULT_HBASE_SERVER_SCANNER_MAX_RESULT_SIZE);
 
     this.numRegionsToReport = conf.getInt(
       "hbase.regionserver.numregionstoreport", 10);
@@ -3280,7 +3280,7 @@ public class HRegionServer implements 
ClientProtos.ClientService.BlockingInterfa
                 boolean moreRows = false;
                 while (i < rows) {
                   // Stop collecting results if maxScannerResultSize is set 
and we have exceeded it
-                  if ((maxScannerResultSize < Long.MAX_VALUE) &&
+                  if ((maxResultSize < Long.MAX_VALUE) &&
                       (currentScanResultSize >= maxResultSize)) {
                     builder.setMoreResultsInRegion(true);
                     break;

Reply via email to