JBoss Cache SVN: r5004 - cache-bench-fwk/trunk/src/org/cachebench/tests.
by jbosscache-commits@lists.jboss.org
Author: mircea.markus
Date: 2008-01-05 18:33:10 -0500 (Sat, 05 Jan 2008)
New Revision: 5004
Modified:
cache-bench-fwk/trunk/src/org/cachebench/tests/ReplicationOccursTest.java
Log:
increased the memory size for the JVM
Modified: cache-bench-fwk/trunk/src/org/cachebench/tests/ReplicationOccursTest.java
===================================================================
--- cache-bench-fwk/trunk/src/org/cachebench/tests/ReplicationOccursTest.java 2008-01-05 23:24:50 UTC (rev 5003)
+++ cache-bench-fwk/trunk/src/org/cachebench/tests/ReplicationOccursTest.java 2008-01-05 23:33:10 UTC (rev 5004)
@@ -6,10 +6,11 @@
import org.cachebench.TestResult;
import org.cachebench.cluster.ClusterBarrier;
import org.cachebench.config.Configuration;
+import org.cachebench.config.TestCase;
import org.cachebench.config.TestConfig;
-import org.cachebench.config.TestCase;
import java.net.SocketAddress;
+import java.util.Collection;
import java.util.Map;
/**
@@ -126,8 +127,30 @@
log.info("Number of caches that replicated here is " + replicaCount);
if (isPartialReplication(testCaseName, testName))
{
- return replicaCount > 0;
+ return verifyClusterReplication(replicaCount);
}
return replicaCount == conf.getClusterConfig().getClusterSize() - 1;
}
+
+ /**
+ * Checks whether the sum of replciations across the cluster is bigger than the number of nodes in the cluster, in
+ * other words each node replicated at least once.
+ */
+ private boolean verifyClusterReplication(int replicaCount) throws Exception
+ {
+ ClusterBarrier barrier = new ClusterBarrier();
+ barrier.setConfig(conf.getClusterConfig());
+ barrier.barrier(replicaCount);
+ Collection recievedValues = barrier.getReceivedMessages().values();
+ log.trace("Recieved the following repilcation counts: " + recievedValues);
+ int totalValue = 0;
+ for (Object val : recievedValues)
+ {
+ totalValue += Integer.valueOf(val.toString());
+ }
+ log.info("Overall replication count is: " + totalValue);
+ boolean isReplicationSuccess = totalValue >= this.conf.getClusterConfig().getClusterSize();
+ log.info("Is replication passed? " + isReplicationSuccess);
+ return isReplicationSuccess;
+ }
}
16 years, 11 months
JBoss Cache SVN: r5003 - cache-bench-fwk/trunk.
by jbosscache-commits@lists.jboss.org
Author: mircea.markus
Date: 2008-01-05 18:24:50 -0500 (Sat, 05 Jan 2008)
New Revision: 5003
Modified:
cache-bench-fwk/trunk/runNode.sh
Log:
added aditional check
Modified: cache-bench-fwk/trunk/runNode.sh
===================================================================
--- cache-bench-fwk/trunk/runNode.sh 2008-01-05 21:51:31 UTC (rev 5002)
+++ cache-bench-fwk/trunk/runNode.sh 2008-01-05 23:24:50 UTC (rev 5003)
@@ -21,13 +21,17 @@
export SYS_PROPS="-DcurrentIndex=$1 -Dorg.cachebench.debug=$CACHE_DEBUG -Djava.net.preferIPv4Stack=$preferIPv4Stack"
#first kill all the exisiting processes as they might interfere with the new ones/ not sure this works on cygwin
-ps -fe | grep CacheBenchmarkRunner | cut -c 10-20 | xargs kill
+for PID in `ps -fe | grep "Cache*BenchmarkRunner" | cut -c 10-20`
+do
+ kill PID
+done
#libraries needed by the fwk, add them to the classpath
for JAR in ./lib/*
do
FWK_CLASS_PATH=$FWK_CLASS_PATH:$JAR
done
+
FWK_CLASS_PATH=$FWK_CLASS_PATH:./conf:./classes/production/Framework
export FWK_CLASS_PATH
16 years, 11 months
JBoss Cache SVN: r5002 - in cache-bench-fwk/trunk: src/org/cachebench/smartfrog and 1 other directory.
by jbosscache-commits@lists.jboss.org
Author: mircea.markus
Date: 2008-01-05 16:51:31 -0500 (Sat, 05 Jan 2008)
New Revision: 5002
Modified:
cache-bench-fwk/trunk/runNode.sh
cache-bench-fwk/trunk/src/org/cachebench/smartfrog/CacheBenchmarkPrim.java
Log:
increased the memory size for the JVM
Modified: cache-bench-fwk/trunk/runNode.sh
===================================================================
--- cache-bench-fwk/trunk/runNode.sh 2008-01-05 21:25:23 UTC (rev 5001)
+++ cache-bench-fwk/trunk/runNode.sh 2008-01-05 21:51:31 UTC (rev 5002)
@@ -20,6 +20,9 @@
export SYS_PROPS="-DcurrentIndex=$1 -Dorg.cachebench.debug=$CACHE_DEBUG -Djava.net.preferIPv4Stack=$preferIPv4Stack"
+#first kill all the exisiting processes as they might interfere with the new ones/ not sure this works on cygwin
+ps -fe | grep CacheBenchmarkRunner | cut -c 10-20 | xargs kill
+
#libraries needed by the fwk, add them to the classpath
for JAR in ./lib/*
do
Modified: cache-bench-fwk/trunk/src/org/cachebench/smartfrog/CacheBenchmarkPrim.java
===================================================================
--- cache-bench-fwk/trunk/src/org/cachebench/smartfrog/CacheBenchmarkPrim.java 2008-01-05 21:25:23 UTC (rev 5001)
+++ cache-bench-fwk/trunk/src/org/cachebench/smartfrog/CacheBenchmarkPrim.java 2008-01-05 21:51:31 UTC (rev 5002)
@@ -7,10 +7,7 @@
import org.smartfrog.sfcore.prim.PrimImpl;
import org.smartfrog.sfcore.prim.TerminationRecord;
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.InputStreamReader;
-import java.io.LineNumberReader;
+import java.io.*;
import java.rmi.RemoteException;
/**
@@ -59,17 +56,34 @@
try
{
runBenchmark();
- } catch (Exception e)
+ } catch (SmartFrogException e)
{
- throw new IllegalStateException(e);
+ log.error("Unexpected error:" + e.getMessage(), e);
+
+ } catch (IOException e)
+ {
+ log.warn("Does the script have X rights?", e);
+ terminate(e);
+
+ } catch (InterruptedException e)
+ {
+ log.err("This is quite strange", e);
+ terminate(e);
}
}
+ private void terminate(Exception e)
+ {
+ TerminationRecord terminationRecord = new TerminationRecord(TerminationRecord.ABNORMAL , "terminated the benchmark " +
+ getNodeDescription(),null, e);
+ sfTerminate(terminationRecord);
+
+ }
};
thread.start();
}
private void runBenchmark()
- throws SmartFrogException, RemoteException
+ throws SmartFrogException, IOException, InterruptedException
{
super.sfStart();
log.trace("Entered sfStart...");
@@ -78,8 +92,6 @@
log.info("Not processing this node" + getNodeDescription());
return;
}
- try
- {
String command = scriptToExec + " " + nodeIndex + " " + cacheDistribution + " -DclusterSize=" + clusterSize;
log.info("Executing command: " + command);
Process process = Runtime.getRuntime().exec(command, null, toRunIn);
@@ -96,12 +108,6 @@
{
sfTerminate(new TerminationRecord(TerminationRecord.ABNORMAL, "we have an NOT zero exit code: " + exitValue, null));
}
- }
- catch (Exception e)
- {
- log.error("Unexpected error:" + e.getMessage(), e);
- throw new RemoteException("Unexpected error",e);
- }
log.debug("Terminating the tests...");
TerminationRecord terminationRecord = new TerminationRecord(TerminationRecord.NORMAL, "terminated the benchmark " +
getNodeDescription(), null);
16 years, 11 months
JBoss Cache SVN: r5001 - cache-bench-fwk/trunk.
by jbosscache-commits@lists.jboss.org
Author: mircea.markus
Date: 2008-01-05 16:25:23 -0500 (Sat, 05 Jan 2008)
New Revision: 5001
Modified:
cache-bench-fwk/trunk/runNode.sh
Log:
increased the memory size for the JVM
Modified: cache-bench-fwk/trunk/runNode.sh
===================================================================
--- cache-bench-fwk/trunk/runNode.sh 2008-01-05 20:16:51 UTC (rev 5000)
+++ cache-bench-fwk/trunk/runNode.sh 2008-01-05 21:25:23 UTC (rev 5001)
@@ -5,6 +5,7 @@
CACHE_DEBUG=true
preferIPv4Stack=true
+export JVM_ARGS=-Xmx1024m
if [ -z $1 ]
then
@@ -45,8 +46,8 @@
echo executing command $START_NODE_COMMAND
$START_NODE_COMMAND
else
- TO_EXECUTE="java -cp $CLASSPATH $3 $SYS_PROPS org.cachebench.CacheBenchmarkRunner $4"
+ TO_EXECUTE="java $JVM_ARGS -cp $CLASSPATH $3 $SYS_PROPS org.cachebench.CacheBenchmarkRunner $4"
echo executing $TO_EXECUTE
- java -cp $CLASSPATH $3 $SYS_PROPS org.cachebench.CacheBenchmarkRunner $4
+ java $JVM_ARGS -cp $CLASSPATH $3 $SYS_PROPS org.cachebench.CacheBenchmarkRunner $4
fi
16 years, 11 months
JBoss Cache SVN: r5000 - cache-bench-fwk/trunk/src/org/cachebench/smartfrog.
by jbosscache-commits@lists.jboss.org
Author: mircea.markus
Date: 2008-01-05 15:16:51 -0500 (Sat, 05 Jan 2008)
New Revision: 5000
Modified:
cache-bench-fwk/trunk/src/org/cachebench/smartfrog/CacheBenchmarkPrim.java
Log:
Modified: cache-bench-fwk/trunk/src/org/cachebench/smartfrog/CacheBenchmarkPrim.java
===================================================================
--- cache-bench-fwk/trunk/src/org/cachebench/smartfrog/CacheBenchmarkPrim.java 2008-01-05 15:47:33 UTC (rev 4999)
+++ cache-bench-fwk/trunk/src/org/cachebench/smartfrog/CacheBenchmarkPrim.java 2008-01-05 20:16:51 UTC (rev 5000)
@@ -52,6 +52,25 @@
public synchronized void sfStart() throws SmartFrogException, RemoteException
{
+ Thread thread = new Thread()
+ {
+ public void run()
+ {
+ try
+ {
+ runBenchmark();
+ } catch (Exception e)
+ {
+ throw new IllegalStateException(e);
+ }
+ }
+ };
+ thread.start();
+ }
+
+ private void runBenchmark()
+ throws SmartFrogException, RemoteException
+ {
super.sfStart();
log.trace("Entered sfStart...");
if (clusterSize <= nodeIndex)
16 years, 11 months
JBoss Cache SVN: r4999 - cache-bench-fwk/trunk/src/org/cachebench/smartfrog.
by jbosscache-commits@lists.jboss.org
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 + " )";
}
16 years, 11 months
JBoss Cache SVN: r4998 - core/trunk/src/main/java/org/jboss/cache/marshall.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-01-05 07:52:51 -0500 (Sat, 05 Jan 2008)
New Revision: 4998
Modified:
core/trunk/src/main/java/org/jboss/cache/marshall/CacheMarshaller200.java
Log:
Improved performance of reference mapping collection
Modified: core/trunk/src/main/java/org/jboss/cache/marshall/CacheMarshaller200.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/marshall/CacheMarshaller200.java 2008-01-05 12:52:33 UTC (rev 4997)
+++ core/trunk/src/main/java/org/jboss/cache/marshall/CacheMarshaller200.java 2008-01-05 12:52:51 UTC (rev 4998)
@@ -117,7 +117,7 @@
{
// not region based!
if (trace) log.trace("Marshalling object " + o);
- Map<Object, Integer> refMap = new HashMap<Object, Integer>();
+ ReferencesMap refMap = new ReferencesMap();
marshallObject(o, out, refMap);
}
}
@@ -140,7 +140,7 @@
public void objectToObjectStream(Object o, ObjectOutputStream out, Fqn region) throws Exception
{
if (trace) log.trace("Marshalling object " + o);
- Map<Object, Integer> refMap = new HashMap<Object, Integer>();
+ ReferencesMap refMap = new ReferencesMap();
if (useRegionBasedMarshalling) // got to check again in case this meth is called directly
{
log.trace("Writing region " + region + " to stream");
@@ -257,16 +257,18 @@
}
// --------- Marshalling methods
- private void marshallObject(Object o, ObjectOutputStream out, Map<Object, Integer> refMap) throws Exception
+ private void marshallObject(Object o, ObjectOutputStream out, ReferencesMap refMap) throws Exception
{
+ int reference;
+
if (o == null)
{
out.writeByte(MAGICNUMBER_NULL);
}
- else if (refMap.containsKey(o))// see if this object has been marshalled before.
+ else if ((reference = refMap.getReference(o)) > -1)// see if this object has been marshalled before.
{
out.writeByte(MAGICNUMBER_REF);
- writeReference(out, refMap.get(o));
+ writeReference(out, reference);
}
else if (o instanceof MethodCall)
{
@@ -402,7 +404,7 @@
}
}
- private void marshallGravitateResult(GravitateResult gravitateResult, ObjectOutputStream out, Map<Object, Integer> refMap) throws Exception
+ private void marshallGravitateResult(GravitateResult gravitateResult, ObjectOutputStream out, ReferencesMap refMap) throws Exception
{
marshallObject(gravitateResult.isDataFound(), out, refMap);
if (gravitateResult.isDataFound())
@@ -413,20 +415,19 @@
}
- private int createReference(Object o, Map<Object, Integer> refMap)
+ private int createReference(Object o, ReferencesMap refMap)
{
- int reference = refMap.size();
- refMap.put(o, reference);
+ int reference = refMap.nextAvailableReference();
+ refMap.put(reference, o);
return reference;
}
private void marshallString(String s, ObjectOutputStream out) throws Exception
{
- //StringUtil.saveString(out, s);
out.writeObject(s);
}
- private void marshallMethodCall(MethodCall methodCall, ObjectOutputStream out, Map<Object, Integer> refMap) throws Exception
+ private void marshallMethodCall(MethodCall methodCall, ObjectOutputStream out, ReferencesMap refMap) throws Exception
{
out.writeShort(methodCall.getMethodId());
Object[] args = methodCall.getArgs();
@@ -439,14 +440,14 @@
}
}
- private void marshallGlobalTransaction(GlobalTransaction globalTransaction, ObjectOutputStream out, Map<Object, Integer> refMap) throws Exception
+ private void marshallGlobalTransaction(GlobalTransaction globalTransaction, ObjectOutputStream out, ReferencesMap refMap) throws Exception
{
out.writeLong(globalTransaction.getId());
marshallObject(globalTransaction.getAddress(), out, refMap);
}
- private void marshallFqn(Fqn fqn, ObjectOutputStream out, Map<Object, Integer> refMap) throws Exception
+ private void marshallFqn(Fqn fqn, ObjectOutputStream out, ReferencesMap refMap) throws Exception
{
boolean isRoot = fqn.isRoot();
out.writeBoolean(isRoot);
@@ -465,7 +466,7 @@
ipAddress.writeExternal(out);
}
- private void marshallCollection(Collection c, ObjectOutputStream out, Map refMap) throws Exception
+ private void marshallCollection(Collection c, ObjectOutputStream out, ReferencesMap refMap) throws Exception
{
writeUnsignedInt(out, c.size());
for (Object o : c)
@@ -474,7 +475,7 @@
}
}
- private void marshallMap(Map map, ObjectOutputStream out, Map<Object, Integer> refMap) throws Exception
+ private void marshallMap(Map map, ObjectOutputStream out, ReferencesMap refMap) throws Exception
{
int mapSize = map.size();
writeUnsignedInt(out, mapSize);
@@ -809,3 +810,28 @@
out.writeLong(i);
}
}
+
+class ReferencesMap
+{
+ private ArrayList<Object> referencedObjects = new ArrayList<Object>();
+
+ void put(int reference, Object object)
+ {
+ referencedObjects.add(reference, object);
+ }
+
+ Object get(int reference)
+ {
+ return referencedObjects.get(reference);
+ }
+
+ int nextAvailableReference()
+ {
+ return referencedObjects.size();
+ }
+
+ int getReference(Object object)
+ {
+ return referencedObjects.indexOf(object);
+ }
+}
16 years, 11 months
JBoss Cache SVN: r4997 - core/trunk/src/main/java/org/jboss/cache.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-01-05 07:52:33 -0500 (Sat, 05 Jan 2008)
New Revision: 4997
Modified:
core/trunk/src/main/java/org/jboss/cache/Fqn.java
Log:
Added comments on deprecation
Modified: core/trunk/src/main/java/org/jboss/cache/Fqn.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/Fqn.java 2008-01-04 20:25:50 UTC (rev 4996)
+++ core/trunk/src/main/java/org/jboss/cache/Fqn.java 2008-01-05 12:52:33 UTC (rev 4997)
@@ -57,13 +57,16 @@
* <p/>
* Another way to look at it is that the "/" separarator is only parsed when it forms
* part of a String passed in to Fqn.fromString() and not otherwise.
+ * <p/>
+ * <B>NOTE</B> that support for custom object elements of Fqns will be <i>dropped</i> from JBoss Cache 3.0.0 onwards. Consider
+ * it's use in 2.x as a deprecated feature.. From 3.0.0 onwards, Fqns will only be able to contain <tt>String</tt>s or
+ * Java primitives (<tt>byte</tt>, <tt>short</tt>, <tt>int</tt>, <tt>long</tt>, <tt>float</tt>, <tt>double</tt>, <tt>char</tt> and <tt>boolean</tt>).
*
* @version $Revision$
*/
@Immutable
public class Fqn<E> implements Cloneable, Externalizable, Comparable<Fqn<?>>
{
-
/**
* Separator between FQN elements.
*/
16 years, 11 months
JBoss Cache SVN: r4996 - cache-bench-fwk/trunk/src/org/cachebench.
by jbosscache-commits@lists.jboss.org
Author: mircea.markus
Date: 2008-01-04 15:25:50 -0500 (Fri, 04 Jan 2008)
New Revision: 4996
Modified:
cache-bench-fwk/trunk/src/org/cachebench/CacheBenchmarkRunner.java
Log:
the Prim was enhanced to log the output of the run script
Modified: cache-bench-fwk/trunk/src/org/cachebench/CacheBenchmarkRunner.java
===================================================================
--- cache-bench-fwk/trunk/src/org/cachebench/CacheBenchmarkRunner.java 2008-01-04 19:23:10 UTC (rev 4995)
+++ cache-bench-fwk/trunk/src/org/cachebench/CacheBenchmarkRunner.java 2008-01-04 20:25:50 UTC (rev 4996)
@@ -75,7 +75,7 @@
{
logger.warn("No Results to be reported");
}
- logger.info("Benchmarking Completed. Hope you enjoyed using this!");
+ logger.info("Benchmarking Completed. Hope you enjoyed using this! \n");
}
catch (Exception e)
{
16 years, 11 months