accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From els...@apache.org
Subject [31/50] [abbrv] git commit: ACCUMULO-1467 keep proxy in 1.4 consistent w/ 1.5
Date Wed, 31 Jul 2013 01:59:51 GMT
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/1.5.1-SNAPSHOT
Commit: 4fd10667d07e360cb4bc4d156d99683b24f0fac7
Parents: a329a7a
Author: Keith Turner <kturner@apache.org>
Authored: Tue Jul 2 12:25:03 2013 +0000
Committer: Keith Turner <kturner@apache.org>
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<? extends TProcessor> proxyProcConstructor = (Constructor<? extends
TProcessor>) 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);
   }


Mime
View raw message