From a7e06721dab5ec5fe4ad3cda312bda336f61220c Mon Sep 17 00:00:00 2001 From: Stefano Mazzocchi Date: Thu, 13 May 2010 01:10:41 +0000 Subject: [PATCH] Issue 23 making gridworks print out the parameters that it was initialized with (we have to pass them from the command line because there is no way to access it directly from java from the standard java library) git-svn-id: http://google-refine.googlecode.com/svn/trunk@745 7d457c2a-affb-35e4-300a-418c747d4874 --- gridworks | 2 +- gridworks.bat | 2 +- src/server/java/com/metaweb/gridworks/Gridworks.java | 5 +++++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/gridworks b/gridworks index 6624e0c7a..9b6646928 100755 --- a/gridworks +++ b/gridworks @@ -750,7 +750,7 @@ add_option "$JAVA_OPTIONS" if [ -z "$GRIDWORKS_MEMORY" ]; then GRIDWORKS_MEMORY="1024M" fi -add_option "-Xms256M -Xmx$GRIDWORKS_MEMORY" +add_option "-Xms256M -Xmx$GRIDWORKS_MEMORY -Dgridworks.memory=$GRIDWORKS_MEMORY" if [ -z "$GRIDWORKS_PORT" ]; then GRIDWORKS_PORT="3333" diff --git a/gridworks.bat b/gridworks.bat index 5aeb52693..8c4f8b273 100644 --- a/gridworks.bat +++ b/gridworks.bat @@ -127,7 +127,7 @@ set OPTS=%OPTS% %JAVA_OPTIONS% if not "%GRIDWORKS_MEMORY%" == "" goto gotMemory set GRIDWORKS_MEMORY=1024M :gotMemory -set OPTS=%OPTS% -Xms256M -Xmx%GRIDWORKS_MEMORY% +set OPTS=%OPTS% -Xms256M -Xmx%GRIDWORKS_MEMORY% -Dgridworks.memory=%GRIDWORKS_MEMORY% if not "%GRIDWORKS_PORT%" == "" goto gotPort set GRIDWORKS_PORT=3333 diff --git a/src/server/java/com/metaweb/gridworks/Gridworks.java b/src/server/java/com/metaweb/gridworks/Gridworks.java index d47060e0d..f635e0e5e 100644 --- a/src/server/java/com/metaweb/gridworks/Gridworks.java +++ b/src/server/java/com/metaweb/gridworks/Gridworks.java @@ -128,6 +128,11 @@ class GridworksServer extends Server { private ThreadPoolExecutor threadPool; public void init(String host, int port) throws Exception { + logger.info("Starting Server bound to '" + host + ":" + port + "'"); + + String memory = Configurations.get("gridworks.memory"); + if (memory != null) logger.info("Max memory size: " + memory); + int maxThreads = Configurations.getInteger("gridworks.queue.size", 30); int maxQueue = Configurations.getInteger("gridworks.queue.max_size", 300); long keepAliveTime = Configurations.getInteger("gridworks.queue.idle_time", 60);