JBoss Cache SVN: r6313 - in benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-3.0.0: src/org/cachebench/cachewrappers and 1 other directory.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-07-17 07:46:40 -0400 (Thu, 17 Jul 2008)
New Revision: 6313
Modified:
benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-3.0.0/lib/jbosscache-core.jar
benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-3.0.0/src/org/cachebench/cachewrappers/JBossCache300Wrapper.java
Log:
Updated jbc-3.0.0 jar and wrapper
Modified: benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-3.0.0/lib/jbosscache-core.jar
===================================================================
(Binary files differ)
Modified: benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-3.0.0/src/org/cachebench/cachewrappers/JBossCache300Wrapper.java
===================================================================
--- benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-3.0.0/src/org/cachebench/cachewrappers/JBossCache300Wrapper.java 2008-07-17 10:56:16 UTC (rev 6312)
+++ benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-3.0.0/src/org/cachebench/cachewrappers/JBossCache300Wrapper.java 2008-07-17 11:46:40 UTC (rev 6313)
@@ -39,12 +39,12 @@
public void put(List<String> path, Object key, Object value) throws Exception
{
- cache.put(Fqn.fromList(path), key, value);
+ cache.put(Fqn.fromList((List) path, true), key, value);
}
public Object get(List<String> path, Object key) throws Exception
{
- return cache.get(Fqn.fromList(path), key);
+ return cache.get(Fqn.fromList((List) path, true), key);
}
public void empty() throws Exception
@@ -67,6 +67,6 @@
{
Option option = cache.getInvocationContext().getOptionOverrides();
option.setForceDataGravitation(true);
- return cache.get(Fqn.fromList(path), key);
+ return cache.get(Fqn.fromList((List) path, true), key);
}
}
17 years, 5 months
JBoss Cache SVN: r6312 - in core/trunk/src: main/resources/config-samples and 1 other directories.
by jbosscache-commits@lists.jboss.org
Author: mircea.markus
Date: 2008-07-17 06:56:16 -0400 (Thu, 17 Jul 2008)
New Revision: 6312
Added:
core/trunk/src/main/resources/jbosscache-config-3.0ALPHA1.xsd
Removed:
core/trunk/src/main/resources/jbosscache-config-3.0.xsd
Modified:
core/trunk/src/main/resources/config-samples/buddy-replication.xml
core/trunk/src/main/resources/config-samples/cacheloader-enabled.xml
core/trunk/src/main/resources/config-samples/eviction-enabled.xml
core/trunk/src/main/resources/config-samples/invalidation-async.xml
core/trunk/src/main/resources/config-samples/local.xml
core/trunk/src/main/resources/config-samples/multiplexer-enabled.xml
core/trunk/src/test/resources/configs/buddy-replication-cache.xml
core/trunk/src/test/resources/configs/clonable-config.xml
core/trunk/src/test/resources/configs/local-lru-eviction.xml
core/trunk/src/test/resources/configs/local-passivation.xml
core/trunk/src/test/resources/configs/local-tx.xml
core/trunk/src/test/resources/configs/mixedPolicy-eviction.xml
core/trunk/src/test/resources/configs/mux.xml
core/trunk/src/test/resources/configs/parser-test.xml
core/trunk/src/test/resources/configs/policyPerRegion-eviction.xml
core/trunk/src/test/resources/configs/replSync.xml
core/trunk/src/test/resources/configs/string-property-replaced.xml
Log:
changed the name of the XSD file
Modified: core/trunk/src/main/resources/config-samples/buddy-replication.xml
===================================================================
--- core/trunk/src/main/resources/config-samples/buddy-replication.xml 2008-07-17 10:47:11 UTC (rev 6311)
+++ core/trunk/src/main/resources/config-samples/buddy-replication.xml 2008-07-17 10:56:16 UTC (rev 6312)
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:noNamespaceSchemaLocation="http://www.jboss.org/jbosscache/jbosscache-config-3.0.xsd">
+ xsi:noNamespaceSchemaLocation="http://www.jboss.org/jbosscache/jbosscache-config-3.0ALPHA1.xsd">
<!--
isolationLevel : SERIALIZABLE - (not supported in mvcc)
Modified: core/trunk/src/main/resources/config-samples/cacheloader-enabled.xml
===================================================================
--- core/trunk/src/main/resources/config-samples/cacheloader-enabled.xml 2008-07-17 10:47:11 UTC (rev 6311)
+++ core/trunk/src/main/resources/config-samples/cacheloader-enabled.xml 2008-07-17 10:56:16 UTC (rev 6312)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:noNamespaceSchemaLocation="http://www.jboss.org/jbosscache/jbosscache-config-3.0.xsd">
+ xsi:noNamespaceSchemaLocation="http://www.jboss.org/jbosscache/jbosscache-config-3.0ALPHA1.xsd">
<!--
isolationLevel : SERIALIZABLE - (not supported in mvcc)
Modified: core/trunk/src/main/resources/config-samples/eviction-enabled.xml
===================================================================
--- core/trunk/src/main/resources/config-samples/eviction-enabled.xml 2008-07-17 10:47:11 UTC (rev 6311)
+++ core/trunk/src/main/resources/config-samples/eviction-enabled.xml 2008-07-17 10:56:16 UTC (rev 6312)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:noNamespaceSchemaLocation="http://www.jboss.org/jbosscache/jbosscache-config-3.0.xsd">
+ xsi:noNamespaceSchemaLocation="http://www.jboss.org/jbosscache/jbosscache-config-3.0ALPHA1.xsd">
<!--
isolationLevel : SERIALIZABLE - (not supported in mvcc)
Modified: core/trunk/src/main/resources/config-samples/invalidation-async.xml
===================================================================
--- core/trunk/src/main/resources/config-samples/invalidation-async.xml 2008-07-17 10:47:11 UTC (rev 6311)
+++ core/trunk/src/main/resources/config-samples/invalidation-async.xml 2008-07-17 10:56:16 UTC (rev 6312)
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:noNamespaceSchemaLocation="http://www.jboss.org/jbosscache/jbosscache-config-3.0.xsd">
+ xsi:noNamespaceSchemaLocation="http://www.jboss.org/jbosscache/jbosscache-config-3.0ALPHA1.xsd">
<!--
isolationLevel : SERIALIZABLE - (not supported in mvcc)
Modified: core/trunk/src/main/resources/config-samples/local.xml
===================================================================
--- core/trunk/src/main/resources/config-samples/local.xml 2008-07-17 10:47:11 UTC (rev 6311)
+++ core/trunk/src/main/resources/config-samples/local.xml 2008-07-17 10:56:16 UTC (rev 6312)
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:noNamespaceSchemaLocation="http://www.jboss.org/jbosscache/jbosscache-config-3.0.xsd">
+ xsi:noNamespaceSchemaLocation="http://www.jboss.org/jbosscache/jbosscache-config-3.0ALPHA1.xsd">
<!-- By not specifying neither an 'replication' nor an 'invalidation' element, the cache is defaulted to local -->
Modified: core/trunk/src/main/resources/config-samples/multiplexer-enabled.xml
===================================================================
--- core/trunk/src/main/resources/config-samples/multiplexer-enabled.xml 2008-07-17 10:47:11 UTC (rev 6311)
+++ core/trunk/src/main/resources/config-samples/multiplexer-enabled.xml 2008-07-17 10:56:16 UTC (rev 6312)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:noNamespaceSchemaLocation="http://www.jboss.org/jbosscache/jbosscache-config-3.0.xsd">
+ xsi:noNamespaceSchemaLocation="http://www.jboss.org/jbosscache/jbosscache-config-3.0ALPHA1.xsd">
<!--
isolationLevel : SERIALIZABLE - (not supported in mvcc)
Deleted: core/trunk/src/main/resources/jbosscache-config-3.0.xsd
===================================================================
--- core/trunk/src/main/resources/jbosscache-config-3.0.xsd 2008-07-17 10:47:11 UTC (rev 6311)
+++ core/trunk/src/main/resources/jbosscache-config-3.0.xsd 2008-07-17 10:56:16 UTC (rev 6312)
@@ -1,244 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<xs:schema attributeFormDefault="unqualified" elementFormDefault="unqualified"
- xmlns:xs="http://www.w3.org/2001/XMLSchema">
- <xs:element name="jbosscache">
- <xs:complexType>
- <xs:all>
- <xs:element name="locking" type="lockingType" minOccurs="0"/>
- <xs:element name="transaction" type="transactionType" minOccurs="0"/>
- <xs:element name="startup" type="startupType" minOccurs="0"/>
- <xs:element name="stateRetrieval" type="stateRetrievalType" minOccurs="0"/>
- <xs:element name="shutdown" type="shutdownType" minOccurs="0"/>
- <xs:element name="serialization" type="serializationType" minOccurs="0"/>
- <xs:element name="replication" type="replicationType" minOccurs="0"/>
- <xs:element name="invalidation" type="invalidationType" minOccurs="0"/>
- <xs:element name="jmxStatistics" type="jmxStatisticsType" minOccurs="0"/>
- <xs:element name="transport" type="transportType" minOccurs="0"/>
- <xs:element name="eviction" type="evictionType" minOccurs="0"/>
- <xs:element name="loaders" type="loadersType" minOccurs="0"/>
- <xs:element name="customInterceptors" type="customInterceptorsType" minOccurs="0"/>
- </xs:all>
- </xs:complexType>
- </xs:element>
-
- <xs:complexType name="lockingType">
- <xs:attribute name="isolationLevel">
- <xs:simpleType>
- <xs:restriction base="xs:string">
- <xs:pattern value="SERIALIZABLE|REPEATABLE_READ|READ_COMMITTED|NONE|\$\{.*\}"/>
- </xs:restriction>
- </xs:simpleType>
- </xs:attribute>
- <xs:attribute name="lockParentForChildInsertRemove" type="booleanType"/>
- <xs:attribute name="lockAcquisitionTimeout" type="positiveInteger"/>
- <xs:attribute name="nodeLockingScheme">
- <xs:simpleType>
- <xs:restriction base="xs:string">
- <xs:pattern value="mvcc|optimistic|pessimistic|\$\{.*\}"/>
- </xs:restriction>
- </xs:simpleType>
- </xs:attribute>
- <xs:attribute name="writeSkewCheck" type="booleanType"/>
- <xs:attribute name="concurrencyLevel" type="xs:integer"/>
- </xs:complexType>
-
- <xs:complexType name="transactionType">
- <xs:attribute name="transactionManagerLookupClass" type="xs:string"/>
- <xs:attribute name="syncRollbackPhase" type="booleanType"/>
- <xs:attribute name="syncCommitPhase" type="booleanType"/>
- </xs:complexType>
-
- <xs:complexType name="startupType">
- <xs:attribute name="regionsInactiveOnStartup" type="booleanType"/>
- </xs:complexType>
-
- <xs:complexType name="stateRetrievalType">
- <xs:attribute name="fetchInMemoryState" type="booleanType"/>
- <xs:attribute name="timeout" type="positiveInteger"/>
- </xs:complexType>
-
- <xs:complexType name="shutdownType">
- <xs:attribute name="hookBehavior">
- <xs:simpleType>
- <xs:restriction base="xs:string">
- <xs:pattern value="DEFAULT|REGISTER|DONT_REGISTER|\$\{.*\}"/>
- </xs:restriction>
- </xs:simpleType>
- </xs:attribute>
- </xs:complexType>
-
- <xs:complexType name="serializationType">
- <xs:attribute name="objectInputStreamPoolSize" type="positiveInteger"/>
- <xs:attribute name="objectOutputStreamPoolSize" type="positiveInteger"/>
- <xs:attribute name="version" type="xs:string"/>
- <xs:attribute name="marshallerClass" type="xs:string"/>
- <xs:attribute name="useLazyDeserialization" type="booleanType"/>
- <xs:attribute name="useRegionBasedMarshalling" type="booleanType"/>
- </xs:complexType>
-
- <xs:simpleType name="booleanType">
- <xs:restriction base="xs:string">
- <xs:pattern value="\$\{.*\}|true|false"/>
- </xs:restriction>
- </xs:simpleType>
-
- <xs:simpleType name="positiveInteger">
- <xs:restriction base="xs:string">
- <xs:pattern value="\$\{.*\}|\+?[0-9]*"/>
- </xs:restriction>
- </xs:simpleType>
-
- <xs:complexType name="replicationType">
- <xs:sequence>
- <xs:choice>
- <xs:element name="sync" type="syncType" minOccurs="0" maxOccurs="1"/>
- <xs:element name="async" type="asyncType" minOccurs="0" maxOccurs="1"/>
- </xs:choice>
- <xs:element name="buddy" minOccurs="0">
- <xs:complexType>
- <xs:all minOccurs="0">
- <xs:element name="dataGravitation">
- <xs:complexType>
- <xs:attribute name="auto" type="booleanType"/>
- <xs:attribute name="removeOnFind" type="booleanType"/>
- <xs:attribute name="searchBackupTrees" type="booleanType"/>
- </xs:complexType>
- </xs:element>
- <xs:element name="locator">
- <xs:complexType>
- <xs:all>
- <xs:element name="properties" type="xs:string" maxOccurs="1"/>
- </xs:all>
- <xs:attribute name="class" type="xs:string"/>
- </xs:complexType>
- </xs:element>
- </xs:all>
- <xs:attribute name="enabled" type="booleanType"/>
- <xs:attribute name="poolName" type="xs:string"/>
- <xs:attribute name="communicationTimeout" type="xs:integer"/>
- </xs:complexType>
- </xs:element>
- </xs:sequence>
- </xs:complexType>
-
- <xs:complexType name="invalidationType">
- <xs:choice>
- <xs:element name="sync" type="syncType"/>
- <xs:element name="async" type="asyncType"/>
- </xs:choice>
- </xs:complexType>
-
- <xs:complexType name="jmxStatisticsType">
- <xs:attribute name="enabled" type="booleanType"/>
- </xs:complexType>
-
- <xs:complexType name="transportType">
- <xs:sequence>
- <xs:element name="jgroupsConfig" type="xs:anyType" minOccurs="0" maxOccurs="1"/>
- </xs:sequence>
- <xs:attribute name="clusterName" type="xs:string"/>
- <xs:attribute name="multiplexerStack" type="xs:string"/>
- </xs:complexType>
-
- <xs:complexType name="syncType">
- <xs:attribute name="replTimeout" type="positiveInteger"/>
- </xs:complexType>
-
-
- <xs:complexType name="asyncType">
- <xs:attribute name="useReplQueue" type="booleanType"/>
- <xs:attribute name="replQueueInterval" type="positiveInteger"/>
- <xs:attribute name="replQueueMaxElements" type="positiveInteger"/>
- </xs:complexType>
-
- <xs:complexType name="evictionType">
- <xs:sequence>
- <xs:element name="default" type="evictionRegionType" minOccurs="0"/>
- <xs:element name="region" minOccurs="0" maxOccurs="unbounded" type="evictionRegionType"/>
- </xs:sequence>
- <xs:attribute name="wakeUpInterval" type="positiveInteger" use="required"/>
- <xs:attribute name="defaultPolicyClass" type="xs:string"/>
- <xs:attribute name="defaultEventQueueSize" type="positiveInteger"/>
- </xs:complexType>
-
- <xs:complexType name="evictionRegionType">
- <xs:sequence>
- <xs:element name="attribute" maxOccurs="unbounded" type="attributeType"/>
- </xs:sequence>
- <xs:attribute name="name" type="xs:string"/>
- <xs:attribute name="policyClass" type="xs:string"/>
- <xs:attribute name="eventQueueSize" type="positiveInteger"/>
- </xs:complexType>
-
- <xs:complexType name="loadersType">
- <xs:sequence>
- <xs:element name="preload" maxOccurs="1">
- <xs:complexType>
- <xs:sequence>
- <xs:element name="node" maxOccurs="unbounded">
- <xs:complexType>
- <xs:attribute name="fqn" type="xs:string"/>
- </xs:complexType>
- </xs:element>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- <xs:element name="loader" maxOccurs="unbounded">
- <xs:complexType>
- <xs:all>
- <xs:element name="properties"/>
- <xs:element name="singletonStore" minOccurs="0">
- <xs:complexType>
- <xs:all>
- <xs:element name="properties" type="xs:string"/>
- </xs:all>
- <xs:attribute name="enabled" type="booleanType"/>
- <xs:attribute name="class" type="xs:string"/>
- </xs:complexType>
- </xs:element>
- </xs:all>
- <xs:attribute name="class" type="xs:string"/>
- <xs:attribute name="async" type="booleanType"/>
- <xs:attribute name="fetchPersistentState" type="booleanType"/>
- <xs:attribute name="ignoreModifications" type="booleanType"/>
- <xs:attribute name="purgeOnStartup" type="booleanType"/>
- </xs:complexType>
- </xs:element>
- </xs:sequence>
- <xs:attribute name="passivation" type="booleanType"/>
- <xs:attribute name="shared" type="booleanType"/>
- </xs:complexType>
-
- <xs:complexType name="customInterceptorsType">
- <xs:sequence>
- <xs:element name="interceptor" maxOccurs="unbounded">
- <xs:complexType>
- <xs:sequence>
- <xs:element name="attribute" maxOccurs="unbounded" type="attributeType" minOccurs="0"/>
- </xs:sequence>
- <xs:attribute name="class" type="xs:string"/>
- <xs:attribute name="position">
- <xs:simpleType>
- <xs:restriction base="xs:string">
- <xs:enumeration value="first"/>
- <xs:enumeration value="last"/>
- </xs:restriction>
- </xs:simpleType>
- </xs:attribute>
- <xs:attribute name="before" type="xs:string"/>
- <xs:attribute name="after" type="xs:string"/>
- <xs:attribute name="index" type="positiveInteger"/>
- </xs:complexType>
- </xs:element>
- </xs:sequence>
- </xs:complexType>
-
- <xs:complexType name="attributeType">
- <xs:simpleContent>
- <xs:extension base="xs:string">
- <xs:attribute name="name" type="xs:string"/>
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
-</xs:schema>
-
Copied: core/trunk/src/main/resources/jbosscache-config-3.0ALPHA1.xsd (from rev 6290, core/trunk/src/main/resources/jbosscache-config-3.0.xsd)
===================================================================
--- core/trunk/src/main/resources/jbosscache-config-3.0ALPHA1.xsd (rev 0)
+++ core/trunk/src/main/resources/jbosscache-config-3.0ALPHA1.xsd 2008-07-17 10:56:16 UTC (rev 6312)
@@ -0,0 +1,244 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema attributeFormDefault="unqualified" elementFormDefault="unqualified"
+ xmlns:xs="http://www.w3.org/2001/XMLSchema">
+ <xs:element name="jbosscache">
+ <xs:complexType>
+ <xs:all>
+ <xs:element name="locking" type="lockingType" minOccurs="0"/>
+ <xs:element name="transaction" type="transactionType" minOccurs="0"/>
+ <xs:element name="startup" type="startupType" minOccurs="0"/>
+ <xs:element name="stateRetrieval" type="stateRetrievalType" minOccurs="0"/>
+ <xs:element name="shutdown" type="shutdownType" minOccurs="0"/>
+ <xs:element name="serialization" type="serializationType" minOccurs="0"/>
+ <xs:element name="replication" type="replicationType" minOccurs="0"/>
+ <xs:element name="invalidation" type="invalidationType" minOccurs="0"/>
+ <xs:element name="jmxStatistics" type="jmxStatisticsType" minOccurs="0"/>
+ <xs:element name="transport" type="transportType" minOccurs="0"/>
+ <xs:element name="eviction" type="evictionType" minOccurs="0"/>
+ <xs:element name="loaders" type="loadersType" minOccurs="0"/>
+ <xs:element name="customInterceptors" type="customInterceptorsType" minOccurs="0"/>
+ </xs:all>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:complexType name="lockingType">
+ <xs:attribute name="isolationLevel">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:pattern value="SERIALIZABLE|REPEATABLE_READ|READ_COMMITTED|NONE|\$\{.*\}"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ <xs:attribute name="lockParentForChildInsertRemove" type="booleanType"/>
+ <xs:attribute name="lockAcquisitionTimeout" type="positiveInteger"/>
+ <xs:attribute name="nodeLockingScheme">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:pattern value="mvcc|optimistic|pessimistic|\$\{.*\}"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ <xs:attribute name="writeSkewCheck" type="booleanType"/>
+ <xs:attribute name="concurrencyLevel" type="xs:integer"/>
+ </xs:complexType>
+
+ <xs:complexType name="transactionType">
+ <xs:attribute name="transactionManagerLookupClass" type="xs:string"/>
+ <xs:attribute name="syncRollbackPhase" type="booleanType"/>
+ <xs:attribute name="syncCommitPhase" type="booleanType"/>
+ </xs:complexType>
+
+ <xs:complexType name="startupType">
+ <xs:attribute name="regionsInactiveOnStartup" type="booleanType"/>
+ </xs:complexType>
+
+ <xs:complexType name="stateRetrievalType">
+ <xs:attribute name="fetchInMemoryState" type="booleanType"/>
+ <xs:attribute name="timeout" type="positiveInteger"/>
+ </xs:complexType>
+
+ <xs:complexType name="shutdownType">
+ <xs:attribute name="hookBehavior">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:pattern value="DEFAULT|REGISTER|DONT_REGISTER|\$\{.*\}"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ </xs:complexType>
+
+ <xs:complexType name="serializationType">
+ <xs:attribute name="objectInputStreamPoolSize" type="positiveInteger"/>
+ <xs:attribute name="objectOutputStreamPoolSize" type="positiveInteger"/>
+ <xs:attribute name="version" type="xs:string"/>
+ <xs:attribute name="marshallerClass" type="xs:string"/>
+ <xs:attribute name="useLazyDeserialization" type="booleanType"/>
+ <xs:attribute name="useRegionBasedMarshalling" type="booleanType"/>
+ </xs:complexType>
+
+ <xs:simpleType name="booleanType">
+ <xs:restriction base="xs:string">
+ <xs:pattern value="\$\{.*\}|true|false"/>
+ </xs:restriction>
+ </xs:simpleType>
+
+ <xs:simpleType name="positiveInteger">
+ <xs:restriction base="xs:string">
+ <xs:pattern value="\$\{.*\}|\+?[0-9]*"/>
+ </xs:restriction>
+ </xs:simpleType>
+
+ <xs:complexType name="replicationType">
+ <xs:sequence>
+ <xs:choice>
+ <xs:element name="sync" type="syncType" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="async" type="asyncType" minOccurs="0" maxOccurs="1"/>
+ </xs:choice>
+ <xs:element name="buddy" minOccurs="0">
+ <xs:complexType>
+ <xs:all minOccurs="0">
+ <xs:element name="dataGravitation">
+ <xs:complexType>
+ <xs:attribute name="auto" type="booleanType"/>
+ <xs:attribute name="removeOnFind" type="booleanType"/>
+ <xs:attribute name="searchBackupTrees" type="booleanType"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="locator">
+ <xs:complexType>
+ <xs:all>
+ <xs:element name="properties" type="xs:string" maxOccurs="1"/>
+ </xs:all>
+ <xs:attribute name="class" type="xs:string"/>
+ </xs:complexType>
+ </xs:element>
+ </xs:all>
+ <xs:attribute name="enabled" type="booleanType"/>
+ <xs:attribute name="poolName" type="xs:string"/>
+ <xs:attribute name="communicationTimeout" type="xs:integer"/>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="invalidationType">
+ <xs:choice>
+ <xs:element name="sync" type="syncType"/>
+ <xs:element name="async" type="asyncType"/>
+ </xs:choice>
+ </xs:complexType>
+
+ <xs:complexType name="jmxStatisticsType">
+ <xs:attribute name="enabled" type="booleanType"/>
+ </xs:complexType>
+
+ <xs:complexType name="transportType">
+ <xs:sequence>
+ <xs:element name="jgroupsConfig" type="xs:anyType" minOccurs="0" maxOccurs="1"/>
+ </xs:sequence>
+ <xs:attribute name="clusterName" type="xs:string"/>
+ <xs:attribute name="multiplexerStack" type="xs:string"/>
+ </xs:complexType>
+
+ <xs:complexType name="syncType">
+ <xs:attribute name="replTimeout" type="positiveInteger"/>
+ </xs:complexType>
+
+
+ <xs:complexType name="asyncType">
+ <xs:attribute name="useReplQueue" type="booleanType"/>
+ <xs:attribute name="replQueueInterval" type="positiveInteger"/>
+ <xs:attribute name="replQueueMaxElements" type="positiveInteger"/>
+ </xs:complexType>
+
+ <xs:complexType name="evictionType">
+ <xs:sequence>
+ <xs:element name="default" type="evictionRegionType" minOccurs="0"/>
+ <xs:element name="region" minOccurs="0" maxOccurs="unbounded" type="evictionRegionType"/>
+ </xs:sequence>
+ <xs:attribute name="wakeUpInterval" type="positiveInteger" use="required"/>
+ <xs:attribute name="defaultPolicyClass" type="xs:string"/>
+ <xs:attribute name="defaultEventQueueSize" type="positiveInteger"/>
+ </xs:complexType>
+
+ <xs:complexType name="evictionRegionType">
+ <xs:sequence>
+ <xs:element name="attribute" maxOccurs="unbounded" type="attributeType"/>
+ </xs:sequence>
+ <xs:attribute name="name" type="xs:string"/>
+ <xs:attribute name="policyClass" type="xs:string"/>
+ <xs:attribute name="eventQueueSize" type="positiveInteger"/>
+ </xs:complexType>
+
+ <xs:complexType name="loadersType">
+ <xs:sequence>
+ <xs:element name="preload" maxOccurs="1">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="node" maxOccurs="unbounded">
+ <xs:complexType>
+ <xs:attribute name="fqn" type="xs:string"/>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="loader" maxOccurs="unbounded">
+ <xs:complexType>
+ <xs:all>
+ <xs:element name="properties"/>
+ <xs:element name="singletonStore" minOccurs="0">
+ <xs:complexType>
+ <xs:all>
+ <xs:element name="properties" type="xs:string"/>
+ </xs:all>
+ <xs:attribute name="enabled" type="booleanType"/>
+ <xs:attribute name="class" type="xs:string"/>
+ </xs:complexType>
+ </xs:element>
+ </xs:all>
+ <xs:attribute name="class" type="xs:string"/>
+ <xs:attribute name="async" type="booleanType"/>
+ <xs:attribute name="fetchPersistentState" type="booleanType"/>
+ <xs:attribute name="ignoreModifications" type="booleanType"/>
+ <xs:attribute name="purgeOnStartup" type="booleanType"/>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ <xs:attribute name="passivation" type="booleanType"/>
+ <xs:attribute name="shared" type="booleanType"/>
+ </xs:complexType>
+
+ <xs:complexType name="customInterceptorsType">
+ <xs:sequence>
+ <xs:element name="interceptor" maxOccurs="unbounded">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="attribute" maxOccurs="unbounded" type="attributeType" minOccurs="0"/>
+ </xs:sequence>
+ <xs:attribute name="class" type="xs:string"/>
+ <xs:attribute name="position">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="first"/>
+ <xs:enumeration value="last"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ <xs:attribute name="before" type="xs:string"/>
+ <xs:attribute name="after" type="xs:string"/>
+ <xs:attribute name="index" type="positiveInteger"/>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="attributeType">
+ <xs:simpleContent>
+ <xs:extension base="xs:string">
+ <xs:attribute name="name" type="xs:string"/>
+ </xs:extension>
+ </xs:simpleContent>
+ </xs:complexType>
+</xs:schema>
+
Modified: core/trunk/src/test/resources/configs/buddy-replication-cache.xml
===================================================================
--- core/trunk/src/test/resources/configs/buddy-replication-cache.xml 2008-07-17 10:47:11 UTC (rev 6311)
+++ core/trunk/src/test/resources/configs/buddy-replication-cache.xml 2008-07-17 10:56:16 UTC (rev 6312)
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:noNamespaceSchemaLocation="http://www.jboss.org/jbosscache/jbosscache-config-3.0.xsd">
+ xsi:noNamespaceSchemaLocation="http://www.jboss.org/jbosscache/jbosscache-config-3.0ALPHA1.xsd">
<locking isolationLevel="REPEATABLE_READ" lockAcquisitionTimeout="10000"/>
<transaction transactionManagerLookupClass="org.jboss.cache.transaction.GenericTransactionManagerLookup"/>
<stateRetrieval timeout="20000"/>
Modified: core/trunk/src/test/resources/configs/clonable-config.xml
===================================================================
--- core/trunk/src/test/resources/configs/clonable-config.xml 2008-07-17 10:47:11 UTC (rev 6311)
+++ core/trunk/src/test/resources/configs/clonable-config.xml 2008-07-17 10:56:16 UTC (rev 6312)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:noNamespaceSchemaLocation="http://www.jboss.org/jbosscache/jbosscache-config-3.0.xsd">
+ xsi:noNamespaceSchemaLocation="http://www.jboss.org/jbosscache/jbosscache-config-3.0ALPHA1.xsd">
<locking isolationLevel="SERIALIZABLE" lockAcquisitionTimeout="1" nodeLockingScheme="optimistic"/>
<transaction transactionManagerLookupClass="org.jboss.cache.transaction.GenericTransactionManagerLookup"/>
<stateRetrieval fetchInMemoryState="false" timeout="3"/>
Modified: core/trunk/src/test/resources/configs/local-lru-eviction.xml
===================================================================
--- core/trunk/src/test/resources/configs/local-lru-eviction.xml 2008-07-17 10:47:11 UTC (rev 6311)
+++ core/trunk/src/test/resources/configs/local-lru-eviction.xml 2008-07-17 10:56:16 UTC (rev 6312)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:noNamespaceSchemaLocation="http://www.jboss.org/jbosscache/jbosscache-config-3.0.xsd">
+ xsi:noNamespaceSchemaLocation="http://www.jboss.org/jbosscache/jbosscache-config-3.0ALPHA1.xsd">
<locking isolationLevel="REPEATABLE_READ" lockAcquisitionTimeout="15000"/>
<transaction transactionManagerLookupClass="org.jboss.cache.transaction.GenericTransactionManagerLookup"/>
Modified: core/trunk/src/test/resources/configs/local-passivation.xml
===================================================================
--- core/trunk/src/test/resources/configs/local-passivation.xml 2008-07-17 10:47:11 UTC (rev 6311)
+++ core/trunk/src/test/resources/configs/local-passivation.xml 2008-07-17 10:56:16 UTC (rev 6312)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:noNamespaceSchemaLocation="http://www.jboss.org/jbosscache/jbosscache-config-3.0.xsd">
+ xsi:noNamespaceSchemaLocation="http://www.jboss.org/jbosscache/jbosscache-config-3.0ALPHA1.xsd">
<locking isolationLevel="REPEATABLE_READ" lockAcquisitionTimeout="15000"/>
<transaction transactionManagerLookupClass="org.jboss.cache.transaction.GenericTransactionManagerLookup"/>
Modified: core/trunk/src/test/resources/configs/local-tx.xml
===================================================================
--- core/trunk/src/test/resources/configs/local-tx.xml 2008-07-17 10:47:11 UTC (rev 6311)
+++ core/trunk/src/test/resources/configs/local-tx.xml 2008-07-17 10:56:16 UTC (rev 6312)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:noNamespaceSchemaLocation="http://www.jboss.org/jbosscache/jbosscache-config-3.0.xsd">
+ xsi:noNamespaceSchemaLocation="http://www.jboss.org/jbosscache/jbosscache-config-3.0ALPHA1.xsd">
<locking isolationLevel="REPEATABLE_READ" lockAcquisitionTimeout="15000"/>
<transaction transactionManagerLookupClass="org.jboss.cache.transaction.GenericTransactionManagerLookup"/>
Modified: core/trunk/src/test/resources/configs/mixedPolicy-eviction.xml
===================================================================
--- core/trunk/src/test/resources/configs/mixedPolicy-eviction.xml 2008-07-17 10:47:11 UTC (rev 6311)
+++ core/trunk/src/test/resources/configs/mixedPolicy-eviction.xml 2008-07-17 10:56:16 UTC (rev 6312)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:noNamespaceSchemaLocation="http://www.jboss.org/jbosscache/jbosscache-config-3.0.xsd">
+ xsi:noNamespaceSchemaLocation="http://www.jboss.org/jbosscache/jbosscache-config-3.0ALPHA1.xsd">
<locking isolationLevel="REPEATABLE_READ" lockAcquisitionTimeout="15000"/>
<transaction transactionManagerLookupClass="org.jboss.cache.transaction.GenericTransactionManagerLookup"/>
Modified: core/trunk/src/test/resources/configs/mux.xml
===================================================================
--- core/trunk/src/test/resources/configs/mux.xml 2008-07-17 10:47:11 UTC (rev 6311)
+++ core/trunk/src/test/resources/configs/mux.xml 2008-07-17 10:56:16 UTC (rev 6312)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:noNamespaceSchemaLocation="http://www.jboss.org/jbosscache/jbosscache-config-3.0.xsd">
+ xsi:noNamespaceSchemaLocation="http://www.jboss.org/jbosscache/jbosscache-config-3.0ALPHA1.xsd">
<locking isolationLevel="REPEATABLE_READ" lockAcquisitionTimeout="10000"/>
<transaction transactionManagerLookupClass="org.jboss.cache.transaction.GenericTransactionManagerLookup"/>
Modified: core/trunk/src/test/resources/configs/parser-test.xml
===================================================================
--- core/trunk/src/test/resources/configs/parser-test.xml 2008-07-17 10:47:11 UTC (rev 6311)
+++ core/trunk/src/test/resources/configs/parser-test.xml 2008-07-17 10:56:16 UTC (rev 6312)
@@ -3,7 +3,7 @@
<!-- file used for functional test of the xml parser -->
<jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:noNamespaceSchemaLocation="http://www.jboss.org/jbosscache/jbosscache-config-3.0.xsd">
+ xsi:noNamespaceSchemaLocation="http://www.jboss.org/jbosscache/jbosscache-config-3.0ALPHA1.xsd">
<locking isolationLevel="REPEATABLE_READ" lockParentForChildInsertRemove="true" lockAcquisitionTimeout="10234"
Modified: core/trunk/src/test/resources/configs/policyPerRegion-eviction.xml
===================================================================
--- core/trunk/src/test/resources/configs/policyPerRegion-eviction.xml 2008-07-17 10:47:11 UTC (rev 6311)
+++ core/trunk/src/test/resources/configs/policyPerRegion-eviction.xml 2008-07-17 10:56:16 UTC (rev 6312)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:noNamespaceSchemaLocation="http://www.jboss.org/jbosscache/jbosscache-config-3.0.xsd">
+ xsi:noNamespaceSchemaLocation="http://www.jboss.org/jbosscache/jbosscache-config-3.0ALPHA1.xsd">
<locking isolationLevel="REPEATABLE_READ" lockAcquisitionTimeout="15000"/>
<transaction transactionManagerLookupClass="org.jboss.cache.transaction.GenericTransactionManagerLookup"/>
<stateRetrieval timeout="20000"/>
Modified: core/trunk/src/test/resources/configs/replSync.xml
===================================================================
--- core/trunk/src/test/resources/configs/replSync.xml 2008-07-17 10:47:11 UTC (rev 6311)
+++ core/trunk/src/test/resources/configs/replSync.xml 2008-07-17 10:56:16 UTC (rev 6312)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:noNamespaceSchemaLocation="http://www.jboss.org/jbosscache/jbosscache-config-3.0.xsd">
+ xsi:noNamespaceSchemaLocation="http://www.jboss.org/jbosscache/jbosscache-config-3.0ALPHA1.xsd">
<locking isolationLevel="REPEATABLE_READ" lockAcquisitionTimeout="10000"/>
<transaction transactionManagerLookupClass="org.jboss.cache.transaction.GenericTransactionManagerLookup"/>
<serialization useRegionBasedMarshalling="true"/>
Modified: core/trunk/src/test/resources/configs/string-property-replaced.xml
===================================================================
--- core/trunk/src/test/resources/configs/string-property-replaced.xml 2008-07-17 10:47:11 UTC (rev 6311)
+++ core/trunk/src/test/resources/configs/string-property-replaced.xml 2008-07-17 10:56:16 UTC (rev 6312)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:noNamespaceSchemaLocation="http://www.jboss.org/jbosscache/jbosscache-config-3.0.xsd">
+ xsi:noNamespaceSchemaLocation="http://www.jboss.org/jbosscache/jbosscache-config-3.0ALPHA1.xsd">
<locking lockAcquisitionTimeout="${test.property.LockAcquisitionTimeout:15000}"
nodeLockingScheme="${test.property.NodeLockingScheme:OPTIMISTIC}"/>
<transaction syncCommitPhase="${test.property.SyncCommitPhase:true}" syncRollbackPhase="true"/>
17 years, 5 months
JBoss Cache SVN: r6311 - core/trunk/src/main/java/org/jboss/cache.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-07-17 06:47:11 -0400 (Thu, 17 Jul 2008)
New Revision: 6311
Modified:
core/trunk/src/main/java/org/jboss/cache/Fqn.java
Log:
Added a new factory method for Fqn
Modified: core/trunk/src/main/java/org/jboss/cache/Fqn.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/Fqn.java 2008-07-16 17:30:08 UTC (rev 6310)
+++ core/trunk/src/main/java/org/jboss/cache/Fqn.java 2008-07-17 10:47:11 UTC (rev 6311)
@@ -152,6 +152,22 @@
}
/**
+ * Retrieves an Fqn that represents the list of elements passed in.
+ *
+ * @param names list of elements that comprise the Fqn
+ * @param safe if true, the list passed in is not defensively copied but used directly. <b>Use with care.</b> Make sure
+ * you know what you are doing before you pass in a <tt>true</tt> value to <tt>safe</tt>, as it can have adverse effects on
+ * performance or correctness. The defensive copy of list elements is not just for safety but also for performance as
+ * an appropriare List implementation is used, which works well with Fqn operations.
+ * @return an Fqn
+ * @since 3.0.0
+ */
+ public static Fqn fromList(List<Object> names, boolean safe)
+ {
+ return new Fqn(names, safe);
+ }
+
+ /**
* Retrieves an Fqn that represents the array of elements passed in.
*
* @param elements array of elements that comprise the Fqn
17 years, 5 months
JBoss Cache SVN: r6310 - core/trunk/src/main/java/org/jboss/cache.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-07-16 13:30:08 -0400 (Wed, 16 Jul 2008)
New Revision: 6310
Modified:
core/trunk/src/main/java/org/jboss/cache/Fqn.java
Log:
Improved hashcode
Modified: core/trunk/src/main/java/org/jboss/cache/Fqn.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/Fqn.java 2008-07-16 17:15:15 UTC (rev 6309)
+++ core/trunk/src/main/java/org/jboss/cache/Fqn.java 2008-07-16 17:30:08 UTC (rev 6310)
@@ -450,6 +450,7 @@
{
int hashCode = 19;
for (Object o : elements) hashCode = 31 * hashCode + (o == null ? 0 : o.hashCode());
+ if (hashCode == 0) hashCode = 0xDEADBEEF; // degenerate case
return hashCode;
}
17 years, 5 months
JBoss Cache SVN: r6309 - in core/trunk/src/main/java/org/jboss/cache: lock and 1 other directory.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-07-16 13:15:15 -0400 (Wed, 16 Jul 2008)
New Revision: 6309
Modified:
core/trunk/src/main/java/org/jboss/cache/Fqn.java
core/trunk/src/main/java/org/jboss/cache/lock/MVCCLockManager.java
Log:
Improved hashcode
Modified: core/trunk/src/main/java/org/jboss/cache/Fqn.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/Fqn.java 2008-07-16 16:16:37 UTC (rev 6308)
+++ core/trunk/src/main/java/org/jboss/cache/Fqn.java 2008-07-16 17:15:15 UTC (rev 6309)
@@ -444,18 +444,12 @@
/**
* Calculates a hash code by summing the hash code of all elements.
*
- * @return a cached hashcode
+ * @return a calculated hashcode
*/
protected int calculateHashCode()
{
- int hashCode = 0;
- int count = 1;
- for (Object element : elements) hashCode += (element == null) ? 0 : element.hashCode() * count++;
-
- if (hashCode == 0)// fix degenerate case
- {
- hashCode = 0xFEED;
- }
+ int hashCode = 19;
+ for (Object o : elements) hashCode = 31 * hashCode + (o == null ? 0 : o.hashCode());
return hashCode;
}
Modified: core/trunk/src/main/java/org/jboss/cache/lock/MVCCLockManager.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/lock/MVCCLockManager.java 2008-07-16 16:16:37 UTC (rev 6308)
+++ core/trunk/src/main/java/org/jboss/cache/lock/MVCCLockManager.java 2008-07-16 17:15:15 UTC (rev 6309)
@@ -320,8 +320,7 @@
*/
final int hash(Fqn fqn)
{
- // TODO: 3.0.0: Find an efficient algorithm to ensure a proper spread of locks across Fqns.
- int h = fqn.toString().hashCode();
+ int h = fqn.hashCode();
h += ~(h << 9);
h ^= (h >>> 14);
h += (h << 4);
17 years, 5 months
JBoss Cache SVN: r6308 - in core/tags/3.0.0.ALPHA1: src/main/java/org/jboss/cache and 1 other directory.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-07-16 12:16:37 -0400 (Wed, 16 Jul 2008)
New Revision: 6308
Modified:
core/tags/3.0.0.ALPHA1/pom.xml
core/tags/3.0.0.ALPHA1/src/main/java/org/jboss/cache/Version.java
Log:
Tagged for release
Modified: core/tags/3.0.0.ALPHA1/pom.xml
===================================================================
--- core/tags/3.0.0.ALPHA1/pom.xml 2008-07-16 16:13:55 UTC (rev 6307)
+++ core/tags/3.0.0.ALPHA1/pom.xml 2008-07-16 16:16:37 UTC (rev 6308)
@@ -4,7 +4,7 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<properties>
- <jbosscache-core-version>3.0.0-SNAPSHOT</jbosscache-core-version>
+ <jbosscache-core-version>3.0.0.ALPHA1</jbosscache-core-version>
<!-- By default only run tests in the "unit" group -->
<defaultTestGroup>unit</defaultTestGroup>
<!-- By default only generate Javadocs when we install the module. -->
@@ -398,7 +398,7 @@
<activeByDefault>false</activeByDefault>
</activation>
<properties>
- <jbosscache-core-version>3.0.0-SNAPSHOT-JBossAS</jbosscache-core-version>
+ <jbosscache-core-version>3.0.0.ALPHA1-JBossAS</jbosscache-core-version>
</properties>
<dependencies>
<dependency>
Modified: core/tags/3.0.0.ALPHA1/src/main/java/org/jboss/cache/Version.java
===================================================================
--- core/tags/3.0.0.ALPHA1/src/main/java/org/jboss/cache/Version.java 2008-07-16 16:13:55 UTC (rev 6307)
+++ core/tags/3.0.0.ALPHA1/src/main/java/org/jboss/cache/Version.java 2008-07-16 16:16:37 UTC (rev 6308)
@@ -11,10 +11,10 @@
@Immutable
public class Version
{
- public static final String version = "3.0.0-SNAPSHOT";
+ public static final String version = "3.0.0.ALPHA1";
public static final String codename = "Naga";
//public static final String cvs = "$Id: Version.java 4592 2007-10-10 16:44:36Z manik.surtani(a)jboss.com $";
- static final byte[] version_id = {'0', '3', '0', '0', 'S'};
+ static final byte[] version_id = {'0', '3', '0', '0', 'A', '1'};
private static final int MAJOR_SHIFT = 11;
private static final int MINOR_SHIFT = 6;
17 years, 5 months
JBoss Cache SVN: r6307 - core/tags.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-07-16 12:13:55 -0400 (Wed, 16 Jul 2008)
New Revision: 6307
Added:
core/tags/3.0.0.ALPHA1/
Log:
Naga alpha1
Copied: core/tags/3.0.0.ALPHA1 (from rev 6306, core/trunk)
17 years, 5 months
JBoss Cache SVN: r6306 - in benchmarks/benchmark-fwk/trunk: cache-products/ehcache-1.4.1/src/org/cachebench/cachewrappers and 13 other directories.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-07-16 12:03:20 -0400 (Wed, 16 Jul 2008)
New Revision: 6306
Added:
benchmarks/benchmark-fwk/trunk/src/org/cachebench/tests/AbstractCacheTest.java
Removed:
benchmarks/benchmark-fwk/trunk/src/org/cachebench/SerializableCacheWrapper.java
benchmarks/benchmark-fwk/trunk/src/org/cachebench/testobjects/SerializableAbstractSuperclass.java
benchmarks/benchmark-fwk/trunk/src/org/cachebench/testobjects/SerializableCustomType.java
benchmarks/benchmark-fwk/trunk/src/org/cachebench/testobjects/SerializableCustomTypeSubclassOfAbstract.java
benchmarks/benchmark-fwk/trunk/src/org/cachebench/testobjects/SerializableCustomTypeWithAssocs.java
benchmarks/benchmark-fwk/trunk/src/org/cachebench/testobjects/SerializableCustomTypeWithStatics.java
benchmarks/benchmark-fwk/trunk/src/org/cachebench/testobjects/SerializableCustomTypeWithTransient.java
Modified:
benchmarks/benchmark-fwk/trunk/cache-products/coherence-3.2.2/src/org/cachebench/cachewrappers/CoherenceWrapper.java
benchmarks/benchmark-fwk/trunk/cache-products/ehcache-1.4.1/src/org/cachebench/cachewrappers/EHCacheWrapper.java
benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-1.4.1/src/org/cachebench/cachewrappers/JBossCacheWrapper.java
benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-2.0.0/src/org/cachebench/cachewrappers/JBossCache200Wrapper.java
benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-2.1.0/src/org/cachebench/cachewrappers/JBossCache210Wrapper.java
benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-2.2.0/src/org/cachebench/cachewrappers/JBossCache220Wrapper.java
benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-3.0.0/src/org/cachebench/cachewrappers/JBossCache300Wrapper.java
benchmarks/benchmark-fwk/trunk/cache-products/terracotta-2.5.0/src/org/cachebench/cachewrappers/TerracottaWrapper.java
benchmarks/benchmark-fwk/trunk/cache-products/whirlycache-1.0.1/src/org/cachebench/cachewrappers/WhirlyCacheTest.java
benchmarks/benchmark-fwk/trunk/cache-products/whirlycache-1.0.1/src/org/cachebench/cachewrappers/WhirlyCacheWrapper.java
benchmarks/benchmark-fwk/trunk/src/org/cachebench/CacheWrapper.java
benchmarks/benchmark-fwk/trunk/src/org/cachebench/config/Configuration.java
benchmarks/benchmark-fwk/trunk/src/org/cachebench/tests/ReplicationOccursTest.java
benchmarks/benchmark-fwk/trunk/src/org/cachebench/tests/SessionSimulatorTest.java
benchmarks/benchmark-fwk/trunk/src/org/cachebench/tests/simpletests/AssociationsTest.java
benchmarks/benchmark-fwk/trunk/src/org/cachebench/tests/simpletests/CustomClassTest.java
benchmarks/benchmark-fwk/trunk/src/org/cachebench/tests/simpletests/SimpleTest.java
benchmarks/benchmark-fwk/trunk/src/org/cachebench/tests/simpletests/StaticsTest.java
benchmarks/benchmark-fwk/trunk/src/org/cachebench/tests/simpletests/SubclassTest.java
benchmarks/benchmark-fwk/trunk/src/org/cachebench/tests/simpletests/TransientTest.java
benchmarks/benchmark-fwk/trunk/src/org/cachebench/warmup/PutGetCacheWarmup.java
Log:
* Updated tests to use a more "fair" path generation outside of what is being measured. Cache impls may decide whether they want to use the path info or not.
* Removed SerializableCacheWrapper and related unused junk
Modified: benchmarks/benchmark-fwk/trunk/cache-products/coherence-3.2.2/src/org/cachebench/cachewrappers/CoherenceWrapper.java
===================================================================
--- benchmarks/benchmark-fwk/trunk/cache-products/coherence-3.2.2/src/org/cachebench/cachewrappers/CoherenceWrapper.java 2008-07-16 15:05:37 UTC (rev 6305)
+++ benchmarks/benchmark-fwk/trunk/cache-products/coherence-3.2.2/src/org/cachebench/cachewrappers/CoherenceWrapper.java 2008-07-16 16:03:20 UTC (rev 6306)
@@ -1,14 +1,12 @@
package org.cachebench.cachewrappers;
+import com.tangosol.net.CacheFactory;
+import com.tangosol.net.NamedCache;
import org.cachebench.CacheWrapper;
import java.util.Map;
-import com.tangosol.net.NamedCache;
-import com.tangosol.net.CacheFactory;
-
/**
- *
* Pass in a -Dtangosol.coherence.localhost=IP_ADDRESS
*
* @author <a href="mailto:manik@jboss.org">Manik Surtani</a>
@@ -33,12 +31,12 @@
cache.release();
}
- public void put(Object key, Object value) throws Exception
+ public void put(List<String> path, Object key, Object value) throws Exception
{
cache.put(key, value);
}
- public Object get(Object key) throws Exception
+ public Object get(List<String> path, Object key) throws Exception
{
return cache.get(key);
}
@@ -58,8 +56,8 @@
return cache.keySet().toString();
}
- public Object getReplicatedData(String key) throws Exception
+ public Object getReplicatedData(List<String> path, String key) throws Exception
{
- return get(key);
+ return get(path, key);
}
}
Modified: benchmarks/benchmark-fwk/trunk/cache-products/ehcache-1.4.1/src/org/cachebench/cachewrappers/EHCacheWrapper.java
===================================================================
--- benchmarks/benchmark-fwk/trunk/cache-products/ehcache-1.4.1/src/org/cachebench/cachewrappers/EHCacheWrapper.java 2008-07-16 15:05:37 UTC (rev 6305)
+++ benchmarks/benchmark-fwk/trunk/cache-products/ehcache-1.4.1/src/org/cachebench/cachewrappers/EHCacheWrapper.java 2008-07-16 16:03:20 UTC (rev 6306)
@@ -11,6 +11,7 @@
import java.io.Serializable;
import java.net.URL;
+import java.util.List;
import java.util.Map;
import java.util.StringTokenizer;
@@ -134,7 +135,7 @@
/* (non-Javadoc)
* @see org.cachebench.CacheWrapper#put(java.lang.Object, java.lang.Object)
*/
- public void put(Object key, Object value) throws Exception
+ public void put(List<String> path, Object key, Object value) throws Exception
{
putSerializable((Serializable) key, (Serializable) value);
}
@@ -142,7 +143,7 @@
/* (non-Javadoc)
* @see org.cachebench.CacheWrapper#get(java.lang.Object)
*/
- public Object get(Object key) throws Exception
+ public Object get(List<String> path, Object key) throws Exception
{
Object s = getSerializable((Serializable) key);
if (s instanceof Element)
@@ -162,8 +163,8 @@
return cache.getKeys().toString() + " remote peers: " + manager.getCachePeerListener().getBoundCachePeers();
}
- public Object getReplicatedData(String key) throws Exception
+ public Object getReplicatedData(List<String> path, String key) throws Exception
{
- return get(key);
+ return get(path, key);
}
}
Modified: benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-1.4.1/src/org/cachebench/cachewrappers/JBossCacheWrapper.java
===================================================================
--- benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-1.4.1/src/org/cachebench/cachewrappers/JBossCacheWrapper.java 2008-07-16 15:05:37 UTC (rev 6305)
+++ benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-1.4.1/src/org/cachebench/cachewrappers/JBossCacheWrapper.java 2008-07-16 16:03:20 UTC (rev 6306)
@@ -6,8 +6,7 @@
import org.jboss.cache.PropertyConfigurator;
import org.jboss.cache.TreeCache;
-import java.util.Map;
-import java.util.HashMap;
+import java.util.*;
/**
@@ -42,14 +41,14 @@
tree.destroyService();
}
- public void put(Object key, Object value) throws Exception
+ public void put(List<String> l, Object key, Object value) throws Exception
{
HashMap map = new HashMap(1);
map.put( key, value );
tree.put(key.toString(), map);
}
- public Object get(Object key) throws Exception
+ public Object get(List<String> l, Object key) throws Exception
{
return tree.get( key.toString() );
@@ -70,7 +69,7 @@
return tree.printDetails();
}
- public Object getReplicatedData(String key)
+ public Object getReplicatedData(List<String> l, String key)
{
return null;
}
Modified: benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-2.0.0/src/org/cachebench/cachewrappers/JBossCache200Wrapper.java
===================================================================
--- benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-2.0.0/src/org/cachebench/cachewrappers/JBossCache200Wrapper.java 2008-07-16 15:05:37 UTC (rev 6305)
+++ benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-2.0.0/src/org/cachebench/cachewrappers/JBossCache200Wrapper.java 2008-07-16 16:03:20 UTC (rev 6306)
@@ -11,6 +11,7 @@
import org.jboss.cache.marshall.NodeData;
import java.net.URL;
+import java.util.List;
import java.util.Map;
public class JBossCache200Wrapper implements CacheWrapper
@@ -40,17 +41,14 @@
cache.stop();
}
- public void put(Object key, Object value) throws Exception
+ public void put(List<String> path, Object key, Object value) throws Exception
{
- // make sure the threads don't conflict!
- Fqn f = new Fqn("test", key);
- cache.put(f, key, value);
+ cache.put(new Fqn(path, true), key, value);
}
- public Object get(Object key) throws Exception
+ public Object get(List<String> path, Object key) throws Exception
{
- Fqn f = new Fqn("test", key);
- return cache.get(f, key);
+ return cache.get(new Fqn(path, true), key);
}
public void empty() throws Exception
@@ -69,14 +67,14 @@
return "Num direct children: " + cache.getRoot().getChildren().size();
}
- public Object getReplicatedData(String key) throws Exception
+ public Object getReplicatedData(List<String> path, String key) throws Exception
{
CacheSPI cacheSpi = (CacheSPI) cache;
- GravitateResult result = cacheSpi.gravitateData(new Fqn("test", key), true);
+ GravitateResult result = cacheSpi.gravitateData(new Fqn(path, true), true);
if (!result.isDataFound())
{
//totall replication?
- return get(key);
+ return get(path, key);
}
NodeData nodeData = result.getNodeData().get(0);
return nodeData.getAttributes().get(key);
Modified: benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-2.1.0/src/org/cachebench/cachewrappers/JBossCache210Wrapper.java
===================================================================
--- benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-2.1.0/src/org/cachebench/cachewrappers/JBossCache210Wrapper.java 2008-07-16 15:05:37 UTC (rev 6305)
+++ benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-2.1.0/src/org/cachebench/cachewrappers/JBossCache210Wrapper.java 2008-07-16 16:03:20 UTC (rev 6306)
@@ -10,6 +10,7 @@
import org.jboss.cache.buddyreplication.GravitateResult;
import org.jboss.cache.marshall.NodeData;
+import java.util.List;
import java.util.Map;
/**
@@ -41,17 +42,15 @@
cache.stop();
}
- public void put(Object key, Object value) throws Exception
+ public void put(List<String> path, Object key, Object value) throws Exception
{
- // make sure the threads don't conflict!
- Fqn f = new Fqn("test", key);
- cache.put(f, key, value);
+
+ cache.put(new Fqn(path, true), key, value);
}
- public Object get(Object key) throws Exception
+ public Object get(List<String> path, Object key) throws Exception
{
- Fqn f = new Fqn("test", key);
- return cache.get(f, key);
+ return cache.get(new Fqn(path, true), key);
}
public void empty() throws Exception
@@ -70,14 +69,14 @@
return "Num direct children: " + cache.getRoot().getChildren().size();
}
- public Object getReplicatedData(String key) throws Exception
+ public Object getReplicatedData(List<String> path, String key) throws Exception
{
CacheSPI cacheSpi = (CacheSPI) cache;
- GravitateResult result = cacheSpi.gravitateData(new Fqn("test", key), true);
+ GravitateResult result = cacheSpi.gravitateData(new Fqn(path, true), true);
if (!result.isDataFound())
{
//totall replication?
- return get(key);
+ return get(path, key);
}
NodeData nodeData = result.getNodeData().get(0);
return nodeData.getAttributes().get(key);
Modified: benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-2.2.0/src/org/cachebench/cachewrappers/JBossCache220Wrapper.java
===================================================================
--- benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-2.2.0/src/org/cachebench/cachewrappers/JBossCache220Wrapper.java 2008-07-16 15:05:37 UTC (rev 6305)
+++ benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-2.2.0/src/org/cachebench/cachewrappers/JBossCache220Wrapper.java 2008-07-16 16:03:20 UTC (rev 6306)
@@ -11,6 +11,7 @@
import org.jboss.cache.buddyreplication.GravitateResult;
import org.jboss.cache.marshall.NodeData;
+import java.util.List;
import java.util.Map;
/**
@@ -42,17 +43,14 @@
cache.stop();
}
- public void put(Object key, Object value) throws Exception
+ public void put(List<String> path, Object key, Object value) throws Exception
{
- // make sure the threads don't conflict!
- Fqn f = new Fqn("test", key);
- cache.put(f, key, value);
+ cache.put(Fqn.fromList(path), key, value);
}
- public Object get(Object key) throws Exception
+ public Object get(List<String> path, Object key) throws Exception
{
- Fqn f = new Fqn("test", key);
- return cache.get(f, key);
+ return cache.get(Fqn.fromList(path), key);
}
public void empty() throws Exception
@@ -71,14 +69,14 @@
return "Num direct children: " + cache.getRoot().getChildren().size();
}
- public Object getReplicatedData(String key) throws Exception
+ public Object getReplicatedData(List<String> path, String key) throws Exception
{
CacheSPI cacheSpi = (CacheSPI) cache;
- GravitateResult result = cacheSpi.gravitateData(new Fqn("test", key), true, new InvocationContext());
+ GravitateResult result = cacheSpi.gravitateData(Fqn.fromList(path), true, new InvocationContext());
if (!result.isDataFound())
{
//totall replication?
- return get(key);
+ return get(path, key);
}
NodeData nodeData = result.getNodeData().get(0);
return nodeData.getAttributes().get(key);
Modified: benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-3.0.0/src/org/cachebench/cachewrappers/JBossCache300Wrapper.java
===================================================================
--- benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-3.0.0/src/org/cachebench/cachewrappers/JBossCache300Wrapper.java 2008-07-16 15:05:37 UTC (rev 6305)
+++ benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-3.0.0/src/org/cachebench/cachewrappers/JBossCache300Wrapper.java 2008-07-16 16:03:20 UTC (rev 6306)
@@ -8,6 +8,7 @@
import org.jboss.cache.Fqn;
import org.jboss.cache.config.Option;
+import java.util.List;
import java.util.Map;
/**
@@ -36,17 +37,14 @@
cache.stop();
}
- public void put(Object key, Object value) throws Exception
+ public void put(List<String> path, Object key, Object value) throws Exception
{
- // make sure the threads don't conflict!
- Fqn f = Fqn.fromElements("test", key);
- cache.put(f, key, value);
+ cache.put(Fqn.fromList(path), key, value);
}
- public Object get(Object key) throws Exception
+ public Object get(List<String> path, Object key) throws Exception
{
- Fqn f = Fqn.fromElements("test", key);
- return cache.get(f, key);
+ return cache.get(Fqn.fromList(path), key);
}
public void empty() throws Exception
@@ -65,11 +63,10 @@
return "Num direct children: " + cache.getRoot().getChildren().size();
}
- public Object getReplicatedData(String key) throws Exception
+ public Object getReplicatedData(List<String> path, String key) throws Exception
{
Option option = cache.getInvocationContext().getOptionOverrides();
option.setForceDataGravitation(true);
- Fqn<String> fqn = Fqn.fromElements("test", key);
- return cache.get(fqn, key);
+ return cache.get(Fqn.fromList(path), key);
}
}
Modified: benchmarks/benchmark-fwk/trunk/cache-products/terracotta-2.5.0/src/org/cachebench/cachewrappers/TerracottaWrapper.java
===================================================================
--- benchmarks/benchmark-fwk/trunk/cache-products/terracotta-2.5.0/src/org/cachebench/cachewrappers/TerracottaWrapper.java 2008-07-16 15:05:37 UTC (rev 6305)
+++ benchmarks/benchmark-fwk/trunk/cache-products/terracotta-2.5.0/src/org/cachebench/cachewrappers/TerracottaWrapper.java 2008-07-16 16:03:20 UTC (rev 6306)
@@ -2,12 +2,13 @@
import org.cachebench.CacheWrapper;
+import java.util.HashMap;
+import java.util.List;
import java.util.Map;
-import java.util.HashMap;
/**
* Cache wrapper for Terracotta 2.3.0
- *
+ * <p/>
* Using the terracotta-cache package on http://www.terracotta.org/confluence/display/labs/Terracotta+Cache
*
* @author <a href="manik(a)jboss.org">Manik Surtani</a>
@@ -21,9 +22,9 @@
{
}
- public Object getReplicatedData(String key) throws Exception
+ public Object getReplicatedData(List<String> path, String key) throws Exception
{
- return get(key);
+ return get(path, key);
}
public void setUp() throws Exception
@@ -32,23 +33,23 @@
public void tearDown() throws Exception
{
- synchronized(cache)
+ synchronized (cache)
{
cache.clear();
}
}
- public void put(Object key, Object value) throws Exception
+ public void put(List<String> path, Object key, Object value) throws Exception
{
- synchronized(cache)
+ synchronized (cache)
{
cache.put(key, value);
}
}
- public Object get(Object key) throws Exception
+ public Object get(List<String> path, Object key) throws Exception
{
- synchronized(cache)
+ synchronized (cache)
{
return cache.get(key);
}
@@ -56,7 +57,7 @@
public void empty() throws Exception
{
- synchronized(cache)
+ synchronized (cache)
{
cache.clear();
}
@@ -69,7 +70,7 @@
public String getInfo()
{
- synchronized(cache)
+ synchronized (cache)
{
return "There are " + cache.size() + " objects in cache";
}
Modified: benchmarks/benchmark-fwk/trunk/cache-products/whirlycache-1.0.1/src/org/cachebench/cachewrappers/WhirlyCacheTest.java
===================================================================
--- benchmarks/benchmark-fwk/trunk/cache-products/whirlycache-1.0.1/src/org/cachebench/cachewrappers/WhirlyCacheTest.java 2008-07-16 15:05:37 UTC (rev 6305)
+++ benchmarks/benchmark-fwk/trunk/cache-products/whirlycache-1.0.1/src/org/cachebench/cachewrappers/WhirlyCacheTest.java 2008-07-16 16:03:20 UTC (rev 6306)
@@ -14,13 +14,13 @@
w.setUp();
String k = "k", v = "v";
- w.put(k, v);
+ w.put(null, k, v);
- System.out.println("Value is " + w.get(k));
+ System.out.println("Value is " + w.get(null, k));
w.empty();
- System.out.println("Value is " + w.get(k));
+ System.out.println("Value is " + w.get(null, k));
}
}
\ No newline at end of file
Modified: benchmarks/benchmark-fwk/trunk/cache-products/whirlycache-1.0.1/src/org/cachebench/cachewrappers/WhirlyCacheWrapper.java
===================================================================
--- benchmarks/benchmark-fwk/trunk/cache-products/whirlycache-1.0.1/src/org/cachebench/cachewrappers/WhirlyCacheWrapper.java 2008-07-16 15:05:37 UTC (rev 6305)
+++ benchmarks/benchmark-fwk/trunk/cache-products/whirlycache-1.0.1/src/org/cachebench/cachewrappers/WhirlyCacheWrapper.java 2008-07-16 16:03:20 UTC (rev 6306)
@@ -6,6 +6,7 @@
import org.apache.commons.logging.LogFactory;
import org.cachebench.CacheWrapper;
+import java.util.List;
import java.util.Map;
@@ -47,7 +48,7 @@
/* (non-Javadoc)
* @see org.cachebench.CacheWrapper#put(java.lang.Object, java.lang.Object)
*/
- public void put(Object key, Object value) throws Exception
+ public void put(List<String> path, Object key, Object value) throws Exception
{
cache.store(key, value);
}
@@ -55,7 +56,7 @@
/* (non-Javadoc)
* @see org.cachebench.CacheWrapper#get(java.lang.Object)
*/
- public Object get(Object key) throws Exception
+ public Object get(List<String> path, Object key) throws Exception
{
return cache.retrieve(key);
}
@@ -70,8 +71,8 @@
return cache.toString();
}
- public Object getReplicatedData(String key) throws Exception
+ public Object getReplicatedData(List<String> path, String key) throws Exception
{
- return get(key);
+ return get(path, key);
}
}
\ No newline at end of file
Modified: benchmarks/benchmark-fwk/trunk/src/org/cachebench/CacheWrapper.java
===================================================================
--- benchmarks/benchmark-fwk/trunk/src/org/cachebench/CacheWrapper.java 2008-07-16 15:05:37 UTC (rev 6305)
+++ benchmarks/benchmark-fwk/trunk/src/org/cachebench/CacheWrapper.java 2008-07-16 16:03:20 UTC (rev 6306)
@@ -1,6 +1,6 @@
package org.cachebench;
-import java.util.Properties;
+import java.util.List;
import java.util.Map;
@@ -41,20 +41,21 @@
* as a black box, and is what is timed, so it should be implemented in the most efficient (or most
* realistic) way possible.
*
+ * @param path
* @param key
* @param value
*/
- void put(Object key, Object value) throws Exception;
+ void put(List<String> path, Object key, Object value) throws Exception;
/**
* Similar to put, get wraps up an operation related to retrieving an object from the cache. As in the
* case of put, this too is treated as a black box and is timed, and should be implemented in the most
* efficient/realistic way possible.
*
- * @param key
- * @return The value pertaining to the key in cache
+ * @param path
+ * @param key @return The value pertaining to the key in cache
*/
- Object get(Object key) throws Exception;
+ Object get(List<String> path, Object key) throws Exception;
/**
* This is called after each test type (if emptyCacheBetweenTests is set to true in cachebench.xml) and is
@@ -77,5 +78,5 @@
* structure, but use some additional structure to do this (replication tree, in the case of buddy replication).
* This method is a hook for handling this situations.
*/
- public Object getReplicatedData(String key) throws Exception;
+ public Object getReplicatedData(List<String> path, String key) throws Exception;
}
Deleted: benchmarks/benchmark-fwk/trunk/src/org/cachebench/SerializableCacheWrapper.java
===================================================================
--- benchmarks/benchmark-fwk/trunk/src/org/cachebench/SerializableCacheWrapper.java 2008-07-16 15:05:37 UTC (rev 6305)
+++ benchmarks/benchmark-fwk/trunk/src/org/cachebench/SerializableCacheWrapper.java 2008-07-16 16:03:20 UTC (rev 6306)
@@ -1,27 +0,0 @@
-package org.cachebench;
-
-import java.io.Serializable;
-
-
-/**
- * @author Manik Surtani (manik(a)surtani.org)
- * @version $Id: SerializableCacheWrapper.java,v 1.4 2007/04/18 19:09:29 msurtani Exp $
- */
-public interface SerializableCacheWrapper extends CacheWrapper
-{
- /**
- * Similar to get, only uses serializable objects
- *
- * @param key The key of the value in cache.
- * @return The value in cache.
- */
- Object getSerializable(Serializable key) throws Exception;
-
- /**
- * Similar to put, only uses serializable objects
- *
- * @param key The serializable key in which the value will be saved.
- * @param value The serializable value be saved.
- */
- void putSerializable(Serializable key, Serializable value) throws Exception;
-}
Modified: benchmarks/benchmark-fwk/trunk/src/org/cachebench/config/Configuration.java
===================================================================
--- benchmarks/benchmark-fwk/trunk/src/org/cachebench/config/Configuration.java 2008-07-16 15:05:37 UTC (rev 6305)
+++ benchmarks/benchmark-fwk/trunk/src/org/cachebench/config/Configuration.java 2008-07-16 16:03:20 UTC (rev 6306)
@@ -10,6 +10,7 @@
*/
public class Configuration
{
+ private int maxTreeDepth;
private int sampleSize;
private int sleepBetweenTests;
private boolean gcBetweenTestsEnabled;
@@ -113,6 +114,16 @@
this.clusterConfig = clusterConfig;
}
+ public int getMaxTreeDepth()
+ {
+ return maxTreeDepth;
+ }
+
+ public void setMaxTreeDepth(int maxTreeDepth)
+ {
+ this.maxTreeDepth = maxTreeDepth;
+ }
+
public TestCase getTestCase(String testCaseName)
{
for (TestCase testCase : getTestCases())
Deleted: benchmarks/benchmark-fwk/trunk/src/org/cachebench/testobjects/SerializableAbstractSuperclass.java
===================================================================
--- benchmarks/benchmark-fwk/trunk/src/org/cachebench/testobjects/SerializableAbstractSuperclass.java 2008-07-16 15:05:37 UTC (rev 6305)
+++ benchmarks/benchmark-fwk/trunk/src/org/cachebench/testobjects/SerializableAbstractSuperclass.java 2008-07-16 16:03:20 UTC (rev 6306)
@@ -1,18 +0,0 @@
-package org.cachebench.testobjects;
-
-import java.io.Serializable;
-import java.util.Date;
-
-
-/**
- * @author Manik Surtani (manik(a)surtani.org)
- * @version $Id: SerializableAbstractSuperclass.java,v 1.2 2007/03/13 14:50:45 msurtani Exp $
- */
-public abstract class SerializableAbstractSuperclass implements Serializable
-{
- protected String myString = "MyString";
- protected int myInt = 5;
- protected float myFloat = 5.0f;
- protected long myLong = 5l;
- protected Date myDate = new Date();
-}
Deleted: benchmarks/benchmark-fwk/trunk/src/org/cachebench/testobjects/SerializableCustomType.java
===================================================================
--- benchmarks/benchmark-fwk/trunk/src/org/cachebench/testobjects/SerializableCustomType.java 2008-07-16 15:05:37 UTC (rev 6305)
+++ benchmarks/benchmark-fwk/trunk/src/org/cachebench/testobjects/SerializableCustomType.java 2008-07-16 16:03:20 UTC (rev 6306)
@@ -1,18 +0,0 @@
-package org.cachebench.testobjects;
-
-import java.io.Serializable;
-import java.util.Date;
-
-
-/**
- * @author Manik Surtani (manik(a)surtani.org)
- * @version $Id: SerializableCustomType.java,v 1.3 2007/03/13 14:50:45 msurtani Exp $
- */
-public class SerializableCustomType implements Serializable
-{
- protected String subString = "subclass string";
- protected int subInt = 5;
- protected float subFloat = 5.0f;
- protected long subLong = 5l;
- protected Date subDate = new Date();
-}
Deleted: benchmarks/benchmark-fwk/trunk/src/org/cachebench/testobjects/SerializableCustomTypeSubclassOfAbstract.java
===================================================================
--- benchmarks/benchmark-fwk/trunk/src/org/cachebench/testobjects/SerializableCustomTypeSubclassOfAbstract.java 2008-07-16 15:05:37 UTC (rev 6305)
+++ benchmarks/benchmark-fwk/trunk/src/org/cachebench/testobjects/SerializableCustomTypeSubclassOfAbstract.java 2008-07-16 16:03:20 UTC (rev 6306)
@@ -1,17 +0,0 @@
-package org.cachebench.testobjects;
-
-import java.util.Date;
-
-
-/**
- * @author Manik Surtani (manik(a)surtani.org)
- * @version $Id: SerializableCustomTypeSubclassOfAbstract.java,v 1.2 2007/03/13 14:50:45 msurtani Exp $
- */
-public class SerializableCustomTypeSubclassOfAbstract extends SerializableAbstractSuperclass
-{
- protected String subString = "subclass string";
- protected int subInt = 5;
- protected float subFloat = 5.0f;
- protected long subLong = 5l;
- protected Date subDate = new Date();
-}
Deleted: benchmarks/benchmark-fwk/trunk/src/org/cachebench/testobjects/SerializableCustomTypeWithAssocs.java
===================================================================
--- benchmarks/benchmark-fwk/trunk/src/org/cachebench/testobjects/SerializableCustomTypeWithAssocs.java 2008-07-16 15:05:37 UTC (rev 6305)
+++ benchmarks/benchmark-fwk/trunk/src/org/cachebench/testobjects/SerializableCustomTypeWithAssocs.java 2008-07-16 16:03:20 UTC (rev 6306)
@@ -1,24 +0,0 @@
-package org.cachebench.testobjects;
-
-import java.io.Serializable;
-import java.util.Date;
-
-
-/**
- * @author Manik Surtani (manik(a)surtani.org)
- * @version $Id: SerializableCustomTypeWithAssocs.java,v 1.2 2007/03/13 14:50:45 msurtani Exp $
- */
-public class SerializableCustomTypeWithAssocs implements Serializable
-{
- protected String subString = "subclass string";
- protected int subInt = 5;
- protected float subFloat = 5.0f;
- protected long subLong = 5l;
- protected Date subDate = new Date();
-
- // recursive assoc
- protected CustomType assoc1 = new CustomType();
- protected CustomType assoc2 = new CustomType();
- protected CustomType assoc3 = new CustomType();
-}
-
Deleted: benchmarks/benchmark-fwk/trunk/src/org/cachebench/testobjects/SerializableCustomTypeWithStatics.java
===================================================================
--- benchmarks/benchmark-fwk/trunk/src/org/cachebench/testobjects/SerializableCustomTypeWithStatics.java 2008-07-16 15:05:37 UTC (rev 6305)
+++ benchmarks/benchmark-fwk/trunk/src/org/cachebench/testobjects/SerializableCustomTypeWithStatics.java 2008-07-16 16:03:20 UTC (rev 6306)
@@ -1,22 +0,0 @@
-package org.cachebench.testobjects;
-
-import java.io.Serializable;
-import java.util.Date;
-
-
-/**
- * @author Manik Surtani (manik(a)surtani.org)
- * @version $Id: SerializableCustomTypeWithStatics.java,v 1.2 2007/03/13 14:50:45 msurtani Exp $
- */
-public class SerializableCustomTypeWithStatics implements Serializable
-{
- protected String subString = "subclass string";
- protected int subInt = 5;
- protected float subFloat = 5.0f;
- protected long subLong = 5l;
- protected Date subDate = new Date();
-
- protected static String stString = "static string";
- protected static Date stDate = new Date();
-
-}
Deleted: benchmarks/benchmark-fwk/trunk/src/org/cachebench/testobjects/SerializableCustomTypeWithTransient.java
===================================================================
--- benchmarks/benchmark-fwk/trunk/src/org/cachebench/testobjects/SerializableCustomTypeWithTransient.java 2008-07-16 15:05:37 UTC (rev 6305)
+++ benchmarks/benchmark-fwk/trunk/src/org/cachebench/testobjects/SerializableCustomTypeWithTransient.java 2008-07-16 16:03:20 UTC (rev 6306)
@@ -1,21 +0,0 @@
-package org.cachebench.testobjects;
-
-import java.io.Serializable;
-import java.util.Date;
-
-
-/**
- * @author Manik Surtani (manik(a)surtani.org)
- * @version $Id: SerializableCustomTypeWithTransient.java,v 1.3 2007/03/13 14:50:45 msurtani Exp $
- */
-public class SerializableCustomTypeWithTransient implements Serializable
-{
- protected String subString = "subclass string";
- protected int subInt = 5;
- protected float subFloat = 5.0f;
- protected long subLong = 5l;
- protected Date subDate = new Date();
-
- protected transient String trString = "transient";
- protected transient Date trDate = new Date();
-}
Added: benchmarks/benchmark-fwk/trunk/src/org/cachebench/tests/AbstractCacheTest.java
===================================================================
--- benchmarks/benchmark-fwk/trunk/src/org/cachebench/tests/AbstractCacheTest.java (rev 0)
+++ benchmarks/benchmark-fwk/trunk/src/org/cachebench/tests/AbstractCacheTest.java 2008-07-16 16:03:20 UTC (rev 6306)
@@ -0,0 +1,18 @@
+package org.cachebench.tests;
+
+import java.util.Arrays;
+import java.util.List;
+
+public abstract class AbstractCacheTest implements CacheTest
+{
+ /**
+ * @return a well-spaced path for a key-value pair
+ */
+ protected List<String> generatePath(String base, int sequence)
+ {
+ // use bucket sizes of 100 and a depth of 3.
+ int intermediate = sequence % 100;
+ return Arrays.asList(base, "Intermediate-" + intermediate, "Node " + sequence);
+ }
+
+}
Modified: benchmarks/benchmark-fwk/trunk/src/org/cachebench/tests/ReplicationOccursTest.java
===================================================================
--- benchmarks/benchmark-fwk/trunk/src/org/cachebench/tests/ReplicationOccursTest.java 2008-07-16 15:05:37 UTC (rev 6305)
+++ benchmarks/benchmark-fwk/trunk/src/org/cachebench/tests/ReplicationOccursTest.java 2008-07-16 16:03:20 UTC (rev 6306)
@@ -10,6 +10,7 @@
import org.cachebench.tests.results.StatisticTestResult;
import java.net.SocketAddress;
+import java.util.Arrays;
import java.util.Collection;
import java.util.Map;
@@ -72,7 +73,7 @@
{
try
{
- cache.put(PREFIX + currentNodeIndex, "true");
+ cache.put(Arrays.asList(PREFIX, "" + currentNodeIndex), PREFIX + currentNodeIndex, "true");
return;
}
catch (Throwable e)
@@ -185,7 +186,7 @@
{
try
{
- return cache.getReplicatedData(PREFIX + i);
+ return cache.getReplicatedData(Arrays.asList(PREFIX, "" + i), PREFIX + i);
}
catch (Throwable e)
{
Modified: benchmarks/benchmark-fwk/trunk/src/org/cachebench/tests/SessionSimulatorTest.java
===================================================================
--- benchmarks/benchmark-fwk/trunk/src/org/cachebench/tests/SessionSimulatorTest.java 2008-07-16 15:05:37 UTC (rev 6305)
+++ benchmarks/benchmark-fwk/trunk/src/org/cachebench/tests/SessionSimulatorTest.java 2008-07-16 16:03:20 UTC (rev 6306)
@@ -9,6 +9,7 @@
import org.cachebench.tests.results.TestResult;
import java.util.Date;
+import java.util.List;
import java.util.Random;
/**
@@ -17,7 +18,7 @@
* @author Mircea.Markus(a)jboss.com
* @since 2.2
*/
-public class SessionSimulatorTest implements CacheTest
+public class SessionSimulatorTest extends AbstractCacheTest
{
private static final Log log = LogFactory.getLog(SessionSimulatorTest.class);
@@ -77,20 +78,24 @@
Random r = new Random();
int randomAction;
int randomAttribute;
- long durrationNanos = 0;
+ long durationNanos = 0;
for (int i = 0; i < numberOfRequests; i++)
{
logRunCount(i);
randomAction = r.nextInt(100);
randomAttribute = r.nextInt(numberOfAttributes - 1);
byte[] buf;
+
+ String sessionEntry = getSessionEntry(randomAttribute);
+ List<String> path = generatePath(sessionId, randomAttribute);
+
if (randomAction < readPercentage)
{ // read
try
{
long start = System.nanoTime();
- buf = (byte[]) cacheWrapper.get(getSessionEntry(randomAttribute));
- durrationNanos += System.nanoTime() - start;
+ buf = (byte[]) cacheWrapper.get(path, sessionEntry);
+ durationNanos += System.nanoTime() - start;
totalBytesRead += buf.length;
reads++;
}
@@ -105,8 +110,8 @@
try
{
long start = System.nanoTime();
- cacheWrapper.put(getSessionEntry(randomAttribute), buf);
- durrationNanos += System.nanoTime() - start;
+ cacheWrapper.put(path, sessionEntry, buf);
+ durationNanos += System.nanoTime() - start;
totalBytesWritten += buf.length;
writes++;
}
@@ -116,8 +121,8 @@
}
}
}
- long durration = this.reportNanos ? durrationNanos : durrationNanos / 1000000;
- SessionSimulatorTestResult result = new SessionSimulatorTestResult(reads, writes, durration, totalBytesRead, totalBytesWritten);
+ long duration = this.reportNanos ? durationNanos : durationNanos / 1000000;
+ SessionSimulatorTestResult result = new SessionSimulatorTestResult(reads, writes, duration, totalBytesRead, totalBytesWritten);
result.setTestPassed(true);
result.setTestName(testCaseName + getNodeIndex());
result.setTestTime(new Date());
@@ -140,7 +145,7 @@
{
try
{
- cacheWrapper.put(getSessionEntry(i), new byte[sizeOfAnAttribute]);
+ cacheWrapper.put(generatePath(sessionId, i), getSessionEntry(i), new byte[sizeOfAnAttribute]);
}
catch (Throwable e)
{
Modified: benchmarks/benchmark-fwk/trunk/src/org/cachebench/tests/simpletests/AssociationsTest.java
===================================================================
--- benchmarks/benchmark-fwk/trunk/src/org/cachebench/tests/simpletests/AssociationsTest.java 2008-07-16 15:05:37 UTC (rev 6305)
+++ benchmarks/benchmark-fwk/trunk/src/org/cachebench/tests/simpletests/AssociationsTest.java 2008-07-16 16:03:20 UTC (rev 6306)
@@ -1,10 +1,8 @@
package org.cachebench.tests.simpletests;
import org.cachebench.CacheWrapper;
-import org.cachebench.SerializableCacheWrapper;
-import org.cachebench.tests.results.StatisticTestResult;
import org.cachebench.testobjects.CustomTypeWithAssocs;
-import org.cachebench.testobjects.SerializableCustomTypeWithAssocs;
+import org.cachebench.tests.results.StatisticTestResult;
/**
@@ -25,7 +23,7 @@
*/
public StatisticTestResult doTest(String testName, CacheWrapper cache, String testCaseName, int sampleSize, int numThreads) throws Exception
{
- return performTestWithObjectType(testName, cache, cache instanceof SerializableCacheWrapper ? SerializableCustomTypeWithAssocs.class : CustomTypeWithAssocs.class, testCaseName, sampleSize, numThreads);
+ return performTestWithObjectType(testName, cache, CustomTypeWithAssocs.class, testCaseName, sampleSize, numThreads);
}
Modified: benchmarks/benchmark-fwk/trunk/src/org/cachebench/tests/simpletests/CustomClassTest.java
===================================================================
--- benchmarks/benchmark-fwk/trunk/src/org/cachebench/tests/simpletests/CustomClassTest.java 2008-07-16 15:05:37 UTC (rev 6305)
+++ benchmarks/benchmark-fwk/trunk/src/org/cachebench/tests/simpletests/CustomClassTest.java 2008-07-16 16:03:20 UTC (rev 6306)
@@ -1,10 +1,8 @@
package org.cachebench.tests.simpletests;
import org.cachebench.CacheWrapper;
-import org.cachebench.SerializableCacheWrapper;
-import org.cachebench.tests.results.StatisticTestResult;
import org.cachebench.testobjects.CustomType;
-import org.cachebench.testobjects.SerializableCustomType;
+import org.cachebench.tests.results.StatisticTestResult;
/**
@@ -24,7 +22,7 @@
*/
public StatisticTestResult doTest(String testName, CacheWrapper cache, String testCaseName, int sampleSize, int numThreads) throws Exception
{
- return performTestWithObjectType(testName, cache, cache instanceof SerializableCacheWrapper ? SerializableCustomType.class : CustomType.class, testCaseName, sampleSize, numThreads);
+ return performTestWithObjectType(testName, cache, CustomType.class, testCaseName, sampleSize, numThreads);
}
Modified: benchmarks/benchmark-fwk/trunk/src/org/cachebench/tests/simpletests/SimpleTest.java
===================================================================
--- benchmarks/benchmark-fwk/trunk/src/org/cachebench/tests/simpletests/SimpleTest.java 2008-07-16 15:05:37 UTC (rev 6305)
+++ benchmarks/benchmark-fwk/trunk/src/org/cachebench/tests/simpletests/SimpleTest.java 2008-07-16 16:03:20 UTC (rev 6306)
@@ -4,17 +4,16 @@
import org.apache.commons.logging.LogFactory;
import org.apache.commons.math.stat.descriptive.DescriptiveStatistics;
import org.cachebench.CacheWrapper;
-import org.cachebench.SerializableCacheWrapper;
import org.cachebench.config.Configuration;
import org.cachebench.config.TestCase;
import org.cachebench.config.TestConfig;
-import org.cachebench.tests.CacheTest;
+import org.cachebench.tests.AbstractCacheTest;
import org.cachebench.tests.results.StatisticTestResult;
import java.io.ByteArrayOutputStream;
import java.io.ObjectOutputStream;
-import java.io.Serializable;
import java.util.Date;
+import java.util.List;
import java.util.Random;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
@@ -27,7 +26,7 @@
* @author Manik Surtani (manik(a)surtani.org)
* (C) Manik Surtani, 2004
*/
-public abstract class SimpleTest implements CacheTest
+public abstract class SimpleTest extends AbstractCacheTest
{
protected Log log = LogFactory.getLog(this.getClass());
protected AtomicLong numberOfBytesPut = new AtomicLong(0);
@@ -119,7 +118,6 @@
final String key = "baseKey";
final DescriptiveStatistics getStats = DescriptiveStatistics.newInstance();
final DescriptiveStatistics putStats = DescriptiveStatistics.newInstance();
- final boolean useSerializable = cache instanceof SerializableCacheWrapper;
Random rand = new Random();
int modDivisor = 100 / writePercentage;
numberOfBytesPut.set(0);
@@ -152,25 +150,16 @@
numberOfBytesPut.getAndAdd(calculateSerializedSize(value));
- if (!useSerializable)
- {
- // start your timer...
- long startTime = System.nanoTime();
- cache.put(key + cycleNumber, value);
- long statValue = (System.nanoTime() - startTime);
- putStats.addValue(statValue);
- if (log.isDebugEnabled()) log.debug("Time For This Put: " + statValue);
- }
- else
- {
- SerializableCacheWrapper sCache = (SerializableCacheWrapper) cache;
- Serializable sValue = (Serializable) value;
- long startTime = System.nanoTime();
- sCache.putSerializable(key + cycleNumber, sValue);
- long statValue = (System.nanoTime() - startTime);
- putStats.addValue(statValue);
- if (log.isDebugEnabled()) log.debug("Time For This Put: " + statValue);
- }
+ List<String> path = generatePath(key, cycleNumber);
+ String attributeKey = key + cycleNumber;
+
+ // start your timer...
+ long startTime = System.nanoTime();
+ cache.put(path, attributeKey, value);
+ long statValue = (System.nanoTime() - startTime);
+ putStats.addValue(statValue);
+ if (log.isDebugEnabled()) log.debug("Time For This Put: " + statValue);
+
logOperation(cycleNumber, "PUTS");
}
catch (Exception e)
@@ -191,24 +180,15 @@
int cycleNumber = getCount.getAndIncrement();
try
{
- if (!useSerializable)
- {
- // start your timer...
- long startTime = System.nanoTime();
- cache.get(key + cycleNumber);
- long statValue = (System.nanoTime() - startTime);
- getStats.addValue(statValue);
- if (log.isDebugEnabled()) log.debug("Time For This Get: " + statValue);
- }
- else
- {
- SerializableCacheWrapper sCache = (SerializableCacheWrapper) cache;
- long startTime = System.nanoTime();
- sCache.getSerializable(key + cycleNumber);
- long statValue = (System.nanoTime() - startTime);
- getStats.addValue(statValue);
- if (log.isDebugEnabled()) log.debug("Time For This Get: " + statValue);
- }
+ List<String> path = generatePath(key, cycleNumber);
+ String attributeKey = key + cycleNumber;
+
+ // start your timer...
+ long startTime = System.nanoTime();
+ cache.get(path, attributeKey);
+ long statValue = (System.nanoTime() - startTime);
+ getStats.addValue(statValue);
+ if (log.isDebugEnabled()) log.debug("Time For This Get: " + statValue);
logOperation(cycleNumber, "GETS");
}
catch (Exception e)
Modified: benchmarks/benchmark-fwk/trunk/src/org/cachebench/tests/simpletests/StaticsTest.java
===================================================================
--- benchmarks/benchmark-fwk/trunk/src/org/cachebench/tests/simpletests/StaticsTest.java 2008-07-16 15:05:37 UTC (rev 6305)
+++ benchmarks/benchmark-fwk/trunk/src/org/cachebench/tests/simpletests/StaticsTest.java 2008-07-16 16:03:20 UTC (rev 6306)
@@ -1,10 +1,8 @@
package org.cachebench.tests.simpletests;
import org.cachebench.CacheWrapper;
-import org.cachebench.SerializableCacheWrapper;
-import org.cachebench.tests.results.StatisticTestResult;
import org.cachebench.testobjects.CustomTypeWithStatics;
-import org.cachebench.testobjects.SerializableCustomTypeWithStatics;
+import org.cachebench.tests.results.StatisticTestResult;
/**
@@ -25,7 +23,7 @@
*/
public StatisticTestResult doTest(String testName, CacheWrapper cache, String testCaseName, int sampleSize, int numThreads) throws Exception
{
- return performTestWithObjectType(testName, cache, cache instanceof SerializableCacheWrapper ? SerializableCustomTypeWithStatics.class : CustomTypeWithStatics.class, testCaseName, sampleSize, numThreads);
+ return performTestWithObjectType(testName, cache, CustomTypeWithStatics.class, testCaseName, sampleSize, numThreads);
}
}
Modified: benchmarks/benchmark-fwk/trunk/src/org/cachebench/tests/simpletests/SubclassTest.java
===================================================================
--- benchmarks/benchmark-fwk/trunk/src/org/cachebench/tests/simpletests/SubclassTest.java 2008-07-16 15:05:37 UTC (rev 6305)
+++ benchmarks/benchmark-fwk/trunk/src/org/cachebench/tests/simpletests/SubclassTest.java 2008-07-16 16:03:20 UTC (rev 6306)
@@ -1,10 +1,8 @@
package org.cachebench.tests.simpletests;
import org.cachebench.CacheWrapper;
-import org.cachebench.SerializableCacheWrapper;
-import org.cachebench.tests.results.StatisticTestResult;
import org.cachebench.testobjects.CustomTypeSubclassOfAbstract;
-import org.cachebench.testobjects.SerializableCustomTypeSubclassOfAbstract;
+import org.cachebench.tests.results.StatisticTestResult;
/**
@@ -25,7 +23,7 @@
*/
public StatisticTestResult doTest(String testName, CacheWrapper cache, String testCaseName, int sampleSize, int numThreads) throws Exception
{
- return performTestWithObjectType(testName, cache, cache instanceof SerializableCacheWrapper ? SerializableCustomTypeSubclassOfAbstract.class : CustomTypeSubclassOfAbstract.class, testCaseName, sampleSize, numThreads);
+ return performTestWithObjectType(testName, cache, CustomTypeSubclassOfAbstract.class, testCaseName, sampleSize, numThreads);
}
Modified: benchmarks/benchmark-fwk/trunk/src/org/cachebench/tests/simpletests/TransientTest.java
===================================================================
--- benchmarks/benchmark-fwk/trunk/src/org/cachebench/tests/simpletests/TransientTest.java 2008-07-16 15:05:37 UTC (rev 6305)
+++ benchmarks/benchmark-fwk/trunk/src/org/cachebench/tests/simpletests/TransientTest.java 2008-07-16 16:03:20 UTC (rev 6306)
@@ -1,10 +1,8 @@
package org.cachebench.tests.simpletests;
import org.cachebench.CacheWrapper;
-import org.cachebench.SerializableCacheWrapper;
-import org.cachebench.tests.results.StatisticTestResult;
import org.cachebench.testobjects.CustomTypeWithTransient;
-import org.cachebench.testobjects.SerializableCustomTypeWithTransient;
+import org.cachebench.tests.results.StatisticTestResult;
/**
@@ -24,7 +22,7 @@
*/
public StatisticTestResult doTest(String testName, CacheWrapper cache, String testCaseName, int sampleSize, int numThreads) throws Exception
{
- return performTestWithObjectType(testName, cache, cache instanceof SerializableCacheWrapper ? SerializableCustomTypeWithTransient.class : CustomTypeWithTransient.class, testCaseName, sampleSize, numThreads);
+ return performTestWithObjectType(testName, cache, CustomTypeWithTransient.class, testCaseName, sampleSize, numThreads);
}
}
Modified: benchmarks/benchmark-fwk/trunk/src/org/cachebench/warmup/PutGetCacheWarmup.java
===================================================================
--- benchmarks/benchmark-fwk/trunk/src/org/cachebench/warmup/PutGetCacheWarmup.java 2008-07-16 15:05:37 UTC (rev 6305)
+++ benchmarks/benchmark-fwk/trunk/src/org/cachebench/warmup/PutGetCacheWarmup.java 2008-07-16 16:03:20 UTC (rev 6306)
@@ -4,6 +4,9 @@
import org.apache.commons.logging.LogFactory;
import org.cachebench.CacheWrapper;
+import java.util.Arrays;
+import java.util.List;
+
/**
* Perfoms N puts, gets and removals, where n is configurable.
*
@@ -18,12 +21,14 @@
{
Integer opCount = Integer.parseInt(getConfigParam("operationCount"));
log.info("Cache launched, performing " + opCount + " put and get operations ");
+ List<String> path = Arrays.asList("a", "b", "c");
for (int i = 0; i < opCount; i++)
{
try
{
- wrapper.put(String.valueOf(opCount), String.valueOf(opCount));
- } catch (Throwable e)
+ wrapper.put(path, String.valueOf(opCount), String.valueOf(opCount));
+ }
+ catch (Throwable e)
{
log.warn("Exception on cache warmup", e);
}
@@ -31,7 +36,7 @@
for (int i = 0; i < opCount; i++)
{
- wrapper.get(String.valueOf(opCount));
+ wrapper.get(path, String.valueOf(opCount));
}
log.trace("Cache warmup ended!");
}
17 years, 5 months
JBoss Cache SVN: r6305 - benchmarks/benchmark-fwk/trunk/src/org/cachebench/tests.
by jbosscache-commits@lists.jboss.org
Author: mircea.markus
Date: 2008-07-16 11:05:37 -0400 (Wed, 16 Jul 2008)
New Revision: 6305
Modified:
benchmarks/benchmark-fwk/trunk/src/org/cachebench/tests/SessionSimulatorTest.java
Log:
increased test accuracy and added support for nanos
Modified: benchmarks/benchmark-fwk/trunk/src/org/cachebench/tests/SessionSimulatorTest.java
===================================================================
--- benchmarks/benchmark-fwk/trunk/src/org/cachebench/tests/SessionSimulatorTest.java 2008-07-16 15:03:07 UTC (rev 6304)
+++ benchmarks/benchmark-fwk/trunk/src/org/cachebench/tests/SessionSimulatorTest.java 2008-07-16 15:05:37 UTC (rev 6305)
@@ -27,6 +27,7 @@
private TestConfig thisTestConfig;
private String sessionId;
private CacheWrapper cacheWrapper;
+ private boolean reportNanos = false;
/**
@@ -76,7 +77,7 @@
Random r = new Random();
int randomAction;
int randomAttribute;
- long start = System.currentTimeMillis();
+ long durrationNanos = 0;
for (int i = 0; i < numberOfRequests; i++)
{
logRunCount(i);
@@ -87,7 +88,9 @@
{ // read
try
{
+ long start = System.nanoTime();
buf = (byte[]) cacheWrapper.get(getSessionEntry(randomAttribute));
+ durrationNanos += System.nanoTime() - start;
totalBytesRead += buf.length;
reads++;
}
@@ -101,7 +104,9 @@
buf = new byte[this.sizeOfAnAttribute];
try
{
+ long start = System.nanoTime();
cacheWrapper.put(getSessionEntry(randomAttribute), buf);
+ durrationNanos += System.nanoTime() - start;
totalBytesWritten += buf.length;
writes++;
}
@@ -111,7 +116,7 @@
}
}
}
- long durration = System.currentTimeMillis() - start;
+ long durration = this.reportNanos ? durrationNanos : durrationNanos / 1000000;
SessionSimulatorTestResult result = new SessionSimulatorTestResult(reads, writes, durration, totalBytesRead, totalBytesWritten);
result.setTestPassed(true);
result.setTestName(testCaseName + getNodeIndex());
@@ -157,6 +162,10 @@
numberOfAttributes = thisTestConfig.getIntValue("numberOfAttributes");
writePercentage = thisTestConfig.getIntValue("writePercentage");
sizeOfAnAttribute = thisTestConfig.getIntValue("sizeOfAnAttribute");
+ if (thisTestConfig.existsParam("reportNanos"))
+ {
+ this.reportNanos = Boolean.valueOf(thisTestConfig.getParamValue("reportNanos"));
+ }
log.debug("recieved follosing params[ numberOfRequests=" + numberOfRequests + ", numberOfAttributes="
+ numberOfAttributes + ", writePercentage=" + writePercentage + ", sizeOfAnAttribute=" + sizeOfAnAttribute + " ]");
}
17 years, 5 months
JBoss Cache SVN: r6304 - in benchmarks/benchmark-fwk/trunk: conf and 1 other directories.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-07-16 11:03:07 -0400 (Wed, 16 Jul 2008)
New Revision: 6304
Modified:
benchmarks/benchmark-fwk/trunk/conf/cachebench-local.xml
benchmarks/benchmark-fwk/trunk/runAllLocal.sh
benchmarks/benchmark-fwk/trunk/src/org/cachebench/tests/simpletests/SimpleTest.java
Log:
Simple tests now measure concurrent puts and gets like the session repl test
Modified: benchmarks/benchmark-fwk/trunk/conf/cachebench-local.xml
===================================================================
--- benchmarks/benchmark-fwk/trunk/conf/cachebench-local.xml 2008-07-16 13:57:30 UTC (rev 6303)
+++ benchmarks/benchmark-fwk/trunk/conf/cachebench-local.xml 2008-07-16 15:03:07 UTC (rev 6304)
@@ -60,7 +60,9 @@
* You can write your own custom testClass.
* weight is currently unused.
-->
- <test name="Strings" testClass="org.cachebench.tests.simpletests.StringTest" weight="2.0"/>
+ <test name="Strings" testClass="org.cachebench.tests.simpletests.StringTest" weight="2.0">
+ <param name="writePercentage" value="20"/>
+ </test>
<!--<test name="SessionSimulator" testClass="org.cachebench.tests.SessionSimulatorTest" weight="2.0">-->
<!--<param name="numberOfRequest" value="100000"/>-->
Modified: benchmarks/benchmark-fwk/trunk/runAllLocal.sh
===================================================================
--- benchmarks/benchmark-fwk/trunk/runAllLocal.sh 2008-07-16 13:57:30 UTC (rev 6303)
+++ benchmarks/benchmark-fwk/trunk/runAllLocal.sh 2008-07-16 15:03:07 UTC (rev 6304)
@@ -1,5 +1,7 @@
#!/bin/bash
+rm -rf ./output/*
+
./runLocalNode.sh jbosscache-3.0.0 pess-local.xml
./runLocalNode.sh jbosscache-3.0.0 mvcc-local.xml
./runLocalNode.sh jbosscache-3.0.0 pess-local-NONE.xml
Modified: benchmarks/benchmark-fwk/trunk/src/org/cachebench/tests/simpletests/SimpleTest.java
===================================================================
--- benchmarks/benchmark-fwk/trunk/src/org/cachebench/tests/simpletests/SimpleTest.java 2008-07-16 13:57:30 UTC (rev 6303)
+++ benchmarks/benchmark-fwk/trunk/src/org/cachebench/tests/simpletests/SimpleTest.java 2008-07-16 15:03:07 UTC (rev 6304)
@@ -6,6 +6,8 @@
import org.cachebench.CacheWrapper;
import org.cachebench.SerializableCacheWrapper;
import org.cachebench.config.Configuration;
+import org.cachebench.config.TestCase;
+import org.cachebench.config.TestConfig;
import org.cachebench.tests.CacheTest;
import org.cachebench.tests.results.StatisticTestResult;
@@ -13,9 +15,11 @@
import java.io.ObjectOutputStream;
import java.io.Serializable;
import java.util.Date;
+import java.util.Random;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicLong;
@@ -27,14 +31,31 @@
{
protected Log log = LogFactory.getLog(this.getClass());
protected AtomicLong numberOfBytesPut = new AtomicLong(0);
- protected long elapsedSecondsForAllPuts = 0;
+ protected int writePercentage = 50;
protected ExecutorService executor;
private static final int EXECUTOR_SHUTDOWN_TIMEOUT_POLL_SECS = 60;
protected Configuration configuration;
protected final int LOG_FREQUENCY = 5000;
+ private int getWritePercentageFromConfig(String testCaseName, String testName)
+ {
+ try
+ {
+ TestCase tc = configuration.getTestCase(testName);
+ TestConfig t = tc.getTest(testCaseName);
+ return t.getIntValue("writePercentage");
+ }
+ catch (Exception e)
+ {
+ log.warn("Unable to get write percentage. Using default (50)", e);
+ return 50;
+ }
+ }
+
protected StatisticTestResult performTestWithObjectType(String testCaseName, CacheWrapper cache, Class valueClass, String testName, int sampleSize, int numThreads) throws Exception
{
+ writePercentage = getWritePercentageFromConfig(testCaseName, testName);
+ log.info("Using write percentage " + writePercentage);
log.info("Number of threads " + numThreads);
executor = Executors.newFixedThreadPool(numThreads);
@@ -43,14 +64,11 @@
result.setTestTime(new Date());
result.setTestType(testName);
- log.info("Performing '" + sampleSize + "' PUTs");
- DescriptiveStatistics putStats = doPuts(cache, valueClass, sampleSize);
- executor = Executors.newFixedThreadPool(numThreads);
- log.info("Performing GETs");
- DescriptiveStatistics getStats = doGets(cache, sampleSize);
+ log.info("Performing test");
+ DescriptiveStatistics[] stats = doGetsAndPuts(cache, valueClass, sampleSize);
- result.setGetData(getStats);
- result.setPutData(putStats);
+ result.setGetData(stats[0]);
+ result.setPutData(stats[1]);
result.setTestPassed(true); // The test is passed. The report would make use of this attribute.
// calculate throughput, in transactions per second.
@@ -58,8 +76,10 @@
// calc tps.
+ long elapsedSecondsForAllPuts = TimeUnit.NANOSECONDS.toSeconds((long) stats[1].getSum());
+
System.out.println("*** sum of time: " + elapsedSecondsForAllPuts);
- System.out.println("*** num puts occured: " + putStats.getN());
+ System.out.println("*** num puts occured: " + stats[1].getN());
try
{
@@ -93,49 +113,112 @@
* @param sampleSize The size of the cache.
* @return The Descriptive statistics of the cache benchmarking.
*/
- private DescriptiveStatistics doGets(final CacheWrapper cache, int sampleSize) throws Exception
+ private DescriptiveStatistics[] doGetsAndPuts(final CacheWrapper cache, final Class valueClass, int sampleSize) throws Exception
{
log.debug("Inside doGets for : " + cache);
final String key = "baseKey";
- final DescriptiveStatistics stats = DescriptiveStatistics.newInstance();
+ final DescriptiveStatistics getStats = DescriptiveStatistics.newInstance();
+ final DescriptiveStatistics putStats = DescriptiveStatistics.newInstance();
final boolean useSerializable = cache instanceof SerializableCacheWrapper;
+ Random rand = new Random();
+ int modDivisor = 100 / writePercentage;
+ numberOfBytesPut.set(0);
+ final AtomicInteger getCount = new AtomicInteger(0);
+ final AtomicInteger putCount = new AtomicInteger(0);
+
for (int i = 0; i < sampleSize; i++)
{
- final int cycleNumber = i;
- Runnable r = new Runnable()
+ Runnable r;
+ if (rand.nextInt(100) % modDivisor == 0)
{
- public void run()
+ // do a WRITE!
+ r = new Runnable()
{
- try
+ public void run()
{
- if (!useSerializable)
+ int cycleNumber = putCount.getAndIncrement();
+ try
{
- // start your timer...
- long startTime = System.nanoTime();
- cache.get(key + cycleNumber);
- long statValue = (System.nanoTime() - startTime);
- stats.addValue(statValue);
- log.debug("The Get stat : " + statValue);
+ // generate some value
+ Object value;
+ if (valueClass == null) value = null;
+ else if (valueClass.getName().equals(String.class.getName())) value = "value" + cycleNumber;
+ else if (valueClass.getName().equals(Integer.class.getName())) value = cycleNumber;
+ else value = valueClass.newInstance();
+
+ // even though some impls may use special marshalling to reduce the amount of data transmitted (such as JBoss Cache's
+ // CacheMarshaller) we still want to measure the serialized size of objects for this metric.
+
+ numberOfBytesPut.getAndAdd(calculateSerializedSize(value));
+
+ if (!useSerializable)
+ {
+ // start your timer...
+ long startTime = System.nanoTime();
+ cache.put(key + cycleNumber, value);
+ long statValue = (System.nanoTime() - startTime);
+ putStats.addValue(statValue);
+ if (log.isDebugEnabled()) log.debug("Time For This Put: " + statValue);
+ }
+ else
+ {
+ SerializableCacheWrapper sCache = (SerializableCacheWrapper) cache;
+ Serializable sValue = (Serializable) value;
+ long startTime = System.nanoTime();
+ sCache.putSerializable(key + cycleNumber, sValue);
+ long statValue = (System.nanoTime() - startTime);
+ putStats.addValue(statValue);
+ if (log.isDebugEnabled()) log.debug("Time For This Put: " + statValue);
+ }
+ logOperation(cycleNumber, "PUTS");
}
- else
+ catch (Exception e)
{
- SerializableCacheWrapper sCache = (SerializableCacheWrapper) cache;
- long startTime = System.nanoTime();
- sCache.getSerializable(key + cycleNumber);
- long statValue = (System.nanoTime() - startTime);
- stats.addValue(statValue);
- log.debug("The Get stat : " + statValue);
+ // how should we handle this? Log for now...
+ log.error("Operation failed!", e);
}
- logOperation(cycleNumber, "GETS");
}
- catch (Exception e)
+ };
+ }
+ else
+ {
+ // do a READ!
+ r = new Runnable()
+ {
+ public void run()
{
- // how should we handle this? Log for now...
- log.error("Operation failed!", e);
+ int cycleNumber = getCount.getAndIncrement();
+ try
+ {
+ if (!useSerializable)
+ {
+ // start your timer...
+ long startTime = System.nanoTime();
+ cache.get(key + cycleNumber);
+ long statValue = (System.nanoTime() - startTime);
+ getStats.addValue(statValue);
+ if (log.isDebugEnabled()) log.debug("Time For This Get: " + statValue);
+ }
+ else
+ {
+ SerializableCacheWrapper sCache = (SerializableCacheWrapper) cache;
+ long startTime = System.nanoTime();
+ sCache.getSerializable(key + cycleNumber);
+ long statValue = (System.nanoTime() - startTime);
+ getStats.addValue(statValue);
+ if (log.isDebugEnabled()) log.debug("Time For This Get: " + statValue);
+ }
+ logOperation(cycleNumber, "GETS");
+ }
+ catch (Exception e)
+ {
+ // how should we handle this? Log for now...
+ log.error("Operation failed!", e);
+ }
}
- }
- };
+ };
+ }
// submit task to be executed
executor.execute(r);
@@ -145,8 +228,8 @@
blockTillTasksComplete();
// return the raw data
- log.debug("Leaving doGets for : " + cache);
- return stats;
+ log.debug("Leaving doTasks for : " + cache);
+ return new DescriptiveStatistics[]{getStats, putStats};
}
private void logOperation(int i, String s)
@@ -157,83 +240,6 @@
}
}
- /**
- * @param cache The Cachewrapper on which the bechmark is conducted.
- * @param valueClass The value class instance which is going to be inserted into the Cache.
- * @param sampleSize The size of the cache.
- * @return The Descriptive statistics of the cache benchmarking.
- */
- private DescriptiveStatistics doPuts(final CacheWrapper cache, final Class valueClass, int sampleSize) throws Exception
- {
- log.debug("Inside doPuts for " + cache);
- final String key = "baseKey";
- final DescriptiveStatistics stats = DescriptiveStatistics.newInstance();
- final boolean useSerializable = cache instanceof SerializableCacheWrapper;
- numberOfBytesPut.set(0);
- elapsedSecondsForAllPuts = 0;
- long startElapsedTime = System.nanoTime();
-
- for (int i = 0; i < sampleSize; i++)
- {
- final int cycleNumber = i;
- Runnable r = new Runnable()
- {
- public void run()
- {
- try
- {
- // generate some value
- Object value;
- if (valueClass == null) value = null;
- else if (valueClass.getName().equals("java.lang.String")) value = "value" + cycleNumber;
- else if (valueClass.getName().equals("java.lang.Integer")) value = cycleNumber;
- else value = valueClass.newInstance();
-
- // even though some impls may use special marshalling to reduce the amount of data transmitted (such as JBoss Cache's
- // CacheMarshaller) we still want to measure the serialized size of objects for this metric.
-
- numberOfBytesPut.getAndAdd(calculateSerializedSize(value));
-
- if (!useSerializable)
- {
- // start your timer...
- long startTime = System.nanoTime();
- cache.put(key + cycleNumber, value);
- long statValue = (System.nanoTime() - startTime);
- stats.addValue(statValue);
- }
- else
- {
- SerializableCacheWrapper sCache = (SerializableCacheWrapper) cache;
- Serializable sValue = (Serializable) value;
- long startTime = System.nanoTime();
- sCache.putSerializable(key + cycleNumber, sValue);
- long statValue = (System.nanoTime() - startTime);
- stats.addValue(statValue);
- }
- logOperation(cycleNumber, "PUTS");
- }
- catch (Exception e)
- {
- // how should we handle this? Log for now...
- log.error("Operation failed!", e);
- }
- }
- };
- // submit task to be executed
- executor.execute(r);
- }
-
- // only leave once the task queue is empty!!
- blockTillTasksComplete();
-
- elapsedSecondsForAllPuts = TimeUnit.NANOSECONDS.toSeconds(System.nanoTime() - startElapsedTime);
-
- // return the raw data
- log.debug("Leaving doPuts for " + cache);
- return stats;
- }
-
private void blockTillTasksComplete()
{
// now that just told us that all the tasks have been submitted. Lets check that the executor has finished everything.
17 years, 5 months