JBoss Cache SVN: r7081 - core/trunk/src/main/java/org/jboss/cache/marshall.
by jbosscache-commits@lists.jboss.org
Author: mircea.markus
Date: 2008-11-04 09:57:30 -0500 (Tue, 04 Nov 2008)
New Revision: 7081
Modified:
core/trunk/src/main/java/org/jboss/cache/marshall/CommandAwareRpcDispatcher.java
Log:
replication is always sync for optimistic async caches
Modified: core/trunk/src/main/java/org/jboss/cache/marshall/CommandAwareRpcDispatcher.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/marshall/CommandAwareRpcDispatcher.java 2008-11-04 13:09:38 UTC (rev 7080)
+++ core/trunk/src/main/java/org/jboss/cache/marshall/CommandAwareRpcDispatcher.java 2008-11-04 14:57:30 UTC (rev 7081)
@@ -88,7 +88,7 @@
Configuration c = componentRegistry.getComponent(Configuration.class);
replicationProcessor = c.getRuntimeConfig().getAsyncSerializationExecutor();
if (c.getCacheMode().isSynchronous() ||
- (replicationProcessor == null && c.getSerializationExecutorPoolSize() < 1)) // if an executor has not been injected and the pool size is set
+ (replicationProcessor == null && c.getSerializationExecutorPoolSize() < 1) || requireSyncMarshalling(c)) // if an executor has not been injected and the pool size is set
{
// in-process thread. Not async.
replicationProcessor = new WithinThreadExecutor();
@@ -113,6 +113,27 @@
}
}
+ /**
+ * Serial(sync) marshalling should be enabled for async optimistic caches. That is because optimistic async is a 2PC,
+ * which might cause the Commit command to be send before the Prepare command, so replication will fail. This is not
+ * the same for async <b>pessimistic/mvcc</b> replication, as this uses a 1PC.
+ */
+ private boolean requireSyncMarshalling(Configuration c)
+ {
+ boolean enforceSerialMarshalling =
+ c.getNodeLockingScheme().equals(Configuration.NodeLockingScheme.OPTIMISTIC) && !c.getCacheMode().isInvalidation();
+
+ if (enforceSerialMarshalling)
+ {
+ if (c.getSerializationExecutorPoolSize() > 1 && log.isWarnEnabled())
+ {
+ log.warn("Async optimistic caches do not support serialization pools.");
+ }
+ if (trace) log.trace("Disbaling serial marshalling for opt async cache");
+ }
+ return enforceSerialMarshalling;
+ }
+
@Override
public void stop()
{
17 years, 1 month
JBoss Cache SVN: r7080 - demos/core-demo-gui/tags/1.2.BETA1.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-11-04 08:09:38 -0500 (Tue, 04 Nov 2008)
New Revision: 7080
Modified:
demos/core-demo-gui/tags/1.2.BETA1/pom.xml
Log:
Modified: demos/core-demo-gui/tags/1.2.BETA1/pom.xml
===================================================================
--- demos/core-demo-gui/tags/1.2.BETA1/pom.xml 2008-11-04 13:09:00 UTC (rev 7079)
+++ demos/core-demo-gui/tags/1.2.BETA1/pom.xml 2008-11-04 13:09:38 UTC (rev 7080)
@@ -10,7 +10,7 @@
</parent>
<groupId>org.jboss.cache</groupId>
<artifactId>jbosscache-demo</artifactId>
- <version>1.2-SNAPSHOT</version>
+ <version>1.2.BETA1</version>
<name>JBoss Cache - Core Edition GUI Demo</name>
<description>JBoss Cache - Core Edition GUI Demo</description>
<packaging>jar</packaging>
17 years, 1 month
JBoss Cache SVN: r7079 - demos/core-demo-gui/tags.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-11-04 08:09:00 -0500 (Tue, 04 Nov 2008)
New Revision: 7079
Added:
demos/core-demo-gui/tags/1.2.BETA1/
Log:
Copied: demos/core-demo-gui/tags/1.2.BETA1 (from rev 7078, demos/core-demo-gui/trunk)
17 years, 1 month
JBoss Cache SVN: r7078 - in demos/core-demo-gui/trunk: src/main/resources and 1 other directory.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-11-04 08:08:12 -0500 (Tue, 04 Nov 2008)
New Revision: 7078
Modified:
demos/core-demo-gui/trunk/pom.xml
demos/core-demo-gui/trunk/src/main/resources/demo-cache-config.xml
Log:
Updated to JBC3
Modified: demos/core-demo-gui/trunk/pom.xml
===================================================================
--- demos/core-demo-gui/trunk/pom.xml 2008-11-04 12:35:59 UTC (rev 7077)
+++ demos/core-demo-gui/trunk/pom.xml 2008-11-04 13:08:12 UTC (rev 7078)
@@ -10,7 +10,7 @@
</parent>
<groupId>org.jboss.cache</groupId>
<artifactId>jbosscache-demo</artifactId>
- <version>1.1-SNAPSHOT</version>
+ <version>1.2-SNAPSHOT</version>
<name>JBoss Cache - Core Edition GUI Demo</name>
<description>JBoss Cache - Core Edition GUI Demo</description>
<packaging>jar</packaging>
@@ -18,7 +18,7 @@
<dependency>
<groupId>org.jboss.cache</groupId>
<artifactId>jbosscache-core</artifactId>
- <version>2.2.0.GA</version>
+ <version>3.0.0.CR3</version>
</dependency>
<dependency>
<groupId>jgoodies</groupId>
Modified: demos/core-demo-gui/trunk/src/main/resources/demo-cache-config.xml
===================================================================
--- demos/core-demo-gui/trunk/src/main/resources/demo-cache-config.xml 2008-11-04 12:35:59 UTC (rev 7077)
+++ demos/core-demo-gui/trunk/src/main/resources/demo-cache-config.xml 2008-11-04 13:08:12 UTC (rev 7078)
@@ -1,211 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
+<jbosscache xmlns="urn:jboss:jbosscache-core:config:3.0">
-<!-- ===================================================================== -->
-<!-- -->
-<!-- Sample TreeCache Service Configuration -->
-<!-- -->
-<!-- ===================================================================== -->
+ <transaction transactionManagerLookupClass="org.jboss.cache.transaction.GenericTransactionManagerLookup"/>
-<server>
+ <clustering mode="replication" clusterName="JBossCache-Cluster">
- <!-- ==================================================================== -->
- <!-- Defines TreeCache configuration -->
- <!-- ==================================================================== -->
-
- <mbean code="org.jboss.cache.jmx.CacheJmxWrapper"
- name="jboss.cache:service=TreeCache">
-
- <depends>jboss:service=Naming</depends>
- <depends>jboss:service=TransactionManager</depends>
-
- <!--
- Configure the TransactionManager
- -->
- <attribute name="TransactionManagerLookupClass">org.jboss.cache.transaction.GenericTransactionManagerLookup
- </attribute>
-
- <!--
- Isolation level : SERIALIZABLE
- REPEATABLE_READ (default)
- READ_COMMITTED
- READ_UNCOMMITTED
- NONE
- -->
- <attribute name="IsolationLevel">REPEATABLE_READ</attribute>
-
- <!--
- Valid modes are LOCAL
- REPL_ASYNC
- REPL_SYNC
- INVALIDATION_ASYNC
- INVALIDATION_SYNC
- -->
- <attribute name="CacheMode">REPL_SYNC</attribute>
-
- <!--
- Just used for async repl: use a replication queue
- -->
- <attribute name="UseReplQueue">false</attribute>
-
- <!--
- Replication interval for replication queue (in ms)
- -->
- <attribute name="ReplQueueInterval">0</attribute>
-
- <!--
- Max number of elements which trigger replication
- -->
- <attribute name="ReplQueueMaxElements">0</attribute>
-
- <!-- Name of cluster. Needs to be the same for all TreeCache nodes in a
- cluster in order to find each other.
- -->
- <attribute name="ClusterName">JBossCache-Cluster</attribute>
-
- <!--Uncomment next three statements to enable JGroups multiplexer.
-This configuration is dependent on the JGroups multiplexer being
-registered in an MBean server such as JBossAS. -->
- <!--
- <depends>jgroups.mux:name=Multiplexer</depends>
- <attribute name="MultiplexerService">jgroups.mux:name=Multiplexer</attribute>
- <attribute name="MultiplexerStack">fc-fast-minimalthreads</attribute>
- -->
-
- <!-- JGroups protocol stack properties.
- ClusterConfig isn't used if the multiplexer is enabled and successfully initialized.
- -->
- <attribute name="ClusterConfig">
- <config>
- <UDP mcast_addr="228.10.10.10"
- mcast_port="45588"
- tos="8"
- ucast_recv_buf_size="20000000"
- ucast_send_buf_size="640000"
- mcast_recv_buf_size="25000000"
- mcast_send_buf_size="640000"
- loopback="false"
- discard_incompatible_packets="true"
- max_bundle_size="64000"
- max_bundle_timeout="30"
- use_incoming_packet_handler="true"
- ip_ttl="2"
- enable_bundling="false"
- enable_diagnostics="true"
-
- use_concurrent_stack="true"
-
- thread_naming_pattern="pl"
-
- thread_pool.enabled="true"
- thread_pool.min_threads="1"
- thread_pool.max_threads="25"
- thread_pool.keep_alive_time="30000"
- thread_pool.queue_enabled="true"
- thread_pool.queue_max_size="10"
- thread_pool.rejection_policy="Run"
-
- oob_thread_pool.enabled="true"
- oob_thread_pool.min_threads="1"
- oob_thread_pool.max_threads="4"
- oob_thread_pool.keep_alive_time="10000"
- oob_thread_pool.queue_enabled="true"
- oob_thread_pool.queue_max_size="10"
- oob_thread_pool.rejection_policy="Run"/>
-
- <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/>
- <!-- <pbcast.STATE_TRANSFER/> -->
- <pbcast.FLUSH timeout="0"/>
- </config>
- </attribute>
-
-
- <!--
- Whether or not to fetch state on joining a cluster
- NOTE this used to be called FetchStateOnStartup and has been renamed to be more descriptive.
- -->
- <attribute name="FetchInMemoryState">true</attribute>
-
- <!--
- The max amount of time (in milliseconds) we wait until the
- state (ie. the contents of the cache) are retrieved from
- existing members in a clustered environment
- -->
- <attribute name="StateRetrievalTimeout">15000</attribute>
-
- <!--
- Number of milliseconds to wait until all responses for a
- synchronous call have been received.
- -->
- <attribute name="SyncReplTimeout">15000</attribute>
-
- <!-- Max number of milliseconds to wait for a lock acquisition -->
- <attribute name="LockAcquisitionTimeout">10000</attribute>
-
- <!-- Buddy Replication config -->
- <attribute name="BuddyReplicationConfig">
- <config>
- <buddyReplicationEnabled>true</buddyReplicationEnabled>
- <!-- these are the default values anyway -->
- <buddyLocatorClass>org.jboss.cache.buddyreplication.NextMemberBuddyLocator</buddyLocatorClass>
- <!-- numBuddies is the number of backup nodes each node maintains. ignoreColocatedBuddies means that
- each node will *try* to select a buddy on a different physical host. If not able to do so though,
- it will fall back to colocated nodes. -->
- <buddyLocatorProperties>
+ <buddy enabled="true" poolName="myBuddyPoolReplicationGroup" communicationTimeout="2000">
+ <dataGravitation auto="false" removeOnFind="true" searchBackupTrees="true"/>
+ <locator class="org.jboss.cache.buddyreplication.NextMemberBuddyLocator">
+ <properties>
numBuddies = 1
ignoreColocatedBuddies = true
- </buddyLocatorProperties>
+ </properties>
+ </locator>
+ </buddy>
+ <!-- One of the default JGroups configurations bundled with jgroups.jar -->
+ <jgroupsConfig configFile="udp.xml"/>
+ </clustering>
- <!-- A way to specify a preferred replication group. If specified, we try and pick a buddy why shares
- the same pool name (falling back to other buddies if not available). This allows the sysdmin to hint at
- backup buddies are picked, so for example, nodes may be hinted topick buddies on a different physical rack
- or power supply for added fault tolerance. -->
- <buddyPoolName>myBuddyPoolReplicationGroup</buddyPoolName>
-
- <!-- communication timeout for inter-buddy group organisation messages (such as assigning to and removing
- from groups -->
- <buddyCommunicationTimeout>2000</buddyCommunicationTimeout>
-
- <!-- the following three elements, all relating to data gravitation, default to false -->
- <!-- Should data gravitation be attempted whenever there is a cache miss on finding a node?
- If false, data will only be gravitated if an Option is set enabling it -->
- <autoDataGravitation>false</autoDataGravitation>
-
- <!-- removes data on remote caches' trees and backup subtrees when gravitated to a new data owner -->
- <dataGravitationRemoveOnFind>true</dataGravitationRemoveOnFind>
-
- <!-- search backup subtrees as well for data when gravitating. Results in backup nodes being able to
- answer data gravitation requests. -->
- <dataGravitationSearchBackupTrees>true</dataGravitationSearchBackupTrees>
- </config>
- </attribute>
-
- <!--
- Indicate whether to use region based marshalling or not. Set this to true if you are running under a scoped
- class loader, e.g., inside an application server. Default is "false".
- -->
- <attribute name="UseRegionBasedMarshalling">false</attribute>
- </mbean>
-
-
- <!-- Uncomment to get a graphical view of the TreeCache MBean above -->
- <!-- <mbean code="org.jboss.cache.TreeCacheView" name="jboss.cache:service=TreeCacheView">-->
- <!-- <depends>jboss.cache:service=TreeCache</depends>-->
- <!-- <attribute name="CacheService">jboss.cache:service=TreeCache</attribute>-->
- <!-- </mbean>-->
-
-
-</server>
+</jbosscache>
17 years, 1 month
JBoss Cache SVN: r7077 - core/trunk/src/main/docbook/userguide/en/modules.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-11-04 07:35:59 -0500 (Tue, 04 Nov 2008)
New Revision: 7077
Modified:
core/trunk/src/main/docbook/userguide/en/modules/basic_api.xml
Log:
Explained node structure
Modified: core/trunk/src/main/docbook/userguide/en/modules/basic_api.xml
===================================================================
--- core/trunk/src/main/docbook/userguide/en/modules/basic_api.xml 2008-11-04 11:38:36 UTC (rev 7076)
+++ core/trunk/src/main/docbook/userguide/en/modules/basic_api.xml 2008-11-04 12:35:59 UTC (rev 7077)
@@ -152,6 +152,16 @@
assertFalse(cache.getRootNode().hasChild(peterGriffinFqn));
]]></programlisting>
+ <section>
+ <title>Organizing Your Data and Using the Node Structure</title>
+ <para>
+ A Node should be viewed as a named logical grouping of data. A node should be used to contain data for a
+ single data record, for example information about a particular person or account. It should be kept in
+ mind that all aspects of the cache - locking, cache loading, replication and eviction - happen on a per-node
+ basis. As such, anything grouped together by being stored in a single node will be treated as a single
+ atomic unit.
+ </para>
+ </section>
</section>
<section id="basic_api.fqn">
17 years, 1 month
JBoss Cache SVN: r7076 - core/trunk/src/test/java/org/jboss/cache/profiling.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-11-04 06:38:36 -0500 (Tue, 04 Nov 2008)
New Revision: 7076
Modified:
core/trunk/src/test/java/org/jboss/cache/profiling/MemConsumptionTest.java
Log:
Modified: core/trunk/src/test/java/org/jboss/cache/profiling/MemConsumptionTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/profiling/MemConsumptionTest.java 2008-11-04 10:43:18 UTC (rev 7075)
+++ core/trunk/src/test/java/org/jboss/cache/profiling/MemConsumptionTest.java 2008-11-04 11:38:36 UTC (rev 7076)
@@ -38,8 +38,8 @@
{
// adjust the next 4 values
int numNodes = 1000000;
- int payloadSize = 20; // bytes
- int keySize = 10; // bytes
+ int payloadSize = 20; // characters
+ int keySize = 10; // characters
PayloadType payloadType = PayloadType.STRINGS;
enum PayloadType {STRINGS, BYTE_ARRAYS}
17 years, 1 month
JBoss Cache SVN: r7075 - in core/trunk/src: main/java/org/jboss/cache/config/parsing/element and 4 other directories.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-11-04 05:43:18 -0500 (Tue, 04 Nov 2008)
New Revision: 7075
Modified:
core/trunk/src/main/java/org/jboss/cache/buddyreplication/BuddyFqnTransformer.java
core/trunk/src/main/java/org/jboss/cache/config/parsing/element/EvictionElementParser.java
core/trunk/src/main/java/org/jboss/cache/eviction/RemoveOnEvictActionPolicy.java
core/trunk/src/main/resources/config-samples/eviction-enabled.xml
core/trunk/src/main/resources/schema/jbosscache-config-3.0.xsd
core/trunk/src/test/java/org/jboss/cache/config/parsing/EvictionElementParserTest.java
core/trunk/src/test/java/org/jboss/cache/config/parsing/XmlConfigurationParserTest.java
Log:
JBCACHE-1435 Remove on evict policy attempts to prune buddy backup tree
JBCACHE-1436 JBoss configuration schema requires <property> for <region> eviction config
Modified: core/trunk/src/main/java/org/jboss/cache/buddyreplication/BuddyFqnTransformer.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/buddyreplication/BuddyFqnTransformer.java 2008-11-04 08:23:33 UTC (rev 7074)
+++ core/trunk/src/main/java/org/jboss/cache/buddyreplication/BuddyFqnTransformer.java 2008-11-04 10:43:18 UTC (rev 7075)
@@ -1,24 +1,24 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2000 - 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2000 - 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.jboss.cache.buddyreplication;
import org.jboss.cache.CacheException;
@@ -92,7 +92,7 @@
return Fqn.fromList(elements, true);
}
- public boolean isBackupFqn(Fqn name)
+ public static boolean isBackupFqn(Fqn name)
{
return name != null && name.hasElement(BuddyManager.BUDDY_BACKUP_SUBTREE);
}
Modified: core/trunk/src/main/java/org/jboss/cache/config/parsing/element/EvictionElementParser.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/config/parsing/element/EvictionElementParser.java 2008-11-04 08:23:33 UTC (rev 7074)
+++ core/trunk/src/main/java/org/jboss/cache/config/parsing/element/EvictionElementParser.java 2008-11-04 10:43:18 UTC (rev 7075)
@@ -187,7 +187,7 @@
public static void parseEvictionPolicyConfig(Element element, EvictionAlgorithmConfig target)
{
- target.reset();
+// target.reset();
Properties p = XmlConfigHelper.extractProperties(element);
XmlConfigHelper.setValues(target, p, false, true);
}
Modified: core/trunk/src/main/java/org/jboss/cache/eviction/RemoveOnEvictActionPolicy.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/eviction/RemoveOnEvictActionPolicy.java 2008-11-04 08:23:33 UTC (rev 7074)
+++ core/trunk/src/main/java/org/jboss/cache/eviction/RemoveOnEvictActionPolicy.java 2008-11-04 10:43:18 UTC (rev 7075)
@@ -25,6 +25,7 @@
import org.apache.commons.logging.LogFactory;
import org.jboss.cache.Cache;
import org.jboss.cache.Fqn;
+import org.jboss.cache.buddyreplication.BuddyFqnTransformer;
/**
* An eviction action policy that calls {@link org.jboss.cache.Cache#removeNode(org.jboss.cache.Fqn)} to evict a node.
@@ -35,7 +36,7 @@
public class RemoveOnEvictActionPolicy implements EvictionActionPolicy
{
Cache<?, ?> cache;
- private static final Log log = LogFactory.getLog(DefaultEvictionActionPolicy.class);
+ private static final Log log = LogFactory.getLog(RemoveOnEvictActionPolicy.class);
public void setCache(Cache<?, ?> cache)
{
@@ -44,6 +45,11 @@
public boolean evict(Fqn fqn)
{
+ // eviction code may also try and evict the fqn of a buddy. If the Fqn is that of a buddy we need to ensure that
+ // this call is ignored since a proper remove will happen on the data owner when the data is evicted, and that
+ // remove will propagate here.
+ if (BuddyFqnTransformer.isBackupFqn(fqn)) return true;
+
try
{
return cache.removeNode(fqn);
Modified: core/trunk/src/main/resources/config-samples/eviction-enabled.xml
===================================================================
--- core/trunk/src/main/resources/config-samples/eviction-enabled.xml 2008-11-04 08:23:33 UTC (rev 7074)
+++ core/trunk/src/main/resources/config-samples/eviction-enabled.xml 2008-11-04 10:43:18 UTC (rev 7075)
@@ -36,5 +36,6 @@
<property name="timeToLive" value="8000" />
<property name="maxAge" value="10000" />
</region>
+ <region name="/org/jboss/data1/inherit" eventQueueSize="100" />
</eviction>
</jbosscache>
Modified: core/trunk/src/main/resources/schema/jbosscache-config-3.0.xsd
===================================================================
--- core/trunk/src/main/resources/schema/jbosscache-config-3.0.xsd 2008-11-04 08:23:33 UTC (rev 7074)
+++ core/trunk/src/main/resources/schema/jbosscache-config-3.0.xsd 2008-11-04 10:43:18 UTC (rev 7075)
@@ -177,7 +177,7 @@
<xs:complexType name="evictionRegionType">
<xs:sequence>
- <xs:element name="property" maxOccurs="unbounded" type="tns:propertyType"/>
+ <xs:element name="property" minOccurs="0" maxOccurs="unbounded" type="tns:propertyType"/>
</xs:sequence>
<xs:attribute name="name" type="xs:string"/>
<xs:attribute name="algorithmClass" type="xs:string"/>
Modified: core/trunk/src/test/java/org/jboss/cache/config/parsing/EvictionElementParserTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/config/parsing/EvictionElementParserTest.java 2008-11-04 08:23:33 UTC (rev 7074)
+++ core/trunk/src/test/java/org/jboss/cache/config/parsing/EvictionElementParserTest.java 2008-11-04 10:43:18 UTC (rev 7075)
@@ -7,6 +7,7 @@
import org.jboss.cache.config.MissingPolicyException;
import org.jboss.cache.config.parsing.element.EvictionElementParser;
import org.jboss.cache.eviction.DefaultEvictionActionPolicy;
+import org.jboss.cache.eviction.FIFOAlgorithmConfig;
import org.jboss.cache.eviction.LFUAlgorithmConfig;
import org.jboss.cache.eviction.LRUAlgorithmConfig;
import org.jboss.cache.eviction.MRUAlgorithmConfig;
@@ -48,6 +49,36 @@
assert evictionConfig.getDefaultEvictionRegionConfig().getEvictionActionPolicyClassName().equals(DefaultEvictionActionPolicy.class.getName());
}
+ public void testRegionWithNoProperties()
+ {
+ String xml =
+ " <eviction wakeUpInterval=\"5\">\n" +
+ " <default algorithmClass=\"org.jboss.cache.eviction.MRUAlgorithm\">\n" +
+ " <property name=\"maxNodes\" value=\"10\"></property>\n" +
+ " <property name=\"minTimeToLive\" value=\"10\"></property>\n" +
+ " </default>\n" +
+ " <region name=\"/org/jboss/abc\" eventQueueSize=\"21\">\n" +
+ " </region>\n" +
+ " <region name=\"/org/jboss/xyz\" algorithmClass=\"org.jboss.cache.eviction.FIFOAlgorithm\">\n" +
+ " </region>\n" +
+ " </eviction>";
+ EvictionConfig evictionConfig = getEvictionConfig(xml, false);
+ assert evictionConfig.getDefaultEvictionRegionConfig().getEventQueueSize() == EvictionConfig.EVENT_QUEUE_SIZE_DEFAULT;
+ assert evictionConfig.getDefaultEvictionRegionConfig().getEvictionActionPolicyClassName().equals(DefaultEvictionActionPolicy.class.getName());
+ EvictionRegionConfig abc = evictionConfig.getEvictionRegionConfig("/org/jboss/abc");
+ EvictionRegionConfig xyz = evictionConfig.getEvictionRegionConfig("/org/jboss/xyz");
+
+ assert abc.getEventQueueSize() == 21;
+ assert abc.getEvictionAlgorithmConfig() instanceof MRUAlgorithmConfig;
+ assert ((MRUAlgorithmConfig) abc.getEvictionAlgorithmConfig()).getMaxNodes() == 10;
+ assert ((MRUAlgorithmConfig) abc.getEvictionAlgorithmConfig()).getMinTimeToLive() == 10;
+
+ assert xyz.getEventQueueSize() == EvictionConfig.EVENT_QUEUE_SIZE_DEFAULT;
+ assert xyz.getEvictionAlgorithmConfig() instanceof FIFOAlgorithmConfig;
+ assert ((FIFOAlgorithmConfig) xyz.getEvictionAlgorithmConfig()).getMaxNodes() == -1;
+ assert ((FIFOAlgorithmConfig) xyz.getEvictionAlgorithmConfig()).getMinTimeToLive() == -1;
+ }
+
/**
* test unnecessary propertys
*/
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-11-04 08:23:33 UTC (rev 7074)
+++ core/trunk/src/test/java/org/jboss/cache/config/parsing/XmlConfigurationParserTest.java 2008-11-04 10:43:18 UTC (rev 7075)
@@ -232,7 +232,7 @@
LRUAlgorithmConfig secondConfiguration = (LRUAlgorithmConfig) second.getEvictionAlgorithmConfig();
assert secondConfiguration.getMaxAge() == -1;
assert secondConfiguration.getTimeToLive() == 1002;
- assert secondConfiguration.getMaxNodes() == -1;
+ assert secondConfiguration.getMaxNodes() == 5000;
EvictionRegionConfig third = regionConfigs.get(1);
MRUAlgorithmConfig thirdConfiguration = (MRUAlgorithmConfig) third.getEvictionAlgorithmConfig();
17 years, 1 month
JBoss Cache SVN: r7074 - in core/trunk/src/test/java/org/jboss/cache: loader and 2 other directories.
by jbosscache-commits@lists.jboss.org
Author: dpospisi(a)redhat.com
Date: 2008-11-04 03:23:33 -0500 (Tue, 04 Nov 2008)
New Revision: 7074
Modified:
core/trunk/src/test/java/org/jboss/cache/UnitTestCacheFactory.java
core/trunk/src/test/java/org/jboss/cache/loader/JDBCCacheLoaderStateTransferTest.java
core/trunk/src/test/java/org/jboss/cache/loader/TcpCacheServerTest.java
core/trunk/src/test/java/org/jboss/cache/marshall/SimpleArrayReplTest.java
core/trunk/src/test/java/org/jboss/cache/transaction/RemoveOnTxTest.java
Log:
More fixes for parallel testing. (DefaultCacheFactory -> UnitTestCacheFactory)
Modified: core/trunk/src/test/java/org/jboss/cache/UnitTestCacheFactory.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/UnitTestCacheFactory.java 2008-11-04 07:35:22 UTC (rev 7073)
+++ core/trunk/src/test/java/org/jboss/cache/UnitTestCacheFactory.java 2008-11-04 08:23:33 UTC (rev 7074)
@@ -154,6 +154,7 @@
break;
default:
log.info("Unknown cache mode!");
+ System.exit(0);
}
Cache<K, V> cache = new DefaultCacheFactory<K, V>().createCache(configuration, start);
Modified: core/trunk/src/test/java/org/jboss/cache/loader/JDBCCacheLoaderStateTransferTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/loader/JDBCCacheLoaderStateTransferTest.java 2008-11-04 07:35:22 UTC (rev 7073)
+++ core/trunk/src/test/java/org/jboss/cache/loader/JDBCCacheLoaderStateTransferTest.java 2008-11-04 08:23:33 UTC (rev 7074)
@@ -22,8 +22,8 @@
package org.jboss.cache.loader;
import org.jboss.cache.CacheSPI;
-import org.jboss.cache.DefaultCacheFactory;
import org.jboss.cache.Fqn;
+import org.jboss.cache.UnitTestCacheFactory;
import org.jboss.cache.config.CacheLoaderConfig;
import org.jboss.cache.config.Configuration;
import org.jboss.cache.config.Configuration.CacheMode;
@@ -79,11 +79,11 @@
public void testSimpleStateTransfer() throws Exception
{
- first = (CacheSPI) new DefaultCacheFactory().createCache(getConfiguration(0));
+ first = (CacheSPI) new UnitTestCacheFactory().createCache(getConfiguration(0));
first.put("/a/b/c", "key", "value");
first.put("/a/b/d", "key", "value");
first.put("/a/b/e", "key", "value");
- second = (CacheSPI) new DefaultCacheFactory().createCache(getConfiguration(2));
+ second = (CacheSPI) new UnitTestCacheFactory().createCache(getConfiguration(2));
assert second.get("/a/b/c","key").equals("value");
assert second.get("/a/b/d","key").equals("value");
assert second.get("/a/b/e","key").equals("value");
@@ -97,7 +97,7 @@
{
long startTime = System.currentTimeMillis();
- first = (CacheSPI) new DefaultCacheFactory().createCache(getConfiguration(0));
+ first = (CacheSPI) new UnitTestCacheFactory().createCache(getConfiguration(0));
long cacheStartTime = System.currentTimeMillis() - startTime;
System.out.println("cacheStartTime = " + cacheStartTime);
for (int i = 0; i < 5012; i++)
@@ -106,7 +106,7 @@
if (i%1000 == 0) System.out.println(i + " operations executed so far");
}
startTime = System.currentTimeMillis();
- second = (CacheSPI) new DefaultCacheFactory().createCache(getConfiguration(2));
+ second = (CacheSPI) new UnitTestCacheFactory().createCache(getConfiguration(2));
long stateTranferTime = System.currentTimeMillis() - startTime - cacheStartTime;
for (int i = 0; i < 5012; i+=100)
Modified: core/trunk/src/test/java/org/jboss/cache/loader/TcpCacheServerTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/loader/TcpCacheServerTest.java 2008-11-04 07:35:22 UTC (rev 7073)
+++ core/trunk/src/test/java/org/jboss/cache/loader/TcpCacheServerTest.java 2008-11-04 08:23:33 UTC (rev 7074)
@@ -2,7 +2,6 @@
import org.jboss.cache.Cache;
import org.jboss.cache.CacheSPI;
-import org.jboss.cache.DefaultCacheFactory;
import org.jboss.cache.Fqn;
import org.jboss.cache.config.CacheLoaderConfig;
import org.jboss.cache.config.Configuration;
@@ -16,6 +15,7 @@
import org.testng.annotations.Test;
import java.net.UnknownHostException;
+import org.jboss.cache.UnitTestCacheFactory;
/**
* Tests various ways of setting up the TcpCacheServer
@@ -53,7 +53,7 @@
c.setCacheMode(Configuration.CacheMode.LOCAL);
c.setTransactionManagerLookupClass("org.jboss.cache.transaction.DummyTransactionManagerLookup");
c.setCacheLoaderConfig(getCacheLoaderConfig());
- cache = (CacheSPI<Object, Object>) new DefaultCacheFactory<Object, Object>().createCache(c);
+ cache = (CacheSPI<Object, Object>) new UnitTestCacheFactory<Object, Object>().createCache(c);
cache.start();
loader = cache.getCacheLoaderManager().getCacheLoader();
@@ -121,7 +121,7 @@
{
createTcpCacheServer();
Configuration conf = UnitTestCacheConfigurationFactory.createConfiguration(Configuration.CacheMode.LOCAL, true);
- CacheSPI cacheSPI = (CacheSPI) new DefaultCacheFactory<Object, Object>().createCache(conf);
+ CacheSPI cacheSPI = (CacheSPI) new UnitTestCacheFactory<Object, Object>().createCache(conf);
cache_server.setCache(cacheSPI);
startTcpCacheServer();
createCacheAndLoader();
@@ -133,7 +133,7 @@
{
createTcpCacheServer();
Configuration conf = UnitTestCacheConfigurationFactory.createConfiguration(Configuration.CacheMode.LOCAL, true);
- CacheSPI cacheSPI = (CacheSPI) new DefaultCacheFactory<Object, Object>().createCache(conf);
+ CacheSPI cacheSPI = (CacheSPI) new UnitTestCacheFactory<Object, Object>().createCache(conf);
cache_server.setCache(cacheSPI);
startTcpCacheServer();
createCacheAndLoader();
@@ -145,7 +145,7 @@
{
createTcpCacheServer();
Configuration conf = UnitTestCacheConfigurationFactory.createConfiguration(Configuration.CacheMode.LOCAL, true);
- CacheSPI cacheSPI = (CacheSPI) new DefaultCacheFactory<Object, Object>().createCache(conf);
+ CacheSPI cacheSPI = (CacheSPI) new UnitTestCacheFactory<Object, Object>().createCache(conf);
CacheJmxWrapper wrapper = new CacheJmxWrapper<Object, Object>(cacheSPI);
wrapper.start();
cache_server.setCacheJmxWrapper(wrapper);
Modified: core/trunk/src/test/java/org/jboss/cache/marshall/SimpleArrayReplTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/marshall/SimpleArrayReplTest.java 2008-11-04 07:35:22 UTC (rev 7073)
+++ core/trunk/src/test/java/org/jboss/cache/marshall/SimpleArrayReplTest.java 2008-11-04 08:23:33 UTC (rev 7074)
@@ -1,7 +1,6 @@
package org.jboss.cache.marshall;
import org.jboss.cache.Cache;
-import org.jboss.cache.DefaultCacheFactory;
import org.jboss.cache.Fqn;
import org.jboss.cache.config.Configuration;
import org.jboss.cache.config.Configuration.CacheMode;
@@ -11,6 +10,7 @@
import java.util.Arrays;
import java.util.Random;
+import org.jboss.cache.UnitTestCacheFactory;
@Test(groups = "functional")
public class SimpleArrayReplTest
@@ -27,8 +27,8 @@
Configuration c = new Configuration();
c.setCacheMode(CacheMode.REPL_SYNC);
c.setNodeLockingScheme(NodeLockingScheme.MVCC);
- cache1 = new DefaultCacheFactory<String, byte[]>().createCache(c.clone());
- cache2 = new DefaultCacheFactory<String, byte[]>().createCache(c.clone());
+ cache1 = new UnitTestCacheFactory<String, byte[]>().createCache(c.clone());
+ cache2 = new UnitTestCacheFactory<String, byte[]>().createCache(c.clone());
TestingUtil.blockUntilViewsReceived(60000, cache1, cache2);
Modified: core/trunk/src/test/java/org/jboss/cache/transaction/RemoveOnTxTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/transaction/RemoveOnTxTest.java 2008-11-04 07:35:22 UTC (rev 7073)
+++ core/trunk/src/test/java/org/jboss/cache/transaction/RemoveOnTxTest.java 2008-11-04 08:23:33 UTC (rev 7074)
@@ -51,7 +51,7 @@
configuration.setCacheMode(Configuration.CacheMode.LOCAL);
configuration.setTransactionManagerLookupClass("org.jboss.cache.transaction.GenericTransactionManagerLookup");
configuration.setNodeLockingScheme(Configuration.NodeLockingScheme.PESSIMISTIC);
- cache = (CacheSPI) new DefaultCacheFactory().createCache(configuration);
+ cache = (CacheSPI) new UnitTestCacheFactory().createCache(configuration);
dataContainer = (DataContainerImpl) cache.getComponentRegistry().getComponent(DataContainer.class);
}
17 years, 1 month
JBoss Cache SVN: r7073 - core/trunk/src/test/java/org/jboss/cache/loader.
by jbosscache-commits@lists.jboss.org
Author: dpospisi(a)redhat.com
Date: 2008-11-04 02:35:22 -0500 (Tue, 04 Nov 2008)
New Revision: 7073
Modified:
core/trunk/src/test/java/org/jboss/cache/loader/AdjListJDBCCacheLoaderCompatibilityTest.java
Log:
Fix in AdjListJDBCCacheLoaderCompatibilityTest for parallel execution. (append threadId to jdbc table primary key)
Modified: core/trunk/src/test/java/org/jboss/cache/loader/AdjListJDBCCacheLoaderCompatibilityTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/loader/AdjListJDBCCacheLoaderCompatibilityTest.java 2008-11-04 03:46:03 UTC (rev 7072)
+++ core/trunk/src/test/java/org/jboss/cache/loader/AdjListJDBCCacheLoaderCompatibilityTest.java 2008-11-04 07:35:22 UTC (rev 7073)
@@ -226,7 +226,9 @@
Properties prop = getProperties();
String tablePrefix = prop.getProperty("cache.jdbc.table.name", "jbosscache");
+ String tablePkPrefix = prop.getProperty("cache.jdbc.table.primarykey", "jbosscache_pk");
prop.setProperty("cache.jdbc.table.name", tablePrefix + TestingUtil.getThreadId());
+ prop.setProperty("cache.jdbc.table.primarykey", tablePkPrefix + TestingUtil.getThreadId());
String props = "cache.jdbc.driver =" + prop.getProperty("cache.jdbc.driver") + "\n" +
"cache.jdbc.url=" + prop.getProperty("cache.jdbc.url") + "\n" +
@@ -234,7 +236,8 @@
"cache.jdbc.password=" + prop.getProperty("cache.jdbc.password") + "\n" +
"cache.jdbc.node.type=" + prop.getProperty("cache.jdbc.node.type") + "\n" +
"cache.jdbc.sql-concat=" + prop.getProperty("cache.jdbc.sql-concat") + "\n" +
- "cache.jdbc.table.name=" + prop.getProperty("cache.jdbc.table.name");
+ "cache.jdbc.table.name=" + prop.getProperty("cache.jdbc.table.name") + "\n" +
+ "cache.jdbc.table.primarykey=" + prop.getProperty("cache.jdbc.table.primarykey");
CacheLoaderConfig.IndividualCacheLoaderConfig base = getSingleCacheLoaderConfig("", "org.jboss.cache.loader.JDBCCacheLoader", props).getFirstCacheLoaderConfig();
17 years, 1 month
JBoss Cache SVN: r7072 - core/trunk/src/main/java/org/jboss/cache/loader.
by jbosscache-commits@lists.jboss.org
Author: genman
Date: 2008-11-03 22:46:03 -0500 (Mon, 03 Nov 2008)
New Revision: 7072
Modified:
core/trunk/src/main/java/org/jboss/cache/loader/AbstractCacheLoader.java
Log:
JDBM cache loader can use Object children names, remove unnecessary cast
Modified: core/trunk/src/main/java/org/jboss/cache/loader/AbstractCacheLoader.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/loader/AbstractCacheLoader.java 2008-11-04 03:34:06 UTC (rev 7071)
+++ core/trunk/src/main/java/org/jboss/cache/loader/AbstractCacheLoader.java 2008-11-04 03:46:03 UTC (rev 7072)
@@ -256,7 +256,7 @@
{
Map<Object, Object> attrs;
Set<?> childrenNames;
- String childName;
+ Object childName;
Fqn tmpFqn;
NodeData nd;
@@ -281,7 +281,7 @@
}
for (Object childrenName : childrenNames)
{
- childName = (String) childrenName;
+ childName = childrenName;
tmpFqn = Fqn.fromRelativeElements(fqn, childName);
if (!cache.getInternalFqns().contains(tmpFqn)) getNodeDataList(tmpFqn, list);
}
17 years, 1 month