Author: mircea.markus
Date: 2008-01-05 10:47:33 -0500 (Sat, 05 Jan 2008)
New Revision: 4999
Modified:
cache-bench-fwk/trunk/src/org/cachebench/smartfrog/CacheBenchmarkPrim.java
Log:
only designated nodes trigger the script now
Modified: cache-bench-fwk/trunk/src/org/cachebench/smartfrog/CacheBenchmarkPrim.java
===================================================================
--- cache-bench-fwk/trunk/src/org/cachebench/smartfrog/CacheBenchmarkPrim.java 2008-01-05
12:52:51 UTC (rev 4998)
+++ cache-bench-fwk/trunk/src/org/cachebench/smartfrog/CacheBenchmarkPrim.java 2008-01-05
15:47:33 UTC (rev 4999)
@@ -54,6 +54,11 @@
{
super.sfStart();
log.trace("Entered sfStart...");
+ if (clusterSize <= nodeIndex)
+ {
+ log.info("Not processing this node" + getNodeDescription());
+ return;
+ }
try
{
String command = scriptToExec + " " + nodeIndex + " " +
cacheDistribution + " -DclusterSize=" + clusterSize;
@@ -64,12 +69,13 @@
String line;
while ((line = bufferedReader.readLine()) != null)
{
- log.debug(scriptToExec + ">>>" + line);
+ log.debug(scriptToExec + " >>> " + line);
}
+ bufferedReader.close();
int exitValue = process.waitFor();
if (exitValue != 0)
{
- sfTerminate(new TerminationRecord(TerminationRecord.ABNORMAL, "we have
an not 0 exit code: " + exitValue, null));
+ sfTerminate(new TerminationRecord(TerminationRecord.ABNORMAL, "we have
an NOT zero exit code: " + exitValue, null));
}
}
catch (Exception e)
@@ -77,11 +83,11 @@
log.error("Unexpected error:" + e.getMessage(), e);
throw new RemoteException("Unexpected error",e);
}
- log.trace("Terminating the tests...");
+ log.debug("Terminating the tests...");
TerminationRecord terminationRecord = new
TerminationRecord(TerminationRecord.NORMAL, "terminated the benchmark " +
- getDescription(), null);
+ getNodeDescription(), null);
sfTerminate(terminationRecord);
- log.debug("Test terminated successfully " + getDescription());
+ log.debug("Test terminated successfully " + getNodeDescription());
}
private File getFwkHomeDir()
@@ -103,7 +109,7 @@
log.trace("sfTerminateWith called with value:" + terminationRecord);
}
- public String getDescription()
+ public String getNodeDescription()
{
return "( clusterSize:" + clusterSize + ", nodeIndex:" +
this.nodeIndex + " )";
}
Show replies by date