Return-Path: X-Original-To: apmail-accumulo-commits-archive@www.apache.org Delivered-To: apmail-accumulo-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 2B6A31001D for ; Wed, 31 Jul 2013 15:13:56 +0000 (UTC) Received: (qmail 46771 invoked by uid 500); 31 Jul 2013 15:13:49 -0000 Delivered-To: apmail-accumulo-commits-archive@accumulo.apache.org Received: (qmail 46633 invoked by uid 500); 31 Jul 2013 15:13:48 -0000 Mailing-List: contact commits-help@accumulo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@accumulo.apache.org Delivered-To: mailing list commits@accumulo.apache.org Received: (qmail 45270 invoked by uid 99); 31 Jul 2013 15:13:39 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 31 Jul 2013 15:13:39 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 939898316A0; Wed, 31 Jul 2013 15:13:39 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: kturner@apache.org To: commits@accumulo.apache.org Date: Wed, 31 Jul 2013 15:14:04 -0000 Message-Id: In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [27/50] [abbrv] git commit: ACCUMULO-1467 keep proxy in 1.4 consistent w/ 1.5 ACCUMULO-1467 keep proxy in 1.4 consistent w/ 1.5 git-svn-id: https://svn.apache.org/repos/asf/accumulo/branches/1.4@1498901 13f79535-47bb-0310-9956-ffa450edef68 Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/4fd10667 Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/4fd10667 Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/4fd10667 Branch: refs/heads/master Commit: 4fd10667d07e360cb4bc4d156d99683b24f0fac7 Parents: a329a7a Author: Keith Turner Authored: Tue Jul 2 12:25:03 2013 +0000 Committer: Keith Turner Committed: Tue Jul 2 12:25:03 2013 +0000 ---------------------------------------------------------------------- src/proxy/proxy.properties | 2 +- .../src/main/java/org/apache/accumulo/proxy/Proxy.java | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/accumulo/blob/4fd10667/src/proxy/proxy.properties ---------------------------------------------------------------------- diff --git a/src/proxy/proxy.properties b/src/proxy/proxy.properties index 8044e09..a57c259 100644 --- a/src/proxy/proxy.properties +++ b/src/proxy/proxy.properties @@ -17,7 +17,7 @@ useMockInstance=false useMiniAccumulo=false protocolFactory=org.apache.thrift.protocol.TCompactProtocol$Factory port=42424 +maxFrameSize=16M instance=test zookeepers=localhost:2181 - http://git-wip-us.apache.org/repos/asf/accumulo/blob/4fd10667/src/proxy/src/main/java/org/apache/accumulo/proxy/Proxy.java ---------------------------------------------------------------------- diff --git a/src/proxy/src/main/java/org/apache/accumulo/proxy/Proxy.java b/src/proxy/src/main/java/org/apache/accumulo/proxy/Proxy.java index a65e5b6..7883d83 100644 --- a/src/proxy/src/main/java/org/apache/accumulo/proxy/Proxy.java +++ b/src/proxy/src/main/java/org/apache/accumulo/proxy/Proxy.java @@ -22,8 +22,9 @@ import java.io.IOException; import java.lang.reflect.Constructor; import java.util.Properties; -import org.apache.accumulo.proxy.thrift.AccumuloProxy; +import org.apache.accumulo.core.conf.AccumuloConfiguration; import org.apache.accumulo.minicluster.MiniAccumuloCluster; +import org.apache.accumulo.proxy.thrift.AccumuloProxy; import org.apache.log4j.Logger; import org.apache.thrift.TProcessor; import org.apache.thrift.protocol.TCompactProtocol; @@ -114,6 +115,7 @@ public class Proxy { Class proxyProcClass = Class.forName(api.getName() + "$Processor"); Class proxyIfaceClass = Class.forName(api.getName() + "$Iface"); + @SuppressWarnings("unchecked") Constructor proxyProcConstructor = (Constructor) proxyProcClass.getConstructor(proxyIfaceClass); @@ -121,7 +123,10 @@ public class Proxy { THsHaServer.Args args = new THsHaServer.Args(socket); args.processor(processor); - args.transportFactory(new TFramedTransport.Factory()); + final long maxFrameSize = AccumuloConfiguration.getMemoryInBytes(properties.getProperty("maxFrameSize", "16M")); + if (maxFrameSize > Integer.MAX_VALUE) + throw new RuntimeException(maxFrameSize + " is larger than MAX_INT"); + args.transportFactory(new TFramedTransport.Factory((int)maxFrameSize)); args.protocolFactory(protoClass.newInstance()); return new THsHaServer(args); }