From 7ed975362b4ebd15a0df9bf72905d4821f3e1eab Mon Sep 17 00:00:00 2001 From: Daniel Barcelona Date: Mon, 21 May 2018 10:16:07 +0200 Subject: [PATCH 1/4] FIX - server.sh for EC2 --- server/src/main/bin/server.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/src/main/bin/server.sh b/server/src/main/bin/server.sh index 8bffd17..1a8a9dc 100755 --- a/server/src/main/bin/server.sh +++ b/server/src/main/bin/server.sh @@ -3,7 +3,6 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" CLASSPATH="${DIR}/*:${DIR}/lib/*" IP="0.0.0.0" -JVM="-XX:+UseConcMarkSweepGC -Xms64m -Xmx1024m -Djava.net.preferIPv4Stack=true -Djgroups.tcp.address=${IP} -Dlog4j.configurationFile=${DIR}/log4j2.xml" EXTRA="-rf 1" if [ "$1" == "-ec2" ]; @@ -14,4 +13,5 @@ then EXTRA="-proxy ${PIP}:11222 -ec2 -rf 2" fi +JVM="-XX:+UseConcMarkSweepGC -Xms64m -Xmx1024m -Djava.net.preferIPv4Stack=true -Djgroups.tcp.address=${IP} -Dlog4j.configurationFile=${DIR}/log4j2.xml" java -cp ${CLASSPATH} ${JVM} org.infinispan.creson.Server -server ${IP}:11222 ${EXTRA} From 22f9a63bd4986381b74266d97158e8d0ad0d7f48 Mon Sep 17 00:00:00 2001 From: Daniel Barcelona Date: Wed, 30 May 2018 11:54:39 +0200 Subject: [PATCH 2/4] add hotrod worker threads parameter --- server/src/main/java/org/infinispan/creson/Server.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/server/src/main/java/org/infinispan/creson/Server.java b/server/src/main/java/org/infinispan/creson/Server.java index c7f2d92..73ea101 100644 --- a/server/src/main/java/org/infinispan/creson/Server.java +++ b/server/src/main/java/org/infinispan/creson/Server.java @@ -54,6 +54,9 @@ public class Server { @Option(name = "-userLibs", usage = "directory containing the user libraries") private String userLib = userLibraries; + @Option(name = "-wt", usage = "number of HotRod worker threads") + private int workerThreads = 100; + private volatile boolean running = false; public Server() { @@ -145,7 +148,7 @@ public void doMain(String[] args) { hbuilder.proxyPort(proxyPort); } - hbuilder.workerThreads(100); + hbuilder.workerThreads(workerThreads); hbuilder.tcpNoDelay(true); final HotRodServer server = new HotRodServer(); From 6fb5a3b679c2cba3d0cb87ffc0097e38b5c8d7e3 Mon Sep 17 00:00:00 2001 From: Daniel Barcelona Date: Wed, 30 May 2018 17:16:59 +0200 Subject: [PATCH 3/4] Throw exceptions on client --- .../infinispan/creson/container/AbstractContainer.java | 8 +++++--- .../org/infinispan/creson/container/BaseContainer.java | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/client/src/main/java/org/infinispan/creson/container/AbstractContainer.java b/client/src/main/java/org/infinispan/creson/container/AbstractContainer.java index b75769a..99fed12 100644 --- a/client/src/main/java/org/infinispan/creson/container/AbstractContainer.java +++ b/client/src/main/java/org/infinispan/creson/container/AbstractContainer.java @@ -56,7 +56,7 @@ public final Object getProxy(){ public abstract void doExecute(Call call); protected Object execute(Call call) - throws InterruptedException, ExecutionException, java.util.concurrent.TimeoutException { + throws Throwable { if (log.isTraceEnabled()) log.trace(this + " Executing "+call); @@ -72,8 +72,8 @@ protected Object execute(Call call) attempts++; doExecute(call); ret = future.get(TTIMEOUT_TIME, TimeUnit.MILLISECONDS); - if (ret instanceof Throwable) - throw new ExecutionException((Throwable) ret); +// if (ret instanceof Throwable) +// throw new ExecutionException((Throwable) ret); }catch (TimeoutException e) { if (!future.isDone()) log.warn(" Failed "+ call + " ("+e.getMessage()+")"); @@ -83,6 +83,8 @@ protected Object execute(Call call) } Thread.sleep(TTIMEOUT_TIME); } + if (ret instanceof Throwable) + } registeredCalls.remove(call.getCallID()); diff --git a/client/src/main/java/org/infinispan/creson/container/BaseContainer.java b/client/src/main/java/org/infinispan/creson/container/BaseContainer.java index ec04db8..b16016f 100644 --- a/client/src/main/java/org/infinispan/creson/container/BaseContainer.java +++ b/client/src/main/java/org/infinispan/creson/container/BaseContainer.java @@ -164,7 +164,7 @@ public String toString() { // internals private synchronized void open() - throws InterruptedException, ExecutionException, java.util.concurrent.TimeoutException { + throws Throwable { if (!isOpen) { From 6f53fd322f5fb1c1942b640c4aa086254bdc6655 Mon Sep 17 00:00:00 2001 From: Daniel Barcelona Date: Wed, 30 May 2018 17:18:14 +0200 Subject: [PATCH 4/4] Throw exceptions on client --- .../java/org/infinispan/creson/container/AbstractContainer.java | 1 + 1 file changed, 1 insertion(+) diff --git a/client/src/main/java/org/infinispan/creson/container/AbstractContainer.java b/client/src/main/java/org/infinispan/creson/container/AbstractContainer.java index 99fed12..17c2250 100644 --- a/client/src/main/java/org/infinispan/creson/container/AbstractContainer.java +++ b/client/src/main/java/org/infinispan/creson/container/AbstractContainer.java @@ -84,6 +84,7 @@ protected Object execute(Call call) Thread.sleep(TTIMEOUT_TIME); } if (ret instanceof Throwable) + throw ((Throwable) ret).getCause(); }