accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e..@apache.org
Subject svn commit: r1484928 - in /accumulo/branches/1.5/proxy: proxy.properties src/main/java/org/apache/accumulo/proxy/Proxy.java
Date Tue, 21 May 2013 20:06:17 GMT
Author: ecn
Date: Tue May 21 20:06:17 2013
New Revision: 1484928

URL: http://svn.apache.org/r1484928
Log:
ACCUMULO-1424 i hate reading big numbers

Modified:
    accumulo/branches/1.5/proxy/proxy.properties
    accumulo/branches/1.5/proxy/src/main/java/org/apache/accumulo/proxy/Proxy.java

Modified: accumulo/branches/1.5/proxy/proxy.properties
URL: http://svn.apache.org/viewvc/accumulo/branches/1.5/proxy/proxy.properties?rev=1484928&r1=1484927&r2=1484928&view=diff
==============================================================================
--- accumulo/branches/1.5/proxy/proxy.properties (original)
+++ accumulo/branches/1.5/proxy/proxy.properties Tue May 21 20:06:17 2013
@@ -18,7 +18,7 @@ useMiniAccumulo=false
 protocolFactory=org.apache.thrift.protocol.TCompactProtocol$Factory
 tokenClass=org.apache.accumulo.core.client.security.tokens.PasswordToken
 port=42424
-maxFrameSize=16384000
+maxFrameSize=16M
 
 instance=test
 zookeepers=localhost:2181

Modified: accumulo/branches/1.5/proxy/src/main/java/org/apache/accumulo/proxy/Proxy.java
URL: http://svn.apache.org/viewvc/accumulo/branches/1.5/proxy/src/main/java/org/apache/accumulo/proxy/Proxy.java?rev=1484928&r1=1484927&r2=1484928&view=diff
==============================================================================
--- accumulo/branches/1.5/proxy/src/main/java/org/apache/accumulo/proxy/Proxy.java (original)
+++ accumulo/branches/1.5/proxy/src/main/java/org/apache/accumulo/proxy/Proxy.java Tue May
21 20:06:17 2013
@@ -24,6 +24,7 @@ import java.lang.reflect.Constructor;
 import java.util.Properties;
 
 import org.apache.accumulo.core.cli.Help;
+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;
@@ -135,8 +136,10 @@ public class Proxy {
     
     THsHaServer.Args args = new THsHaServer.Args(socket);
     args.processor(processor);
-    final int maxFrameSize = Integer.parseInt(properties.getProperty("maxFrameSize", "16384000"));
-    args.transportFactory(new TFramedTransport.Factory(maxFrameSize));
+    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