Return-Path: X-Original-To: apmail-hbase-commits-archive@www.apache.org Delivered-To: apmail-hbase-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 4D97217742 for ; Thu, 9 Apr 2015 20:59:24 +0000 (UTC) Received: (qmail 29693 invoked by uid 500); 9 Apr 2015 20:59:07 -0000 Delivered-To: apmail-hbase-commits-archive@hbase.apache.org Received: (qmail 29607 invoked by uid 500); 9 Apr 2015 20:59:07 -0000 Mailing-List: contact commits-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hbase.apache.org Delivered-To: mailing list commits@hbase.apache.org Received: (qmail 28419 invoked by uid 99); 9 Apr 2015 20:59:06 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 09 Apr 2015 20:59:06 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 9648FE0254; Thu, 9 Apr 2015 20:59:06 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: mbertozzi@apache.org To: commits@hbase.apache.org Date: Thu, 09 Apr 2015 20:59:29 -0000 Message-Id: <77d1de903cdb49e1aafcc9b4fe7a89e4@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [24/50] [abbrv] hbase git commit: HBASE-13362 Set max result size from client only (like scanner caching). 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/80dbf066 Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/80dbf066 Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/80dbf066 Branch: refs/heads/hbase-12439 Commit: 80dbf06651e527ec0421ce51e4712ffb2f1d078b Parents: e2a90a7 Author: Lars Hofhansl Authored: Wed Apr 8 21:43:01 2015 -0700 Committer: Lars Hofhansl Committed: Wed Apr 8 21:43:01 2015 -0700 ---------------------------------------------------------------------- .../org/apache/hadoop/hbase/HConstants.java | 25 ++++++++++++++++---- .../src/main/resources/hbase-default.xml | 10 ++++++++ .../hbase/regionserver/RSRpcServices.java | 4 ++-- 3 files changed, 33 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hbase/blob/80dbf066/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 19e251a..fc65c47 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 @@ -612,14 +612,21 @@ public final class HConstants { */ public static final UUID DEFAULT_CLUSTER_ID = new UUID(0L,0L); - /** - * Parameter name for maximum number of bytes returned when calling a - * scanner's next method. - */ + /** + * Parameter name for maximum number of bytes returned when calling a scanner's next method. + * Controlled by the client. + */ public static final String HBASE_CLIENT_SCANNER_MAX_RESULT_SIZE_KEY = "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. @@ -629,6 +636,16 @@ public final class HConstants { 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 100MB. (a client would rarely request larger chunks on purpose) + */ + public static final long DEFAULT_HBASE_SERVER_SCANNER_MAX_RESULT_SIZE = 100 * 1024 * 1024; + + /** * Parameter name for client pause value, used mostly as value to wait * before running a retry of a failed get, region lookup, etc. */ http://git-wip-us.apache.org/repos/asf/hbase/blob/80dbf066/hbase-common/src/main/resources/hbase-default.xml ---------------------------------------------------------------------- diff --git a/hbase-common/src/main/resources/hbase-default.xml b/hbase-common/src/main/resources/hbase-default.xml index 93776d7..c51ba16 100644 --- a/hbase-common/src/main/resources/hbase-default.xml +++ b/hbase-common/src/main/resources/hbase-default.xml @@ -1307,6 +1307,16 @@ possible configurations would overwhelm and obscure the important. + hbase.server.scanner.max.result.size + 104857600 + 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 100MB. + This is a safety setting to protect the server from OOM situations. + + + + hbase.status.published false http://git-wip-us.apache.org/repos/asf/hbase/blob/80dbf066/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSRpcServices.java ---------------------------------------------------------------------- diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSRpcServices.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSRpcServices.java index 10e39a1..f9b8d61 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSRpcServices.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSRpcServices.java @@ -820,8 +820,8 @@ public class RSRpcServices implements HBaseRPCErrorHandler, HConstants.HBASE_CLIENT_SCANNER_TIMEOUT_PERIOD, HConstants.DEFAULT_HBASE_CLIENT_SCANNER_TIMEOUT_PERIOD); maxScannerResultSize = rs.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); // Set our address, however we need the final port that was given to rpcServer isa = new InetSocketAddress(initialIsa.getHostName(), rpcServer.getListenerAddress().getPort());