JBoss Cache SVN: r6527 - core/trunk/src/test/resources/configs.
by jbosscache-commits@lists.jboss.org
Author: mircea.markus
Date: 2008-08-06 05:23:41 -0400 (Wed, 06 Aug 2008)
New Revision: 6527
Added:
core/trunk/src/test/resources/configs/mvcc-repl-sync-br.xml
Log:
added ut for MVCC buddy failure
Added: core/trunk/src/test/resources/configs/mvcc-repl-sync-br.xml
===================================================================
--- core/trunk/src/test/resources/configs/mvcc-repl-sync-br.xml (rev 0)
+++ core/trunk/src/test/resources/configs/mvcc-repl-sync-br.xml 2008-08-06 09:23:41 UTC (rev 6527)
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<jbosscache>
+ <locking isolationLevel="REPEATABLE_READ" lockAcquisitionTimeout="10000" nodeLockingScheme="mvcc"/>
+ <transaction transactionManagerLookupClass="org.jboss.cache.transaction.GenericTransactionManagerLookup"/>
+ <stateRetrieval timeout="20000" fetchInMemoryState="false"/>
+ <transport clusterName="JBossCache-Cluster">
+ <jgroupsConfig>
+ <TCP discard_incompatible_packets="true" enable_bundling="false" enable_diagnostics="false"
+ enable_unicast_bundling="false" loopback="false" max_bundle_size="64000" max_bundle_timeout="30"
+ oob_thread_pool.enabled="true" oob_thread_pool.keep_alive_time="10000" oob_thread_pool.max_threads="4"
+ oob_thread_pool.min_threads="2" oob_thread_pool.queue_enabled="false" oob_thread_pool.queue_max_size="10"
+ oob_thread_pool.rejection_policy="Run" recv_buf_size="20000000" thread_naming_pattern="pl"
+ thread_pool.enabled="true" thread_pool.keep_alive_time="30000" thread_pool.max_threads="4"
+ thread_pool.min_threads="1" thread_pool.queue_enabled="true" thread_pool.queue_max_size="50000"
+ thread_pool.rejection_policy="discard" use_concurrent_stack="true" use_incoming_packet_handler="true"
+ use_send_queues="false"/>
+ <MPING mcast_addr="232.1.2.3" num_initial_members="3" timeout="2000"/>
+ <MERGE2 max_interval="30000" min_interval="10000"/>
+ <FD_SOCK/>
+ <FD max_tries="5" shun="true" timeout="10000"/>
+ <VERIFY_SUSPECT timeout="1500"/>
+ <pbcast.NAKACK discard_delivered_msgs="true" gc_lag="0" retransmit_timeout="300,600,1200,2400,4800"
+ use_mcast_xmit="false"/>
+ <pbcast.STABLE desired_avg_gossip="50000" max_bytes="400000" stability_delay="1000"/>
+ <pbcast.GMS join_retry_timeout="2000" join_timeout="5000" print_local_addr="true" shun="false"
+ view_ack_collection_timeout="5000" view_bundling="true"/>
+ <FC max_credits="5000000" min_threshold="0.20"/>
+ <FRAG2 frag_size="60000"/>
+ <pbcast.STREAMING_STATE_TRANSFER use_reading_thread="true"/>
+ <pbcast.FLUSH timeout="0"/>
+ </jgroupsConfig>
+ </transport>
+ <replication>
+ <sync replTimeout="15000"/>
+ <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
+ </properties>
+ </locator>
+ </buddy>
+ </replication>
+</jbosscache>
16 years, 5 months
JBoss Cache SVN: r6526 - core/trunk/src/test/java/org/jboss/cache/buddyreplication.
by jbosscache-commits@lists.jboss.org
Author: mircea.markus
Date: 2008-08-06 05:22:45 -0400 (Wed, 06 Aug 2008)
New Revision: 6526
Added:
core/trunk/src/test/java/org/jboss/cache/buddyreplication/MvccBuddyReplicationTest.java
Log:
added ut for MVCC buddy failure
Added: core/trunk/src/test/java/org/jboss/cache/buddyreplication/MvccBuddyReplicationTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/buddyreplication/MvccBuddyReplicationTest.java (rev 0)
+++ core/trunk/src/test/java/org/jboss/cache/buddyreplication/MvccBuddyReplicationTest.java 2008-08-06 09:22:45 UTC (rev 6526)
@@ -0,0 +1,77 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt 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.DefaultCacheFactory;
+import org.jboss.cache.Cache;
+import org.jboss.cache.factories.UnitTestCacheConfigurationFactory;
+import org.jboss.cache.lock.IsolationLevel;
+import org.jboss.cache.config.Option;
+import org.jboss.cache.config.Configuration;
+import org.jboss.cache.config.BuddyReplicationConfig;
+import org.jboss.cache.config.parsing.XmlConfigurationParser;
+import org.testng.annotations.Test;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.AfterMethod;
+
+import java.util.Properties;
+import java.util.List;
+import java.util.ArrayList;
+
+/**
+ * @author Mircea.Markus(a)jboss.com
+ * @since 3.0
+ */
+@Test(groups = "functionl")
+public class MvccBuddyReplicationTest
+{
+ private static final String FILE = "configs/mvcc-repl-sync-br.xml";
+
+ Configuration configuration;
+
+ public void testSimpleFailure() throws InterruptedException
+ {
+ Cache cache1 = createCache();
+ Thread.sleep(1000);
+ Cache cache2 = createCache();
+
+ cache1.put("/test", "key", "value");
+ cache1.stop();
+
+ Option option = cache2.getInvocationContext().getOptionOverrides();
+ option.setForceDataGravitation(true);
+ try
+ {
+ assert cache2.get("/test", "key").equals("value");
+ } finally
+ {
+ cache2.stop();
+ }
+ }
+
+ private Cache createCache()
+ {
+ Configuration fileConfig = new XmlConfigurationParser().parseFile(FILE);
+ DefaultCacheFactory dcf = new DefaultCacheFactory();
+ return dcf.createCache(fileConfig);
+ }
+}
16 years, 5 months
JBoss Cache SVN: r6525 - in searchable/trunk: src/main/java/org/jboss/cache/search and 4 other directories.
by jbosscache-commits@lists.jboss.org
Author: navssurtani
Date: 2008-08-06 04:21:48 -0400 (Wed, 06 Aug 2008)
New Revision: 6525
Modified:
searchable/trunk/TODO.txt
searchable/trunk/src/main/java/org/jboss/cache/search/CacheEntityId.java
searchable/trunk/src/main/java/org/jboss/cache/search/CacheEntityLoader.java
searchable/trunk/src/main/java/org/jboss/cache/search/CacheQuery.java
searchable/trunk/src/main/java/org/jboss/cache/search/CacheQueryImpl.java
searchable/trunk/src/main/java/org/jboss/cache/search/InvalidFqnException.java
searchable/trunk/src/main/java/org/jboss/cache/search/InvalidKeyException.java
searchable/trunk/src/main/java/org/jboss/cache/search/NodeModifiedTransactionContext.java
searchable/trunk/src/main/java/org/jboss/cache/search/PojoTransactionContext.java
searchable/trunk/src/main/java/org/jboss/cache/search/QueryResultIteratorImpl.java
searchable/trunk/src/main/java/org/jboss/cache/search/SearchableCache.java
searchable/trunk/src/main/java/org/jboss/cache/search/SearchableCacheConfiguration.java
searchable/trunk/src/main/java/org/jboss/cache/search/SearchableCacheFactory.java
searchable/trunk/src/main/java/org/jboss/cache/search/SearchableCacheImpl.java
searchable/trunk/src/main/java/org/jboss/cache/search/SearchableCoreListener.java
searchable/trunk/src/main/java/org/jboss/cache/search/SearchablePojoListener.java
searchable/trunk/src/main/java/org/jboss/cache/search/Transformer.java
searchable/trunk/src/test/java/org/jboss/cache/search/CacheEntityIdTest.java
searchable/trunk/src/test/java/org/jboss/cache/search/NodeModifiedTransactionContextTest.java
searchable/trunk/src/test/java/org/jboss/cache/search/QueryResultIteratorImplTest.java
searchable/trunk/src/test/java/org/jboss/cache/search/SearchableCacheImplTest.java
searchable/trunk/src/test/java/org/jboss/cache/search/TransformerTest.java
searchable/trunk/src/test/java/org/jboss/cache/search/blackbox/BrokenAnnotationTest.java
searchable/trunk/src/test/java/org/jboss/cache/search/blackbox/ClusteredCacheTest.java
searchable/trunk/src/test/java/org/jboss/cache/search/blackbox/LocalCacheTest.java
searchable/trunk/src/test/java/org/jboss/cache/search/blackbox/LocalPOJOCacheTest.java
searchable/trunk/src/test/java/org/jboss/cache/search/helper/IndexCleanUp.java
searchable/trunk/src/test/java/org/jboss/cache/search/test/BrokenDocumentId.java
searchable/trunk/src/test/java/org/jboss/cache/search/test/BrokenProvided.java
searchable/trunk/src/test/java/org/jboss/cache/search/test/Person.java
Log:
Changed @author in classes to * @author Navin Surtani (<a href="mailto:nsurtani@redhat.com">nsurtani(a)redhat.com</a>)
Modified: searchable/trunk/TODO.txt
===================================================================
--- searchable/trunk/TODO.txt 2008-08-06 00:57:16 UTC (rev 6524)
+++ searchable/trunk/TODO.txt 2008-08-06 08:21:48 UTC (rev 6525)
@@ -6,8 +6,6 @@
So that when a large amount of hits are there, they can be loaded when required.
-3 - Deal with Lucene Filters and Sorting.
-
4 - Non-string keys.
Think.
Modified: searchable/trunk/src/main/java/org/jboss/cache/search/CacheEntityId.java
===================================================================
--- searchable/trunk/src/main/java/org/jboss/cache/search/CacheEntityId.java 2008-08-06 00:57:16 UTC (rev 6524)
+++ searchable/trunk/src/main/java/org/jboss/cache/search/CacheEntityId.java 2008-08-06 08:21:48 UTC (rev 6525)
@@ -5,8 +5,7 @@
/**
*
* This class is used to get fqns, keys and documentId's by calling methods on {@link org.jboss.cache.search.Transformer}
- *
- @author Navin Surtani - navin(a)surtani.org
+ * @author Navin Surtani (<a href="mailto:nsurtani@redhat.com">nsurtani(a)redhat.com</a>)
*/
public class CacheEntityId
{
Modified: searchable/trunk/src/main/java/org/jboss/cache/search/CacheEntityLoader.java
===================================================================
--- searchable/trunk/src/main/java/org/jboss/cache/search/CacheEntityLoader.java 2008-08-06 00:57:16 UTC (rev 6524)
+++ searchable/trunk/src/main/java/org/jboss/cache/search/CacheEntityLoader.java 2008-08-06 08:21:48 UTC (rev 6525)
@@ -9,8 +9,7 @@
/**
* Class that is used to load objects from a list of CacheEntityId ids.
- *
- * @author Navin Surtani - navin(a)surtani.org
+ * @author Navin Surtani (<a href="mailto:nsurtani@redhat.com">nsurtani(a)redhat.com</a>)
*/
public class CacheEntityLoader
{
@@ -30,6 +29,7 @@
*/
public List<Object> load(List<CacheEntityId> ids)
{
+ if (ids == null) throw new NullPointerException("ids are null");
List<Object> retVal = new ArrayList<Object>(ids.size());
for (CacheEntityId id: ids)
@@ -48,6 +48,7 @@
*/
public Object load(CacheEntityId id)
{
+ if (id == null) throw new NullPointerException("id is null");
return cache.get(id.getFqn(), id.getKey());
}
Modified: searchable/trunk/src/main/java/org/jboss/cache/search/CacheQuery.java
===================================================================
--- searchable/trunk/src/main/java/org/jboss/cache/search/CacheQuery.java 2008-08-06 00:57:16 UTC (rev 6524)
+++ searchable/trunk/src/main/java/org/jboss/cache/search/CacheQuery.java 2008-08-06 08:21:48 UTC (rev 6525)
@@ -32,6 +32,15 @@
QueryResultIterator iterator();
/**
+ * Lazily loads the results from the Query as a {@link org.jboss.cache.search.QueryResultIterator}
+ *
+ * @return a QueryResultIterator which can be used to <B>lazily</B> iterate through results.
+ */
+
+ QueryResultIterator lazyIterator();
+
+
+ /**
* Sets a result with a given index to the first result.
*
* @param index of result to be set to the first.
Modified: searchable/trunk/src/main/java/org/jboss/cache/search/CacheQueryImpl.java
===================================================================
--- searchable/trunk/src/main/java/org/jboss/cache/search/CacheQueryImpl.java 2008-08-06 00:57:16 UTC (rev 6524)
+++ searchable/trunk/src/main/java/org/jboss/cache/search/CacheQueryImpl.java 2008-08-06 08:21:48 UTC (rev 6525)
@@ -35,12 +35,11 @@
/**
* Implementation class of the CacheQuery interface.
* <p/>
- *
- * @author Navin Surtani - navin(a)surtani.org
+ * @author Navin Surtani (<a href="mailto:nsurtani@redhat.com">nsurtani(a)redhat.com</a>)
*/
public class CacheQueryImpl implements CacheQuery
{
-// private Cache cache; - Removed on 11/07/2008, cache is assigned but never used. Hence removed.
+ // private Cache cache; - Removed on 11/07/2008, cache is assigned but never used. Hence removed.
private Class[] classes;
private Sort sort;
private Filter filter;
@@ -85,7 +84,6 @@
}
-
/**
* @return The result size of the query.
*/
@@ -241,6 +239,27 @@
return new QueryResultIteratorImpl(ids, entityLoader);
}
+ public QueryResultIterator lazyIterator()
+ {
+ IndexSearcher searcher = buildSearcher(searchFactory);
+
+ try
+ {
+ Hits hits = getHits(searcher);
+ int first = first();
+ int max = max(first, hits);
+
+ DocumentExtractor extractor = new DocumentExtractor(luceneQuery, searcher, searchFactory, indexProjection);
+
+ }
+ catch (IOException e)
+ {
+ e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
+ }
+
+ return null;
+ }
+
/**
* Returns a the results from the query as a List object.
*
@@ -423,7 +442,7 @@
}
private void populateDirectories(List<DirectoryProvider> directories, DirectoryProvider[] directoryProviders)
-
+
{
for (DirectoryProvider provider : directoryProviders)
{
Modified: searchable/trunk/src/main/java/org/jboss/cache/search/InvalidFqnException.java
===================================================================
--- searchable/trunk/src/main/java/org/jboss/cache/search/InvalidFqnException.java 2008-08-06 00:57:16 UTC (rev 6524)
+++ searchable/trunk/src/main/java/org/jboss/cache/search/InvalidFqnException.java 2008-08-06 08:21:48 UTC (rev 6525)
@@ -5,8 +5,7 @@
/**
* Thrown when an invalid Fqn is passed into {@link org.jboss.cache.search.Transformer#generateId(org.jboss.cache.Fqn, String)}
* <p />
- *
- * @author Navin Surtani - navin(a)surtani.org
+ * @author Navin Surtani (<a href="mailto:nsurtani@redhat.com">nsurtani(a)redhat.com</a>)
*/
public class InvalidFqnException extends CacheException
{
Modified: searchable/trunk/src/main/java/org/jboss/cache/search/InvalidKeyException.java
===================================================================
--- searchable/trunk/src/main/java/org/jboss/cache/search/InvalidKeyException.java 2008-08-06 00:57:16 UTC (rev 6524)
+++ searchable/trunk/src/main/java/org/jboss/cache/search/InvalidKeyException.java 2008-08-06 08:21:48 UTC (rev 6525)
@@ -1,7 +1,7 @@
package org.jboss.cache.search;
/**
- * @author Navin Surtani - navin(a)surtani.org
+ * @author Navin Surtani (<a href="mailto:nsurtani@redhat.com">nsurtani(a)redhat.com</a>)
*/
public class InvalidKeyException extends Exception
{
Modified: searchable/trunk/src/main/java/org/jboss/cache/search/NodeModifiedTransactionContext.java
===================================================================
--- searchable/trunk/src/main/java/org/jboss/cache/search/NodeModifiedTransactionContext.java 2008-08-06 00:57:16 UTC (rev 6524)
+++ searchable/trunk/src/main/java/org/jboss/cache/search/NodeModifiedTransactionContext.java 2008-08-06 08:21:48 UTC (rev 6525)
@@ -12,7 +12,7 @@
* <p />
* It is used by the {@link SearchableCoreListener} to pass transaction information to a Hibernate Search {@link org.hibernate.search.backend.Work} object.
* <p />
- * @author Navin Surtani - navin(a)surtani.org
+ * @author Navin Surtani (<a href="mailto:nsurtani@redhat.com">nsurtani(a)redhat.com</a>)
* @see SearchableCoreListener
*/
public class NodeModifiedTransactionContext implements TransactionContext
Modified: searchable/trunk/src/main/java/org/jboss/cache/search/PojoTransactionContext.java
===================================================================
--- searchable/trunk/src/main/java/org/jboss/cache/search/PojoTransactionContext.java 2008-08-06 00:57:16 UTC (rev 6524)
+++ searchable/trunk/src/main/java/org/jboss/cache/search/PojoTransactionContext.java 2008-08-06 08:21:48 UTC (rev 6525)
@@ -7,7 +7,7 @@
//import javax.transaction.Transaction;
//
///**
-// * @author Navin Surtani - navin(a)surtani.org
+// * @author Navin Surtani (<a href="mailto:nsurtani@redhat.com">nsurtani(a)redhat.com</a>)
// */
//public class PojoTransactionContext implements TransactionContext
//{
Modified: searchable/trunk/src/main/java/org/jboss/cache/search/QueryResultIteratorImpl.java
===================================================================
--- searchable/trunk/src/main/java/org/jboss/cache/search/QueryResultIteratorImpl.java 2008-08-06 00:57:16 UTC (rev 6524)
+++ searchable/trunk/src/main/java/org/jboss/cache/search/QueryResultIteratorImpl.java 2008-08-06 08:21:48 UTC (rev 6525)
@@ -9,7 +9,7 @@
* This is the implementation class for the interface QueryResultIterator which extends ListIterator. It is what is
* returned when the iterator() method is run on a CacheQuery instance.
*
- * @author Navin Surtani - navin(a)surtani.org
+ * @author Navin Surtani (<a href="mailto:nsurtani@redhat.com">nsurtani(a)redhat.com</a>)
*/
public class QueryResultIteratorImpl implements QueryResultIterator
{
Modified: searchable/trunk/src/main/java/org/jboss/cache/search/SearchableCache.java
===================================================================
--- searchable/trunk/src/main/java/org/jboss/cache/search/SearchableCache.java 2008-08-06 00:57:16 UTC (rev 6524)
+++ searchable/trunk/src/main/java/org/jboss/cache/search/SearchableCache.java 2008-08-06 08:21:48 UTC (rev 6525)
@@ -4,7 +4,7 @@
import org.jboss.cache.Cache;
/**
- * @author Navin Surtani - navin(a)surtani.org
+ * @author Navin Surtani (<a href="mailto:nsurtani@redhat.com">nsurtani(a)redhat.com</a>)
* <p/>
* This will be the most used interface in JBossCache searchable. It extends Cache and therefore will have
* the standard get(), put() and remove() methods. The additional method is the createQuery method which people
Modified: searchable/trunk/src/main/java/org/jboss/cache/search/SearchableCacheConfiguration.java
===================================================================
--- searchable/trunk/src/main/java/org/jboss/cache/search/SearchableCacheConfiguration.java 2008-08-06 00:57:16 UTC (rev 6524)
+++ searchable/trunk/src/main/java/org/jboss/cache/search/SearchableCacheConfiguration.java 2008-08-06 08:21:48 UTC (rev 6525)
@@ -14,7 +14,7 @@
* Class that implements {@link org.hibernate.search.cfg.SearchConfiguration} so that within JBossCache Searchable, there is no
* need for a Hibernate Core configuration object.
*
- * @author Navin Surtani - navin(a)surtani.org
+ * @author Navin Surtani (<a href="mailto:nsurtani@redhat.com">nsurtani(a)redhat.com</a>)
*/
public class SearchableCacheConfiguration implements SearchConfiguration
{
Modified: searchable/trunk/src/main/java/org/jboss/cache/search/SearchableCacheFactory.java
===================================================================
--- searchable/trunk/src/main/java/org/jboss/cache/search/SearchableCacheFactory.java 2008-08-06 00:57:16 UTC (rev 6524)
+++ searchable/trunk/src/main/java/org/jboss/cache/search/SearchableCacheFactory.java 2008-08-06 08:21:48 UTC (rev 6525)
@@ -12,7 +12,7 @@
import java.lang.reflect.Field;
/**
- * @author Navin Surtani - navin(a)surtani.org
+ * @author Navin Surtani (<a href="mailto:nsurtani@redhat.com">nsurtani(a)redhat.com</a>)
*/
public class SearchableCacheFactory
{
Modified: searchable/trunk/src/main/java/org/jboss/cache/search/SearchableCacheImpl.java
===================================================================
--- searchable/trunk/src/main/java/org/jboss/cache/search/SearchableCacheImpl.java 2008-08-06 00:57:16 UTC (rev 6524)
+++ searchable/trunk/src/main/java/org/jboss/cache/search/SearchableCacheImpl.java 2008-08-06 08:21:48 UTC (rev 6525)
@@ -19,7 +19,7 @@
import java.util.Set;
/**
- * @author Navin Surtani - navin(a)surtani.org
+ * @author Navin Surtani (<a href="mailto:nsurtani@redhat.com">nsurtani(a)redhat.com</a>)
* <p/>
* Implementation class for the SearchableCache interface.
*/
Modified: searchable/trunk/src/main/java/org/jboss/cache/search/SearchableCoreListener.java
===================================================================
--- searchable/trunk/src/main/java/org/jboss/cache/search/SearchableCoreListener.java 2008-08-06 00:57:16 UTC (rev 6524)
+++ searchable/trunk/src/main/java/org/jboss/cache/search/SearchableCoreListener.java 2008-08-06 08:21:48 UTC (rev 6525)
@@ -14,7 +14,7 @@
import java.util.Map;
/**
- * @author Navin Surtani - navin(a)surtani.org
+ * @author Navin Surtani (<a href="mailto:nsurtani@redhat.com">nsurtani(a)redhat.com</a>)
*
* Listener class for changes made to the cache. This listener makes changes if it is a org.jboss.cache being used.
*/
Modified: searchable/trunk/src/main/java/org/jboss/cache/search/SearchablePojoListener.java
===================================================================
--- searchable/trunk/src/main/java/org/jboss/cache/search/SearchablePojoListener.java 2008-08-06 00:57:16 UTC (rev 6524)
+++ searchable/trunk/src/main/java/org/jboss/cache/search/SearchablePojoListener.java 2008-08-06 08:21:48 UTC (rev 6525)
@@ -10,7 +10,7 @@
import javax.transaction.Transaction;
/**
- * @author Navin Surtani - navin(a)surtani.org
+ * @author Navin Surtani (<a href="mailto:nsurtani@redhat.com">nsurtani(a)redhat.com</a>)
*/
//@PojoCacheListener
Modified: searchable/trunk/src/main/java/org/jboss/cache/search/Transformer.java
===================================================================
--- searchable/trunk/src/main/java/org/jboss/cache/search/Transformer.java 2008-08-06 00:57:16 UTC (rev 6524)
+++ searchable/trunk/src/main/java/org/jboss/cache/search/Transformer.java 2008-08-06 08:21:48 UTC (rev 6525)
@@ -3,8 +3,8 @@
import org.jboss.cache.Fqn;
/**
-@author Navin Surtani - navin(a)surtani.org
-
+* @author Navin Surtani (<a href="mailto:nsurtani@redhat.com">nsurtani(a)redhat.com</a>)
+*
* This class is one that does all the 'conversion' work between JBossCache and Hibernate Search. This is where
* users can switch from Fqn and key to a documentId and vice versa.
*
Modified: searchable/trunk/src/test/java/org/jboss/cache/search/CacheEntityIdTest.java
===================================================================
--- searchable/trunk/src/test/java/org/jboss/cache/search/CacheEntityIdTest.java 2008-08-06 00:57:16 UTC (rev 6524)
+++ searchable/trunk/src/test/java/org/jboss/cache/search/CacheEntityIdTest.java 2008-08-06 08:21:48 UTC (rev 6525)
@@ -5,7 +5,7 @@
import org.jboss.cache.search.CacheEntityId;
/**
- * @author Navin Surtani - navin(a)surtani.org
+ * @author Navin Surtani (<a href="mailto:nsurtani@redhat.com">nsurtani(a)redhat.com</a>)
*/
@Test
Modified: searchable/trunk/src/test/java/org/jboss/cache/search/NodeModifiedTransactionContextTest.java
===================================================================
--- searchable/trunk/src/test/java/org/jboss/cache/search/NodeModifiedTransactionContextTest.java 2008-08-06 00:57:16 UTC (rev 6524)
+++ searchable/trunk/src/test/java/org/jboss/cache/search/NodeModifiedTransactionContextTest.java 2008-08-06 08:21:48 UTC (rev 6525)
@@ -3,7 +3,7 @@
import org.testng.annotations.Test;
/**
- * @author Navin Surtani - navin(a)surtani.org
+ * @author Navin Surtani (<a href="mailto:nsurtani@redhat.com">nsurtani(a)redhat.com</a>)
*/
@Test
Modified: searchable/trunk/src/test/java/org/jboss/cache/search/QueryResultIteratorImplTest.java
===================================================================
--- searchable/trunk/src/test/java/org/jboss/cache/search/QueryResultIteratorImplTest.java 2008-08-06 00:57:16 UTC (rev 6524)
+++ searchable/trunk/src/test/java/org/jboss/cache/search/QueryResultIteratorImplTest.java 2008-08-06 08:21:48 UTC (rev 6525)
@@ -11,7 +11,7 @@
import java.util.Map;
/**
- * @author Navin Surtani - navin(a)surtani.org
+ * @author Navin Surtani (<a href="mailto:nsurtani@redhat.com">nsurtani(a)redhat.com</a>)
* <p/>
* Test class for the QueryResultIteratorImpl
*/
Modified: searchable/trunk/src/test/java/org/jboss/cache/search/SearchableCacheImplTest.java
===================================================================
--- searchable/trunk/src/test/java/org/jboss/cache/search/SearchableCacheImplTest.java 2008-08-06 00:57:16 UTC (rev 6524)
+++ searchable/trunk/src/test/java/org/jboss/cache/search/SearchableCacheImplTest.java 2008-08-06 08:21:48 UTC (rev 6525)
@@ -5,7 +5,7 @@
import org.jboss.cache.DefaultCacheFactory;
/**
- * @author Navin Surtani - navin(a)surtani.org
+ * @author Navin Surtani (<a href="mailto:nsurtani@redhat.com">nsurtani(a)redhat.com</a>)
*/
@Test (groups = "functional")
Modified: searchable/trunk/src/test/java/org/jboss/cache/search/TransformerTest.java
===================================================================
--- searchable/trunk/src/test/java/org/jboss/cache/search/TransformerTest.java 2008-08-06 00:57:16 UTC (rev 6524)
+++ searchable/trunk/src/test/java/org/jboss/cache/search/TransformerTest.java 2008-08-06 08:21:48 UTC (rev 6525)
@@ -4,7 +4,7 @@
import org.testng.annotations.Test;
/**
- * @author Navin Surtani - navin(a)surtani.org
+ * @author Navin Surtani (<a href="mailto:nsurtani@redhat.com">nsurtani(a)redhat.com</a>)
* <p/>
* Unit-test class for the Transformer class.
*/
Modified: searchable/trunk/src/test/java/org/jboss/cache/search/blackbox/BrokenAnnotationTest.java
===================================================================
--- searchable/trunk/src/test/java/org/jboss/cache/search/blackbox/BrokenAnnotationTest.java 2008-08-06 00:57:16 UTC (rev 6524)
+++ searchable/trunk/src/test/java/org/jboss/cache/search/blackbox/BrokenAnnotationTest.java 2008-08-06 08:21:48 UTC (rev 6525)
@@ -9,7 +9,7 @@
import org.jboss.cache.DefaultCacheFactory;
/**
- * @author Navin Surtani - navin(a)surtani.org
+ * @author Navin Surtani (<a href="mailto:nsurtani@redhat.com">nsurtani(a)redhat.com</a>)
*/
@Test (groups = "functional")
public class BrokenAnnotationTest
Modified: searchable/trunk/src/test/java/org/jboss/cache/search/blackbox/ClusteredCacheTest.java
===================================================================
--- searchable/trunk/src/test/java/org/jboss/cache/search/blackbox/ClusteredCacheTest.java 2008-08-06 00:57:16 UTC (rev 6524)
+++ searchable/trunk/src/test/java/org/jboss/cache/search/blackbox/ClusteredCacheTest.java 2008-08-06 08:21:48 UTC (rev 6525)
@@ -22,7 +22,7 @@
import java.util.List;
/**
- * @author Navin Surtani - navin(a)surtani.org
+ * @author Navin Surtani (<a href="mailto:nsurtani@redhat.com">nsurtani(a)redhat.com</a>)
*/
@Test(groups = "functional")
public class ClusteredCacheTest
Modified: searchable/trunk/src/test/java/org/jboss/cache/search/blackbox/LocalCacheTest.java
===================================================================
--- searchable/trunk/src/test/java/org/jboss/cache/search/blackbox/LocalCacheTest.java 2008-08-06 00:57:16 UTC (rev 6524)
+++ searchable/trunk/src/test/java/org/jboss/cache/search/blackbox/LocalCacheTest.java 2008-08-06 08:21:48 UTC (rev 6525)
@@ -25,7 +25,7 @@
import java.io.File;
/**
- * @author Navin Surtani - navin(a)surtani.org
+ * @author Navin Surtani (<a href="mailto:nsurtani@redhat.com">nsurtani(a)redhat.com</a>)
*/
@Test(groups = "functional")
Modified: searchable/trunk/src/test/java/org/jboss/cache/search/blackbox/LocalPOJOCacheTest.java
===================================================================
--- searchable/trunk/src/test/java/org/jboss/cache/search/blackbox/LocalPOJOCacheTest.java 2008-08-06 00:57:16 UTC (rev 6524)
+++ searchable/trunk/src/test/java/org/jboss/cache/search/blackbox/LocalPOJOCacheTest.java 2008-08-06 08:21:48 UTC (rev 6525)
@@ -28,7 +28,7 @@
* instead of cache.put() and cache.remove().
* <p/>
*
- * @author Navin Surtani - navin(a)surtani.org
+ * @author Navin Surtani (<a href="mailto:nsurtani@redhat.com">nsurtani(a)redhat.com</a>)
*/
@Test(groups = "functional", enabled = false)
Modified: searchable/trunk/src/test/java/org/jboss/cache/search/helper/IndexCleanUp.java
===================================================================
--- searchable/trunk/src/test/java/org/jboss/cache/search/helper/IndexCleanUp.java 2008-08-06 00:57:16 UTC (rev 6524)
+++ searchable/trunk/src/test/java/org/jboss/cache/search/helper/IndexCleanUp.java 2008-08-06 08:21:48 UTC (rev 6525)
@@ -5,7 +5,7 @@
import java.io.File;
/**
- * @author Navin Surtani - navin(a)surtani.org
+ * @author Navin Surtani (<a href="mailto:nsurtani@redhat.com">nsurtani(a)redhat.com</a>)
*/
public class IndexCleanUp
{
Modified: searchable/trunk/src/test/java/org/jboss/cache/search/test/BrokenDocumentId.java
===================================================================
--- searchable/trunk/src/test/java/org/jboss/cache/search/test/BrokenDocumentId.java 2008-08-06 00:57:16 UTC (rev 6524)
+++ searchable/trunk/src/test/java/org/jboss/cache/search/test/BrokenDocumentId.java 2008-08-06 08:21:48 UTC (rev 6525)
@@ -6,7 +6,7 @@
import org.hibernate.search.annotations.Field;
/**
- * @author Navin Surtani - navin(a)surtani.org
+ * @author Navin Surtani (<a href="mailto:nsurtani@redhat.com">nsurtani(a)redhat.com</a>)
*/
@ProvidedId
@Indexed
Modified: searchable/trunk/src/test/java/org/jboss/cache/search/test/BrokenProvided.java
===================================================================
--- searchable/trunk/src/test/java/org/jboss/cache/search/test/BrokenProvided.java 2008-08-06 00:57:16 UTC (rev 6524)
+++ searchable/trunk/src/test/java/org/jboss/cache/search/test/BrokenProvided.java 2008-08-06 08:21:48 UTC (rev 6525)
@@ -5,7 +5,7 @@
import org.hibernate.search.annotations.Field;
/**
- * @author Navin Surtani - navin(a)surtani.org
+ * @author Navin Surtani (<a href="mailto:nsurtani@redhat.com">nsurtani(a)redhat.com</a>)
*/
@Indexed
public class BrokenProvided
Modified: searchable/trunk/src/test/java/org/jboss/cache/search/test/Person.java
===================================================================
--- searchable/trunk/src/test/java/org/jboss/cache/search/test/Person.java 2008-08-06 00:57:16 UTC (rev 6524)
+++ searchable/trunk/src/test/java/org/jboss/cache/search/test/Person.java 2008-08-06 08:21:48 UTC (rev 6525)
@@ -9,7 +9,7 @@
import java.io.Serializable;
/**
- * @author Navin Surtani - navin(a)surtani.org
+ * @author Navin Surtani (<a href="mailto:nsurtani@redhat.com">nsurtani(a)redhat.com</a>)
*/
@ProvidedId
@Indexed
16 years, 5 months
JBoss Cache SVN: r6524 - in core/trunk/src: main/java/org/jboss/cache/interceptors and 4 other directories.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-08-05 20:57:16 -0400 (Tue, 05 Aug 2008)
New Revision: 6524
Added:
core/trunk/src/test/java/org/jboss/cache/api/mvcc/PersistingTransientStateTest.java
core/trunk/src/test/java/org/jboss/cache/optimistic/PersistingTransientStateTest.java
core/trunk/src/test/java/org/jboss/cache/statetransfer/PersistingTransientStateTest.java
Modified:
core/trunk/src/main/java/org/jboss/cache/config/Option.java
core/trunk/src/main/java/org/jboss/cache/interceptors/CacheStoreInterceptor.java
core/trunk/src/main/java/org/jboss/cache/statetransfer/DefaultStateTransferIntegrator.java
core/trunk/src/main/java/org/jboss/cache/statetransfer/LegacyStateTransferIntegrator.java
core/trunk/src/main/java/org/jboss/cache/statetransfer/LegacyStateTransferManager.java
Log:
JBCACHE-131 - persist transient state during state transfer under certain conditions
Modified: core/trunk/src/main/java/org/jboss/cache/config/Option.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/config/Option.java 2008-08-06 00:56:02 UTC (rev 6523)
+++ core/trunk/src/main/java/org/jboss/cache/config/Option.java 2008-08-06 00:57:16 UTC (rev 6524)
@@ -33,6 +33,7 @@
private int groupRequestMode = -1;
private int lockAcquisitionTimeout = -1;
+ private boolean suppressPersistence;
/**
* @since 1.4.0
@@ -303,6 +304,7 @@
if (forceAsynchronous != option.forceAsynchronous) return false;
if (forceSynchronous != option.forceSynchronous) return false;
if (lockAcquisitionTimeout != option.lockAcquisitionTimeout) return false;
+ if (suppressPersistence != option.suppressPersistence) return false;
return true;
}
@@ -320,6 +322,7 @@
result = 29 * result + (forceAsynchronous ? 0 : 1);
result = 29 * result + (forceSynchronous ? 0 : 1);
result = 29 * result + (lockAcquisitionTimeout);
+ result = 29 * result + (suppressPersistence ? 0 : 1);
return result;
}
@@ -338,6 +341,7 @@
this.forceAsynchronous = false;
this.forceSynchronous = false;
this.lockAcquisitionTimeout = -1;
+ this.suppressPersistence = false;
}
/**
@@ -426,4 +430,26 @@
{
this.groupRequestMode = groupRequestMode;
}
+
+ /**
+ * If set to true, any persistence to a cache loader will be suppressed for the current invocation only. Does not apply to transactional calls.
+ *
+ * @return true if persistence is suppressed.
+ * @since 3.0
+ */
+ public boolean isSuppressPersistence()
+ {
+ return suppressPersistence;
+ }
+
+ /**
+ * If set to true, any persistence to a cache loader will be suppressed for the current invocation only. Does not apply to transactional calls.
+ *
+ * @param suppressPersistence if true, will suppress persistence.
+ * @since 3.0
+ */
+ public void setSuppressPersistence(boolean suppressPersistence)
+ {
+ this.suppressPersistence = suppressPersistence;
+ }
}
Modified: core/trunk/src/main/java/org/jboss/cache/interceptors/CacheStoreInterceptor.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/interceptors/CacheStoreInterceptor.java 2008-08-06 00:56:02 UTC (rev 6523)
+++ core/trunk/src/main/java/org/jboss/cache/interceptors/CacheStoreInterceptor.java 2008-08-06 00:57:16 UTC (rev 6524)
@@ -86,7 +86,7 @@
@Override
public boolean skipInterception(InvocationContext ctx, VisitableCommand command)
{
- if (!ctx.isOriginLocal() && loaderConfig.isShared())
+ if ((!ctx.isOriginLocal() && loaderConfig.isShared()) || ctx.getOptionOverrides().isSuppressPersistence())
{
if (trace)
log.trace("Passing up method call and bypassing this interceptor since the cache loader is shared and this call originated remotely.");
Modified: core/trunk/src/main/java/org/jboss/cache/statetransfer/DefaultStateTransferIntegrator.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/statetransfer/DefaultStateTransferIntegrator.java 2008-08-06 00:56:02 UTC (rev 6523)
+++ core/trunk/src/main/java/org/jboss/cache/statetransfer/DefaultStateTransferIntegrator.java 2008-08-06 00:57:16 UTC (rev 6524)
@@ -12,11 +12,10 @@
import org.jboss.cache.CacheSPI;
import org.jboss.cache.Fqn;
import org.jboss.cache.InternalNode;
-import org.jboss.cache.NodeFactory;
-import org.jboss.cache.Region;
+import org.jboss.cache.Node;
+import org.jboss.cache.NodeSPI;
import org.jboss.cache.buddyreplication.BuddyManager;
-import org.jboss.cache.eviction.EvictedEventNode;
-import org.jboss.cache.eviction.NodeEventType;
+import org.jboss.cache.config.Configuration;
import org.jboss.cache.factories.annotations.Inject;
import org.jboss.cache.factories.annotations.Start;
import org.jboss.cache.invocation.InvocationContext;
@@ -42,24 +41,25 @@
private static final Log log = LogFactory.getLog(DefaultStateTransferIntegrator.class);
private static final boolean trace = log.isTraceEnabled();
- private CacheSPI cache;
+ private CacheSPI<?, ?> cache;
- private NodeFactory factory;
-
private Set<Fqn> internalFqns;
+ private Configuration cfg;
+ private boolean needToPersistState; // for JBCACHE-131
-
@Inject
- public void inject(CacheSPI<?, ?> cache, NodeFactory nodefactory)
+ public void inject(CacheSPI<?, ?> cache, Configuration cfg)
{
this.cache = cache;
- this.factory = nodefactory;
+ this.cfg = cfg;
}
@Start(priority = 14)
public void start()
{
this.internalFqns = cache.getInternalFqns();
+ needToPersistState = cfg.getCacheLoaderConfig() != null && !cfg.getCacheLoaderConfig().isFetchPersistentState() &&
+ !cfg.getCacheLoaderConfig().isShared();
}
public void integrateState(ObjectInputStream ois, Object target, Fqn targetRoot, boolean integratePersistentState) throws Exception
@@ -86,7 +86,7 @@
log.trace("integrating transient state for " + target);
}
- integrateTransientState(target, in);
+ integrateTransientState(target.getFqn(), in);
transientSet = true;
@@ -189,10 +189,23 @@
for (InternalNode n : children) notifyAllNodesCreated(ctx, n);
}
- private void integrateTransientState(InternalNode target, ObjectInputStream in) throws Exception
+ private void prepareContextOptions()
{
- target.removeChildren();
+ cache.getInvocationContext().getOptionOverrides().setCacheModeLocal(true);
+ cache.getInvocationContext().getOptionOverrides().setSkipCacheStatusCheck(true);
+ cache.getInvocationContext().getOptionOverrides().setSuppressPersistence(!needToPersistState);
+ }
+ private void integrateTransientState(Fqn target, ObjectInputStream in) throws Exception
+ {
+ prepareContextOptions();
+ NodeSPI targetNode = cache.getNode(target);
+ for (Object childname : targetNode.getChildrenNames())
+ {
+ prepareContextOptions();
+ targetNode.removeChild(childname);
+ }
+
List<NodeData> list = readNodesAsList(in);
if (list != null)
{
@@ -207,18 +220,20 @@
//are there any transient nodes at all?
if (nd != null && !nd.isMarker())
{
- Map attributes = nd.getAttributes();
+ // with MVCC these calls should ALWAYS go up the interceptor chain since no other locking
+ // takes place elsewhere.
+ prepareContextOptions();
+ cache.clearData(target);
+ prepareContextOptions();
+ cache.put(target, nd.getAttributes());
- target.setInternalState(attributes);
-
// Check whether this is an integration into the buddy backup
// subtree
Fqn tferFqn = nd.getFqn();
- Fqn tgtFqn = target.getFqn();
- boolean move = tgtFqn.isChildOrEquals(BuddyManager.BUDDY_BACKUP_SUBTREE_FQN)
- && !tferFqn.isChildOrEquals(tgtFqn);
+ boolean move = target.isChildOrEquals(BuddyManager.BUDDY_BACKUP_SUBTREE_FQN)
+ && !tferFqn.isChildOrEquals(target);
// If it is an integration, calculate how many levels of offset
- int offset = move ? tgtFqn.size() - tferFqn.size() : 0;
+ int offset = move ? target.size() - tferFqn.size() : 0;
integrateStateTransferChildren(target, offset, nodeDataIterator);
@@ -240,11 +255,11 @@
return (List<NodeData>) obj;
}
- private NodeData integrateStateTransferChildren(InternalNode parent, int offset, Iterator<NodeData> nodeDataIterator)
+ private NodeData integrateStateTransferChildren(Fqn parentFqn, int offset, Iterator<NodeData> nodeDataIterator)
throws IOException, ClassNotFoundException
{
- int parent_level = parent.getFqn().size();
- int target_level = parent_level + 1;
+ int parentLevel = parentFqn.size();
+ int targetLevel = parentLevel + 1;
Fqn fqn;
int size;
NodeData nd = nodeDataIterator.hasNext() ? nodeDataIterator.next() : null;
@@ -255,35 +270,28 @@
// change the Fqn to fit under it
if (offset > 0)
{
- fqn = Fqn.fromRelativeFqn(parent.getFqn().getAncestor(offset), fqn);
+ fqn = Fqn.fromRelativeFqn(parentFqn.getAncestor(offset), fqn);
}
size = fqn.size();
- if (size <= parent_level)
+ if (size <= parentLevel)
{
return nd;
}
- else if (size > target_level)
+ else if (size > targetLevel)
{
- throw new IllegalStateException("NodeData " + fqn + " is not a direct child of " + parent.getFqn());
+ throw new IllegalStateException("NodeData " + fqn + " is not a direct child of " + parentFqn);
}
Map attrs = nd.getAttributes();
- InternalNode internalTarget = factory.createInternalNode(fqn);
- internalTarget.setInternalState(attrs);
- parent.addChild(internalTarget);
+ prepareContextOptions();
+ cache.clearData(fqn);
+ prepareContextOptions();
+ cache.put(fqn, attrs);
- // JBCACHE-913
- Region region = cache.getRegion(fqn, false);
- if (region != null && region.getEvictionPolicy() != null)
- {
- region.putNodeEvent(new EvictedEventNode(fqn, NodeEventType.ADD_NODE_EVENT,
- attrs == null ? 0 : attrs.size()));
- }
-
// Recursively call, which will walk down the tree
// and return the next NodeData that's a child of our parent
- nd = integrateStateTransferChildren(internalTarget, offset, nodeDataIterator);
+ nd = integrateStateTransferChildren(fqn, offset, nodeDataIterator);
}
if (nd != null && nd.isExceptionMarker())
{
@@ -294,18 +302,18 @@
return null;
}
- private Set<InternalNode> retainInternalNodes(InternalNode target)
+ private Set<Fqn> retainInternalNodes(Fqn target)
{
- Set<InternalNode> result = new HashSet<InternalNode>();
- Fqn targetFqn = target.getFqn();
+ Set<Fqn> result = new HashSet<Fqn>();
for (Fqn internalFqn : internalFqns)
{
- if (internalFqn.isChildOf(targetFqn))
+ if (internalFqn.isChildOf(target))
{
- InternalNode internalNode = getInternalNode(target, internalFqn);
- if (internalNode != null)
+ prepareContextOptions();
+ Node node = getInternalNode(cache.getNode(target), internalFqn);
+ if (node != null)
{
- result.add(internalNode);
+ result.add(node.getFqn());
}
}
}
@@ -313,10 +321,12 @@
return result;
}
- private InternalNode getInternalNode(InternalNode parent, Fqn internalFqn)
+ private Node getInternalNode(Node parentNode, Fqn internalFqn)
{
- Object name = internalFqn.get(parent.getFqn().size());
- InternalNode result = parent.getChild(name);
+ Fqn parentFqn = parentNode.getFqn();
+ Object name = internalFqn.get(parentFqn.size());
+ prepareContextOptions();
+ Node result = parentNode.getChild(name);
if (result != null)
{
if (internalFqn.size() < result.getFqn().size())
@@ -328,29 +338,33 @@
return result;
}
- private void integrateRetainedNodes(InternalNode target)
+ private void integrateRetainedNodes(Fqn target)
{
- Set<InternalNode> retainedNodes = retainInternalNodes(target);
- Fqn rootFqn = target.getFqn();
- for (InternalNode retained : retainedNodes)
+ Set<Fqn> retainedNodes = retainInternalNodes(target);
+ for (Fqn retained : retainedNodes)
{
- if (retained.getFqn().isChildOf(rootFqn))
+ if (retained.isChildOf(target))
{
integrateRetainedNode(target, retained);
}
}
}
- private void integrateRetainedNode(InternalNode ancestor, InternalNode descendant)
+
+ // TODO: What is this rubbish?!??
+ private void integrateRetainedNode(Fqn ancFqn, Fqn descFqn)
{
- Fqn descFqn = descendant.getFqn();
- Fqn ancFqn = ancestor.getFqn();
+ prepareContextOptions();
+ InternalNode ancestor = cache.getNode(ancFqn).getDelegationTarget();
Object name = descFqn.get(ancFqn.size());
InternalNode child = ancestor.getChild(name);
if (ancFqn.size() == descFqn.size() + 1)
{
if (child == null)
{
+ prepareContextOptions();
+ InternalNode descendant = cache.getNode(descFqn).getDelegationTarget();
+ prepareContextOptions();
ancestor.addChild(name, descendant);
}
else
@@ -373,7 +387,7 @@
}
// Keep walking down the tree
- integrateRetainedNode(child, descendant);
+ integrateRetainedNode(child.getFqn(), descFqn);
}
}
}
Modified: core/trunk/src/main/java/org/jboss/cache/statetransfer/LegacyStateTransferIntegrator.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/statetransfer/LegacyStateTransferIntegrator.java 2008-08-06 00:56:02 UTC (rev 6523)
+++ core/trunk/src/main/java/org/jboss/cache/statetransfer/LegacyStateTransferIntegrator.java 2008-08-06 00:57:16 UTC (rev 6524)
@@ -16,6 +16,7 @@
import org.jboss.cache.NodeSPI;
import org.jboss.cache.Region;
import org.jboss.cache.buddyreplication.BuddyManager;
+import org.jboss.cache.config.Configuration;
import org.jboss.cache.eviction.EvictedEventNode;
import org.jboss.cache.eviction.NodeEventType;
import org.jboss.cache.factories.annotations.Inject;
@@ -43,24 +44,26 @@
private static final Log log = LogFactory.getLog(LegacyStateTransferIntegrator.class);
private static final boolean trace = log.isTraceEnabled();
-
private CacheSPI cache;
-
private NodeFactory factory;
-
private Set<Fqn> internalFqns;
+ private Configuration cfg;
+ private boolean usePut; // for JBCACHE-131
@Inject
- public void inject(CacheSPI<?, ?> cache, NodeFactory nodefactory)
+ public void inject(CacheSPI<?, ?> cache, NodeFactory nodefactory, Configuration cfg)
{
this.cache = cache;
this.factory = nodefactory;
+ this.cfg = cfg;
}
@Start(priority = 14)
public void start()
{
this.internalFqns = cache.getInternalFqns();
+ usePut = cfg.getCacheLoaderConfig() != null && !cfg.getCacheLoaderConfig().isFetchPersistentState() &&
+ !cfg.getCacheLoaderConfig().isShared();
}
public void integrateState(ObjectInputStream ois, Object target, Fqn targetFqn, boolean integratePersistentState) throws Exception
@@ -212,9 +215,20 @@
if (nd != null && !nd.isMarker())
{
Map attributes = nd.getAttributes();
+ if (usePut)
+ {
+ cache.getInvocationContext().getOptionOverrides().setCacheModeLocal(true);
+ cache.getInvocationContext().getOptionOverrides().setSkipCacheStatusCheck(true);
+ target.clearData();
+ cache.getInvocationContext().getOptionOverrides().setCacheModeLocal(true);
+ cache.getInvocationContext().getOptionOverrides().setSkipCacheStatusCheck(true);
+ target.putAll(attributes);
+ }
+ else
+ {
+ target.setInternalState(attributes);
+ }
- target.setInternalState(attributes);
-
// Check whether this is an integration into the buddy backup
// subtree
Fqn tferFqn = nd.getFqn();
@@ -276,16 +290,29 @@
// We handle this NodeData. Create a TreeNode and
// integrate its data
- NodeSPI target = factory.createNode(fqn, parent, attrs);
- parent.addChild(fqn.getLastElement(), target);
-
- // JBCACHE-913
- Region region = cache.getRegion(fqn, false);
- if (region != null && region.getEvictionPolicy() != null)
+ NodeSPI target;
+ if (usePut)
{
- region.putNodeEvent(new EvictedEventNode(fqn, NodeEventType.ADD_NODE_EVENT,
- attrs == null ? 0 : attrs.size()));
+ cache.getInvocationContext().getOptionOverrides().setCacheModeLocal(true);
+ cache.getInvocationContext().getOptionOverrides().setSkipCacheStatusCheck(true);
+ cache.clearData(fqn);
+ cache.getInvocationContext().getOptionOverrides().setCacheModeLocal(true);
+ cache.getInvocationContext().getOptionOverrides().setSkipCacheStatusCheck(true);
+ cache.put(fqn, attrs);
+ target = cache.getNode(fqn);
}
+ else
+ {
+ target = factory.createNode(fqn, parent, attrs);
+ parent.addChild(fqn.getLastElement(), target);
+ // JBCACHE-913
+ Region region = cache.getRegion(fqn, false);
+ if (region != null && region.getEvictionPolicy() != null)
+ {
+ region.putNodeEvent(new EvictedEventNode(fqn, NodeEventType.ADD_NODE_EVENT,
+ attrs == null ? 0 : attrs.size()));
+ }
+ }
// Recursively call, which will walk down the tree
// and return the next NodeData that's a child of our parent
Modified: core/trunk/src/main/java/org/jboss/cache/statetransfer/LegacyStateTransferManager.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/statetransfer/LegacyStateTransferManager.java 2008-08-06 00:56:02 UTC (rev 6523)
+++ core/trunk/src/main/java/org/jboss/cache/statetransfer/LegacyStateTransferManager.java 2008-08-06 00:57:16 UTC (rev 6524)
@@ -5,6 +5,7 @@
import org.jboss.cache.NodeSPI;
import org.jboss.cache.RegionEmptyException;
import org.jboss.cache.factories.annotations.Inject;
+import org.jboss.cache.factories.annotations.Start;
import org.jboss.cache.lock.LockManager;
import static org.jboss.cache.lock.LockType.READ;
import org.jboss.cache.lock.TimeoutException;
@@ -23,6 +24,7 @@
public class LegacyStateTransferManager extends DefaultStateTransferManager
{
protected LockManager lockManager;
+ private boolean usePut; // for JBCACHE-131
@Inject
public void injectLockManager(LockManager lockManager)
@@ -30,6 +32,13 @@
this.lockManager = lockManager;
}
+ @Start(priority = 14)
+ public void checkLoaders()
+ {
+ usePut = configuration.getCacheLoaderConfig() != null && !configuration.getCacheLoaderConfig().isFetchPersistentState() &&
+ !configuration.getCacheLoaderConfig().isShared();
+ }
+
@Override
public void getState(ObjectOutputStream out, Fqn fqn, long timeout, boolean force, boolean suppressErrors) throws Exception
{
@@ -136,6 +145,7 @@
protected void acquireLocksForStateTransfer(NodeSPI root, long timeout, boolean force) throws InterruptedException
{
+ if (usePut) return;
try
{
lockManager.lockAll(root, READ, getLockOwner(), timeout, true);
@@ -157,6 +167,7 @@
protected void releaseStateTransferLocks(NodeSPI root)
{
+ if (usePut) return;
try
{
lockManager.unlockAll(root, getLockOwner());
Added: core/trunk/src/test/java/org/jboss/cache/api/mvcc/PersistingTransientStateTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/api/mvcc/PersistingTransientStateTest.java (rev 0)
+++ core/trunk/src/test/java/org/jboss/cache/api/mvcc/PersistingTransientStateTest.java 2008-08-06 00:57:16 UTC (rev 6524)
@@ -0,0 +1,13 @@
+package org.jboss.cache.api.mvcc;
+
+import org.jboss.cache.config.Configuration.NodeLockingScheme;
+import org.testng.annotations.Test;
+
+@Test(groups = "functional")
+public class PersistingTransientStateTest extends org.jboss.cache.statetransfer.PersistingTransientStateTest
+{
+ public PersistingTransientStateTest()
+ {
+ nls = NodeLockingScheme.MVCC;
+ }
+}
\ No newline at end of file
Added: core/trunk/src/test/java/org/jboss/cache/optimistic/PersistingTransientStateTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/optimistic/PersistingTransientStateTest.java (rev 0)
+++ core/trunk/src/test/java/org/jboss/cache/optimistic/PersistingTransientStateTest.java 2008-08-06 00:57:16 UTC (rev 6524)
@@ -0,0 +1,13 @@
+package org.jboss.cache.optimistic;
+
+import org.jboss.cache.config.Configuration.NodeLockingScheme;
+import org.testng.annotations.Test;
+
+@Test(groups = "functional")
+public class PersistingTransientStateTest extends org.jboss.cache.statetransfer.PersistingTransientStateTest
+{
+ public PersistingTransientStateTest()
+ {
+ nls = NodeLockingScheme.OPTIMISTIC;
+ }
+}
Added: core/trunk/src/test/java/org/jboss/cache/statetransfer/PersistingTransientStateTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/statetransfer/PersistingTransientStateTest.java (rev 0)
+++ core/trunk/src/test/java/org/jboss/cache/statetransfer/PersistingTransientStateTest.java 2008-08-06 00:57:16 UTC (rev 6524)
@@ -0,0 +1,113 @@
+package org.jboss.cache.statetransfer;
+
+import org.jboss.cache.Cache;
+import org.jboss.cache.CacheFactory;
+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.CacheLoaderConfig.IndividualCacheLoaderConfig;
+import org.jboss.cache.config.Configuration;
+import org.jboss.cache.config.Configuration.CacheMode;
+import org.jboss.cache.config.Configuration.NodeLockingScheme;
+import org.jboss.cache.loader.CacheLoader;
+import org.jboss.cache.loader.DummyInMemoryCacheLoader;
+import org.jboss.cache.transaction.DummyTransactionManagerLookup;
+import org.jboss.cache.util.TestingUtil;
+import org.testng.annotations.Test;
+
+/**
+ * Transient state SHOULD be persisted on the receiving cache IF fetchPersistentState is FALSE and the cache loader
+ * is NOT shared.
+ * <p/>
+ * Needs to be tested with PL, OL and MVCC.
+ * <p/>
+ * Pertains to JBCACHE-131
+ * <p/>
+ */
+@Test(groups = "functional")
+public class PersistingTransientStateTest
+{
+ protected NodeLockingScheme nls = NodeLockingScheme.PESSIMISTIC;
+ protected Fqn fqn = Fqn.fromString("/a/b/c");
+ protected String k = "k", v = "v";
+
+ public void testPersistentStateTransfer() throws Exception
+ {
+ Cache<String, String> c1 = null, c2 = null;
+ try
+ {
+ CacheFactory<String, String> cf = new DefaultCacheFactory<String, String>();
+ Configuration cfg = new Configuration();
+ cfg.setTransactionManagerLookupClass(DummyTransactionManagerLookup.class.getName());
+ cfg.setCacheMode(CacheMode.REPL_SYNC);
+ cfg.setFetchInMemoryState(true);
+ // configure with CL
+ IndividualCacheLoaderConfig iclc = new IndividualCacheLoaderConfig();
+ iclc.setClassName(DummyInMemoryCacheLoader.class.getName());
+ iclc.setFetchPersistentState(false);
+ CacheLoaderConfig clc = new CacheLoaderConfig();
+ clc.addIndividualCacheLoaderConfig(iclc);
+
+ cfg.setCacheLoaderConfig(clc);
+ cfg.setNodeLockingScheme(nls);
+
+ c1 = cf.createCache(cfg.clone());
+ c1.put(fqn, k, v);
+
+ assert c1.get(fqn, k).equals(v);
+ assert getLoader(c1).get(fqn).get(k).equals(v);
+
+ c2 = cf.createCache(cfg.clone());
+ assert c2.get(fqn, k).equals(v);
+ assert getLoader(c2).get(fqn).get(k).equals(v);
+ }
+ finally
+ {
+ TestingUtil.killCaches(c1, c2);
+ }
+ }
+
+ public void testPersistentStateTransferShared() throws Exception
+ {
+ Cache<String, String> c1 = null, c2 = null;
+ try
+ {
+ CacheFactory<String, String> cf = new DefaultCacheFactory<String, String>();
+ Configuration cfg = new Configuration();
+ cfg.setTransactionManagerLookupClass(DummyTransactionManagerLookup.class.getName());
+ cfg.setCacheMode(CacheMode.REPL_SYNC);
+ cfg.setFetchInMemoryState(true);
+ // configure with CL
+ IndividualCacheLoaderConfig iclc = new IndividualCacheLoaderConfig();
+ iclc.setClassName(DummyInMemoryCacheLoader.class.getName());
+ iclc.setFetchPersistentState(false);
+ CacheLoaderConfig clc = new CacheLoaderConfig();
+ clc.addIndividualCacheLoaderConfig(iclc);
+ clc.setShared(true); // even though it isn't really a shared CL
+
+ cfg.setCacheLoaderConfig(clc);
+ cfg.setNodeLockingScheme(nls);
+
+ c1 = cf.createCache(cfg.clone());
+ c1.put(fqn, k, v);
+
+ assert c1.get(fqn, k).equals(v);
+ assert getLoader(c1).get(fqn).get(k).equals(v);
+
+ c2 = cf.createCache(cfg.clone());
+ assert c2.get(fqn, k).equals(v);
+ assert getLoader(c2).get(fqn) == null;
+ }
+ finally
+ {
+ TestingUtil.killCaches(c1, c2);
+ }
+ }
+
+ protected CacheLoader getLoader(Cache<?, ?> c)
+ {
+ return ((CacheSPI) c).getCacheLoaderManager().getCacheLoader();
+ }
+
+}
16 years, 5 months
JBoss Cache SVN: r6523 - core/trunk/src/main/java/org/jboss/cache/interceptors.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-08-05 20:56:02 -0400 (Tue, 05 Aug 2008)
New Revision: 6523
Modified:
core/trunk/src/main/java/org/jboss/cache/interceptors/TxInterceptor.java
Log:
Null chk
Modified: core/trunk/src/main/java/org/jboss/cache/interceptors/TxInterceptor.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/interceptors/TxInterceptor.java 2008-08-05 23:01:18 UTC (rev 6522)
+++ core/trunk/src/main/java/org/jboss/cache/interceptors/TxInterceptor.java 2008-08-06 00:56:02 UTC (rev 6523)
@@ -1114,7 +1114,7 @@
if (ctx == null) ctx = invocationContextContainer.get();
ctx.setLocalRollbackOnly(localRollbackOnly);
setTransactionalContext(tx, gtx, transactionContext, ctx);
- ctx.setOptionOverrides(transactionalOptions);
+ if (transactionalOptions != null) ctx.setOptionOverrides(transactionalOptions);
try
{
super.afterCompletion(status);
16 years, 5 months
JBoss Cache SVN: r6522 - benchmarks/benchmark-fwk/trunk.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-08-05 19:01:18 -0400 (Tue, 05 Aug 2008)
New Revision: 6522
Modified:
benchmarks/benchmark-fwk/trunk/build.xml
Log:
Modified: benchmarks/benchmark-fwk/trunk/build.xml
===================================================================
--- benchmarks/benchmark-fwk/trunk/build.xml 2008-08-05 22:59:47 UTC (rev 6521)
+++ benchmarks/benchmark-fwk/trunk/build.xml 2008-08-05 23:01:18 UTC (rev 6522)
@@ -102,7 +102,7 @@
</target>
<target name="compile.module.coherence331" depends="compile.module.framework"
- description="Compile module coherence331; production classes">
+ description="Compile module coherence331; production classes" if="coherence.jars.present">
<mkdir dir="./classes/production/coherence-3.3.1"/>
<javac destdir="./classes/production/coherence-3.3.1" debug="${compiler.debug}"
nowarn="${compiler.generate.no.warnings}" fork="true">
16 years, 5 months
JBoss Cache SVN: r6521 - benchmarks/benchmark-fwk/trunk.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-08-05 18:59:47 -0400 (Tue, 05 Aug 2008)
New Revision: 6521
Modified:
benchmarks/benchmark-fwk/trunk/runAllLocal.sh
Log:
Modified: benchmarks/benchmark-fwk/trunk/runAllLocal.sh
===================================================================
--- benchmarks/benchmark-fwk/trunk/runAllLocal.sh 2008-08-05 16:32:58 UTC (rev 6520)
+++ benchmarks/benchmark-fwk/trunk/runAllLocal.sh 2008-08-05 22:59:47 UTC (rev 6521)
@@ -5,17 +5,16 @@
jdk=java5
rm -rf ./output/*
export PLAIN_JVM_OPTIONS="${JVM_OPTIONS} -DcacheBenchFwk.fwkCfgFile=cachebench-local.xml -Xms2g -Xmx2g"
-unset JVM_OPTIONS && export JVM_OPTIONS=${PLAIN_JVM_OPTIONS}
-./runLocalNode.sh jbosscache-2.2.0 pess-local.xml
+unset JVM_OPTIONS && export JVM_OPTIONS="${PLAIN_JVM_OPTIONS} -DcacheBenchFwk.productSuffix=.CR7"
+./runLocalNode.sh jbosscache-2.2.0 pess-local-RR.xml
+./runLocalNode.sh jbosscache-2.2.0 pess-local-RC.xml
+unset JVM_OPTIONS && export JVM_OPTIONS="${PLAIN_JVM_OPTIONS} -DcacheBenchFwk.productSuffix=.ALPHA2"
./runLocalNode.sh jbosscache-3.0.0 mvcc-local-RR.xml
./runLocalNode.sh jbosscache-3.0.0 mvcc-local-RC.xml
-unset JVM_OPTIONS && export JVM_OPTIONS="${PLAIN_JVM_OPTIONS} -cacheBenchFwk.useFlatCache=true -cacheBenchFwk.productSuffix=FlatCache"
-./runLocalNode.sh jbosscache-3.0.0 mvcc-local-RR.xml
-./runLocalNode.sh jbosscache-3.0.0 mvcc-local-RC.xml
unset JVM_OPTIONS && export JVM_OPTIONS=${PLAIN_JVM_OPTIONS}
-./runLocalNode.sh jbosscache-2.2.0 pess-local-NONE.xml
+./runLocalNode.sh jbosscache-2.1.0 pess-local-RR.xml
+./runLocalNode.sh jbosscache-2.1.0 pess-local-RC.xml
./runLocalNode.sh ehcache-1.5.0 ehcache-local.xml
-./runLocalNode.sh coherence-3.3.1 local-default.xml
mkdir output
mv data* ./output
16 years, 5 months
JBoss Cache SVN: r6520 - benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-3.0.0/lib.
by jbosscache-commits@lists.jboss.org
Author: mircea.markus
Date: 2008-08-05 12:32:58 -0400 (Tue, 05 Aug 2008)
New Revision: 6520
Modified:
benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-3.0.0/lib/jbosscache-core.jar
Log:
updated jbc distro
Modified: benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-3.0.0/lib/jbosscache-core.jar
===================================================================
(Binary files differ)
16 years, 5 months
JBoss Cache SVN: r6519 - benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-2.2.0/conf.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-08-05 11:49:55 -0400 (Tue, 05 Aug 2008)
New Revision: 6519
Added:
benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-2.2.0/conf/pess-local-RC.xml
benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-2.2.0/conf/pess-local-RR.xml
Log:
Added RR and RC
Added: benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-2.2.0/conf/pess-local-RC.xml
===================================================================
--- benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-2.2.0/conf/pess-local-RC.xml (rev 0)
+++ benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-2.2.0/conf/pess-local-RC.xml 2008-08-05 15:49:55 UTC (rev 6519)
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- ===================================================================== -->
+<!-- -->
+<!-- Sample for total replication. -->
+<!-- -->
+<!-- ===================================================================== -->
+
+<server>
+
+ <classpath codebase="./lib" archives="jboss-cache.jar, jgroups.jar"/>
+
+
+ <!-- ==================================================================== -->
+ <!-- Defines TreeCache configuration -->
+ <!-- ==================================================================== -->
+
+ <mbean code="org.jboss.cache.jmx.CacheJmxWrapper"
+ name="jboss.cache:service=testTreeCache">
+
+ <depends>jboss:service=Naming</depends>
+ <depends>jboss:service=TransactionManager</depends>
+
+ <!--
+ Configure the TransactionManager
+ -->
+ <attribute name="TransactionManagerLookupClass">org.jboss.cache.transaction.GenericTransactionManagerLookup
+ </attribute>
+
+
+ <!--
+ Node locking level : SERIALIZABLE
+ REPEATABLE_READ (default)
+ READ_COMMITTED
+ READ_UNCOMMITTED
+ NONE
+ -->
+ <attribute name="IsolationLevel">READ_COMMITTED</attribute>
+
+ <!--
+ Valid modes are LOCAL
+ REPL_ASYNC
+ REPL_SYNC
+ INVALIDATION_ASYNC
+ INVALIDATION_SYNC
+ -->
+ <attribute name="CacheMode">LOCAL</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>
+ <!--
+ 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">20000</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>
+ </mbean>
+</server>
Added: benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-2.2.0/conf/pess-local-RR.xml
===================================================================
--- benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-2.2.0/conf/pess-local-RR.xml (rev 0)
+++ benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-2.2.0/conf/pess-local-RR.xml 2008-08-05 15:49:55 UTC (rev 6519)
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- ===================================================================== -->
+<!-- -->
+<!-- Sample for total replication. -->
+<!-- -->
+<!-- ===================================================================== -->
+
+<server>
+
+ <classpath codebase="./lib" archives="jboss-cache.jar, jgroups.jar"/>
+
+
+ <!-- ==================================================================== -->
+ <!-- Defines TreeCache configuration -->
+ <!-- ==================================================================== -->
+
+ <mbean code="org.jboss.cache.jmx.CacheJmxWrapper"
+ name="jboss.cache:service=testTreeCache">
+
+ <depends>jboss:service=Naming</depends>
+ <depends>jboss:service=TransactionManager</depends>
+
+ <!--
+ Configure the TransactionManager
+ -->
+ <attribute name="TransactionManagerLookupClass">org.jboss.cache.transaction.GenericTransactionManagerLookup
+ </attribute>
+
+
+ <!--
+ Node locking 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">LOCAL</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>
+ <!--
+ 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">20000</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>
+ </mbean>
+</server>
16 years, 5 months
JBoss Cache SVN: r6518 - benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-2.1.0/conf.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-08-05 11:49:20 -0400 (Tue, 05 Aug 2008)
New Revision: 6518
Added:
benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-2.1.0/conf/pess-local-RC.xml
benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-2.1.0/conf/pess-local-RR.xml
Log:
Added RR and RC
Added: benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-2.1.0/conf/pess-local-RC.xml
===================================================================
--- benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-2.1.0/conf/pess-local-RC.xml (rev 0)
+++ benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-2.1.0/conf/pess-local-RC.xml 2008-08-05 15:49:20 UTC (rev 6518)
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- ===================================================================== -->
+<!-- -->
+<!-- Sample for total replication. -->
+<!-- -->
+<!-- ===================================================================== -->
+
+<server>
+
+ <classpath codebase="./lib" archives="jboss-cache.jar, jgroups.jar"/>
+
+
+ <!-- ==================================================================== -->
+ <!-- Defines TreeCache configuration -->
+ <!-- ==================================================================== -->
+
+ <mbean code="org.jboss.cache.jmx.CacheJmxWrapper"
+ name="jboss.cache:service=testTreeCache">
+
+ <depends>jboss:service=Naming</depends>
+ <depends>jboss:service=TransactionManager</depends>
+
+ <!--
+ Configure the TransactionManager
+ -->
+ <attribute name="TransactionManagerLookupClass">org.jboss.cache.transaction.GenericTransactionManagerLookup
+ </attribute>
+
+
+ <!--
+ Node locking level : SERIALIZABLE
+ REPEATABLE_READ (default)
+ READ_COMMITTED
+ READ_UNCOMMITTED
+ NONE
+ -->
+ <attribute name="IsolationLevel">READ_COMMITTED</attribute>
+
+ <!--
+ Valid modes are LOCAL
+ REPL_ASYNC
+ REPL_SYNC
+ INVALIDATION_ASYNC
+ INVALIDATION_SYNC
+ -->
+ <attribute name="CacheMode">LOCAL</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>
+ <!--
+ 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">20000</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>
+ </mbean>
+</server>
Added: benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-2.1.0/conf/pess-local-RR.xml
===================================================================
--- benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-2.1.0/conf/pess-local-RR.xml (rev 0)
+++ benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-2.1.0/conf/pess-local-RR.xml 2008-08-05 15:49:20 UTC (rev 6518)
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- ===================================================================== -->
+<!-- -->
+<!-- Sample for total replication. -->
+<!-- -->
+<!-- ===================================================================== -->
+
+<server>
+
+ <classpath codebase="./lib" archives="jboss-cache.jar, jgroups.jar"/>
+
+
+ <!-- ==================================================================== -->
+ <!-- Defines TreeCache configuration -->
+ <!-- ==================================================================== -->
+
+ <mbean code="org.jboss.cache.jmx.CacheJmxWrapper"
+ name="jboss.cache:service=testTreeCache">
+
+ <depends>jboss:service=Naming</depends>
+ <depends>jboss:service=TransactionManager</depends>
+
+ <!--
+ Configure the TransactionManager
+ -->
+ <attribute name="TransactionManagerLookupClass">org.jboss.cache.transaction.GenericTransactionManagerLookup
+ </attribute>
+
+
+ <!--
+ Node locking 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">LOCAL</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>
+ <!--
+ 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">20000</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>
+ </mbean>
+</server>
16 years, 5 months