Author: mircea.markus
Date: 2008-07-01 02:19:50 -0400 (Tue, 01 Jul 2008)
New Revision: 6137
Added:
core/trunk/src/test/resources/configs/parser-test.xml
Modified:
core/trunk/src/main/java/org/jboss/cache/config/parsing/XmlConfigurationParser.java
core/trunk/src/main/release/build.xml
core/trunk/src/main/resources/all-elements-file-3.x.xml
core/trunk/src/main/resources/config-samples/buddy-replication.xml
core/trunk/src/test/java/org/jboss/cache/config/parsing/XmlConfigurationParserTest.java
Log:
added new locking configs needed by mvcc : concurrencyLevel and allowWriteSkew
Modified:
core/trunk/src/main/java/org/jboss/cache/config/parsing/XmlConfigurationParser.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/config/parsing/XmlConfigurationParser.java 2008-07-01
05:59:38 UTC (rev 6136)
+++
core/trunk/src/main/java/org/jboss/cache/config/parsing/XmlConfigurationParser.java 2008-07-01
06:19:50 UTC (rev 6137)
@@ -288,6 +288,10 @@
if (existsAttribute(lockAcquisitionTimeout))
config.setLockAcquisitionTimeout(getLong(lockAcquisitionTimeout));
String nodeLockingScheme = getAttributeValue(element,
"nodeLockingScheme");
if (existsAttribute(nodeLockingScheme))
config.setNodeLockingScheme(nodeLockingScheme);
+ String allowWriteSkew = getAttributeValue(element, "allowWriteSkew");
+ if (existsAttribute(allowWriteSkew))
config.setAllowWriteSkew(getBoolean(allowWriteSkew));
+ String concurrencyLevel = getAttributeValue(element,
"concurrencyLevel");
+ if (existsAttribute(concurrencyLevel))
config.setConcurrencyLevel(getInt(concurrencyLevel));
}
private Element getSingleElement(String elementName)
Modified: core/trunk/src/main/release/build.xml
===================================================================
--- core/trunk/src/main/release/build.xml 2008-07-01 05:59:38 UTC (rev 6136)
+++ core/trunk/src/main/release/build.xml 2008-07-01 06:19:50 UTC (rev 6137)
@@ -129,6 +129,7 @@
</target>
<!-- todo mmarkus add a paragraph in documentation to mntion about this-->
+ <!-- todo mmarkus add an sh and bat file to call this, which should also be present
in the dist file -->
<target name="config2to3">
<echo message="${os.name}"/>
<xslt in="${source}" out="${destination}"
style="resources/config2to3.xslt"/>
Modified: core/trunk/src/main/resources/all-elements-file-3.x.xml
===================================================================
--- core/trunk/src/main/resources/all-elements-file-3.x.xml 2008-07-01 05:59:38 UTC (rev
6136)
+++ core/trunk/src/main/resources/all-elements-file-3.x.xml 2008-07-01 06:19:50 UTC (rev
6137)
@@ -3,7 +3,7 @@
<jbosscache>
<locking isolationLevel="REPEATABLE_READ"
lockParentForChildInsertRemove="true" lockAcquisitionTimeout="10234"
- nodeLockingScheme="Optimistic"/>
+ nodeLockingScheme="mvcc"allowWriteSkew="true"
concurrencyLevel="21"/>
<transaction
transactionManagerLookupClass="org.jboss.cache.transaction.GenericTransactionManagerLookup"
syncRollbackPhase="true" syncCommitPhase="true"/>
Modified: core/trunk/src/main/resources/config-samples/buddy-replication.xml
===================================================================
--- core/trunk/src/main/resources/config-samples/buddy-replication.xml 2008-07-01 05:59:38
UTC (rev 6136)
+++ core/trunk/src/main/resources/config-samples/buddy-replication.xml 2008-07-01 06:19:50
UTC (rev 6137)
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- todo mmarkus add comments to sample config files (after DTD is written)
-->
+ <!-- todo mmarkus include the DTD file in all configs -->
<jbosscache>
<locking isolationLevel="REPEATABLE_READ"
lockAcquisitionTimeout="10000" nodeLockingScheme="mvcc"/>
Modified:
core/trunk/src/test/java/org/jboss/cache/config/parsing/XmlConfigurationParserTest.java
===================================================================
---
core/trunk/src/test/java/org/jboss/cache/config/parsing/XmlConfigurationParserTest.java 2008-07-01
05:59:38 UTC (rev 6136)
+++
core/trunk/src/test/java/org/jboss/cache/config/parsing/XmlConfigurationParserTest.java 2008-07-01
06:19:50 UTC (rev 6137)
@@ -22,7 +22,7 @@
public void setUp()
{
XmlConfigurationParser parser = new XmlConfigurationParser();
- config = parser.parseFile("/configs/parser-test-file-3.x.xml");
+ config = parser.parseFile("configs/parser-test.xml");
}
public void testTransactionManagerLookupClass()
@@ -178,7 +178,7 @@
EvictionConfig evictionConfig = config.getEvictionConfig();
assert
"org.jboss.cache.eviction.LRUPolicy".equals(evictionConfig.getDefaultEvictionPolicyClass());
assert 200000 == evictionConfig.getDefaultEventQueueSize();
- assert 5 == evictionConfig.getWakeupIntervalSeconds();
+ assert 5 == evictionConfig.getWakeupInterval();
List<EvictionRegionConfig> regionConfigs =
evictionConfig.getEvictionRegionConfigs();
assert regionConfigs.size() == 3;
@@ -235,7 +235,11 @@
assert singlStoreConf.getProperties().size() == 2;
assert
singlStoreConf.getProperties().get("pushStateWhenCoordinator").equals("true");
assert
singlStoreConf.getProperties().get("pushStateWhenCoordinatorTimeout").equals("20000");
+ }
+ public void testMvccAttributes()
+ {
+ assert config.isAllowWriteSkew();
+ assert config.getConcurrencyLevel() == 21;
}
-
}
Added: core/trunk/src/test/resources/configs/parser-test.xml
===================================================================
--- core/trunk/src/test/resources/configs/parser-test.xml (rev 0)
+++ core/trunk/src/test/resources/configs/parser-test.xml 2008-07-01 06:19:50 UTC (rev
6137)
@@ -0,0 +1,119 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- file used for functional test of the xml parser -->
+
+<jbosscache>
+
+ <locking isolationLevel="REPEATABLE_READ"
lockParentForChildInsertRemove="true" lockAcquisitionTimeout="10234"
+ nodeLockingScheme="mvcc" allowWriteSkew="true"
concurrencyLevel="21"/>
+
+ <transaction
transactionManagerLookupClass="org.jboss.cache.transaction.GenericTransactionManagerLookup"
+ syncRollbackPhase="true" syncCommitPhase="true"/>
+
+ <!-- serialization related configuration, used for replication and cache loading
-->
+ <serialization objectInputStreamPoolSize="12"
objectOutputStreamPoolSize="14" version="1.2.4"
+ marshallerClass="some.Clazz"
useLazyDeserialization="true" useRegionBasedMarshalling="true"/>
+
+ <replication>
+ <sync replTimeout="15421"/>
+ <buddy enabled="true" poolName="myBuddyPoolReplicationGroup"
communicationTimeout="2000">
+ <dataGravitation auto="true" removeOnFind="true"
searchBackupTrees="true"/>
+ <locator
class="org.jboss.cache.buddyreplication.NextMemberBuddyLocator">
+ <properties>
+ numBuddies = 1
+ ignoreColocatedBuddies = true
+ </properties>
+ </locator>
+ </buddy>
+ </replication>
+
+ <startup fetchInMemoryState="true"
stateRetrievalTimeout="15124" inactiveOnStartup="true"/>
+ <shutdown hookBehavior="REGISTER"/>
+
+ <transport clusterName="JBossCache-Cluster"
multiplexerStack="file_name">
+ <jgroupsConfig>
+ <PING timeout="2000" num_initial_members="3"/>
+ <MERGE2 max_interval="30000" min_interval="10000"/>
+ <FD_SOCK/>
+ <FD timeout="10000" max_tries="5"
shun="true"/>
+ <VERIFY_SUSPECT timeout="1500"/>
+ <pbcast.NAKACK use_mcast_xmit="false" gc_lag="0"
+ retransmit_timeout="300,600,1200,2400,4800"
+ discard_delivered_msgs="true"/>
+ <UNICAST timeout="300,600,1200,2400,3600"/>
+ <pbcast.STABLE stability_delay="1000"
desired_avg_gossip="50000"
+ max_bytes="400000"/>
+ <pbcast.GMS print_local_addr="true" join_timeout="5000"
shun="false"
+ view_bundling="true"
view_ack_collection_timeout="5000"/>
+ <FRAG2 frag_size="60000"/>
+ <pbcast.STREAMING_STATE_TRANSFER use_reading_thread="true"/>
+ <!-- <pbcast.STATE_TRANSFER/> -->
+ <pbcast.FLUSH timeout="0"/>
+ </jgroupsConfig>
+ </transport>
+
+
+ <jmxStatistics enabled="false"/>
+
+ <eviction wakeUpInterval="5">
+ <defaults policyClass="org.jboss.cache.eviction.LRUPolicy"
eventQueueSize="200000"/>
+ <root>
+ <attribute name="maxNodes">5000</attribute>
+ <attribute name="timeToLive">1000</attribute>
+ </root>
+ <region name="/org/jboss/data">
+ <attribute name="timeToLive">1002</attribute>
+ </region>
+ <region name="/org/jboss/xyz"
policyClass="org.jboss.cache.eviction.MRUPolicy"
eventQueueSize="21">
+ <attribute name="maxNodes">2103</attribute>
+ <attribute name="minTimeToLive">22</attribute>
+ </region>
+ </eviction>
+
+ <!-- this should be deprecated in 3.0 and should be replaced with
CacheLoaderConfig-->
+ <loaders passivation="true" shared="true">
+ <preload>
+ <node fqn="/a/b/c"/>
+ <node fqn="/f/r/s"/>
+ </preload>
+
+ <!-- we can now have multiple cache loaders, which get chained -->
+ <loader class="org.jboss.cache.loader.JDBCCacheLoader"
async="true" fetchPersistentState="true"
+ ignoreModifications="true"
purgeOnStartup="true">
+ <properties>
+ cache.jdbc.table.name=jbosscache
+ cache.jdbc.table.create=true
+ cache.jdbc.table.drop=true
+ </properties>
+ <singletonStore enabled="true"
class="org.jboss.cache.loader.SingletonStoreCacheLoader">
+ <properties>
+ pushStateWhenCoordinator=true
+ pushStateWhenCoordinatorTimeout=20000
+ </properties>
+ </singletonStore>
+ </loader>
+ </loaders>
+
+ <!-- this is new behavior added within 3.x only. it support configuring custom
interceptors through configurations -->
+ <customInterceptors>
+ <interceptor class="com.myCompany.MyInterceptor1">
+ <properties>
+ x=y
+ i=10
+ </properties>
+ <position first="true"/>
+ </interceptor>
+ <interceptor class="com.myCompany.MyInterceptor2">
+ <position last="true"/>
+ </interceptor>
+ <interceptor class="com.myCompany.MyInterceptor3">
+ <position index="3"/>
+ </interceptor>
+ <interceptor class="com.myCompany.MyInterceptor4">
+ <position
before="org.jboss.cache.interceptors.CallInterceptor"/>
+ </interceptor>
+ <interceptor class="com.myCompany.MyInterceptor5">
+ <position
after="org.jboss.cache.interceptors.CallInterceptor"/>
+ </interceptor>
+ </customInterceptors>
+</jbosscache>