Java Doc for RMICacheReplicatorTest.java in  » Cache » ehcache » net » sf » ehcache » distribution » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Cache » ehcache » net.sf.ehcache.distribution 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


net.sf.ehcache.AbstractCacheTest
   net.sf.ehcache.distribution.RMICacheReplicatorTest

RMICacheReplicatorTest
public class RMICacheReplicatorTest extends AbstractCacheTest (Code)
Tests replication of Cache events

Note these tests need a live network interface running in multicast mode to work

If running involving RMIAsynchronousCacheReplicator individually the test will fail because the VM will gobble up the SoftReferences rather than allocating more memory. Uncomment the forceVMGrowth() method usage in setup.
author:
   Greg Luck
version:
   $Id: RMICacheReplicatorTest.java 575 2008-01-30 07:22:04Z gregluck $


Inner Class :class ClusterExecutable implements Executable

Field Summary
final protected static  booleanASYNCHRONOUS
    
final protected static  booleanSYNCHRONOUS
    
protected  Ehcachecache1
    
protected  Ehcachecache2
    
protected  StringcacheName
    
protected  StringcacheNameBase
    
protected  CacheManagermanager1
    
protected  CacheManagermanager2
    
protected  CacheManagermanager3
    
protected  CacheManagermanager4
    
protected  CacheManagermanager5
    
protected  CacheManagermanager6
    


Method Summary
protected  intgetNumberOfReplicatingCachesInCacheManager()
     The number of caches there should be.
public static  voidmain(String[] args)
    
public  voidmanualStabilityTest()
     Enables long stabilty runs using replication to be done.
public  voidputTest(Ehcache fromCache, Ehcache toCache, boolean asynchronous)
     Tests put and remove initiated from cache1 in a cluster

This test goes into an infinite loop if the chain of notifications is not somehow broken.

public  voidputTestWithThreadKiller(Ehcache fromCache, Ehcache toCache, boolean asynchronous)
     Tests put and remove initiated from cache1 in a cluster

This test goes into an infinite loop if the chain of notifications is not somehow broken.

public  voidremoveAllTest(Ehcache fromCache, Ehcache toCache, boolean asynchronous)
     Tests removeAll initiated from a cache to another cache in a cluster

This test goes into an infinite loop if the chain of notifications is not somehow broken.

public  voidremoveTest(Ehcache fromCache, Ehcache toCache, boolean asynchronous)
     Tests put and remove initiated from a cache to another cache in a cluster

This test goes into an infinite loop if the chain of notifications is not somehow broken.

protected  voidsetUp()
     Sets up two caches: cache1 is local.
protected  voidtearDown()
    
public  voidtestBigPutsProgagatesAsynchronous()
     Performance and capacity tests.

The numbers given are for the remote peer tester (java -jar ehcache-1.x-remote-debugger.jar ehcache-distributed1.xml) running on a 10Mbit ethernet network and are measured from the time the peer starts receiving to when it has fully received.

r37 and earlier - initial implementation 38 seconds to get all notifications with 6 peers, 2000 Elements and 400 byte payload 18 seconds to get all notifications with 2 peers, 2000 Elements and 400 byte payload 40 seconds to get all notifications with 2 peers, 2000 Elements and 10k payload 22 seconds to get all notifications with 2 peers, 2000 Elements and 1k payload 26 seconds to get all notifications with 2 peers, 200 Elements and 100k payload

r38 - RMI stub lookup on registration rather than at each lookup.

public  voidtestBigPutsProgagatesSynchronous()
     Performance and capacity tests.
public  voidtestBigRemovesProgagatesAsynchronous()
     Performance and capacity tests.
public  voidtestBootstrap()
     Performance and capacity tests.
public  voidtestCacheOperationsAynchronousMultiThreaded()
     Distributed operations create extra scope for deadlock. This test checks whether a distributed deadlock scenario exists for asynchronous replication of each distributed operation all at once. It shows that no distributed deadlock exists for asynchronous replication.
public  voidtestCacheOperationsSynchronousMultiThreaded()
     Distributed operations create extra scope for deadlock. This test checks whether a distributed deadlock scenario exists for synchronous replication of each distributed operation all at once. It shows that no distributed deadlock exists for asynchronous replication.
public  voidtestInfiniteNotificationsLoop()
    
public  voidtestPutProgagatesFromAndToEveryCacheManagerAndCache()
     Tests put and remove initiated from cache1 in a cluster

This test goes into an infinite loop if the chain of notifications is not somehow broken.

public  voidtestPutProgagatesFromAndToEveryCacheManagerAndCacheDirty()
     Tests what happens when a CacheManager in the cluster comes and goes.
public  voidtestPutWithEmptyReplicationPropertiesConfig()
     Test put replicated for cache4 - no properties.
public  voidtestPutWithExplicitReplicationConfig()
    
public  voidtestPutWithExplicitReplicationSynchronousConfig()
    
public  voidtestPutWithNewCacheAddedProgressively()
     manager1 adds a replicating cache, then manager2 and so on.
public  voidtestPutWithOneMissingReplicationPropertyConfig()
     Test put replicated for cache4 - missing replicatePuts property.
public  voidtestPutWithThreadKiller()
    
public  voidtestRemoteCachePeersDetectsDownCacheManager()
    
public  voidtestRemoteCachePeersDetectsDownCacheManagerSlow()
    
public  voidtestRemoteCachePeersDetectsNewCacheManager()
    
public  voidtestRemoteCachePeersEqualsNumberOfCacheManagersInCluster()
    
public  voidtestRemotePutNotificationGetsToOtherListeners()
     Checks that a put received from a remote cache notifies any registered listeners.
public  voidtestRemotelyReceivedPutNotifiesCountingListener()
     CacheEventListeners that are not CacheReplicators should receive cache events originated from receipt of a remote event by a CachePeer.
public  voidtestRemoveAllAsynchronous()
    
public  voidtestRemoveAllSynchronous()
    
public  voidtestRemoveWithEmptyReplicationPropertiesConfig()
     Test put replicated for cache4 - no properties.
public  voidtestRemoveWithExplicitReplicationConfig()
    
public  voidtestRemoveWithExplicitReplicationSynchronousConfig()
    
public  voidtestReplicatePerf()
     Shows result of perf problem and fix in flushReplicationQueue

Behaviour before change:

INFO: Items written: 10381 Oct 29, 2007 11:40:04 AM net.sf.ehcache.distribution.RMICacheReplicatorTest testReplicatePerf INFO: Items written: 29712 Oct 29, 2007 11:40:57 AM net.sf.ehcache.distribution.RMICacheReplicatorTest testReplicatePerf INFO: Items written: 1 Oct 29, 2007 11:40:58 AM net.sf.ehcache.distribution.RMICacheReplicatorTest testReplicatePerf INFO: Items written: 32354 Oct 29, 2007 11:42:34 AM net.sf.ehcache.distribution.RMICacheReplicatorTest testReplicatePerf INFO: Items written: 322 Oct 29, 2007 11:42:35 AM net.sf.ehcache.distribution.RMICacheReplicatorTest testReplicatePerf INFO: Items written: 41909

Behaviour after change: INFO: Items written: 26356 Oct 29, 2007 11:44:39 AM net.sf.ehcache.distribution.RMICacheReplicatorTest testReplicatePerf INFO: Items written: 33656 Oct 29, 2007 11:44:40 AM net.sf.ehcache.distribution.RMICacheReplicatorTest testReplicatePerf INFO: Items written: 32234 Oct 29, 2007 11:44:42 AM net.sf.ehcache.distribution.RMICacheReplicatorTest testReplicatePerf INFO: Items written: 38677 Oct 29, 2007 11:44:43 AM net.sf.ehcache.distribution.RMICacheReplicatorTest testReplicatePerf INFO: Items written: 43418 Oct 29, 2007 11:44:44 AM net.sf.ehcache.distribution.RMICacheReplicatorTest testReplicatePerf INFO: Items written: 31277 Oct 29, 2007 11:44:45 AM net.sf.ehcache.distribution.RMICacheReplicatorTest testReplicatePerf INFO: Items written: 27769 Oct 29, 2007 11:44:46 AM net.sf.ehcache.distribution.RMICacheReplicatorTest testReplicatePerf INFO: Items written: 29596 Oct 29, 2007 11:44:47 AM net.sf.ehcache.distribution.RMICacheReplicatorTest testReplicatePerf INFO: Items written: 17142 Oct 29, 2007 11:44:48 AM net.sf.ehcache.distribution.RMICacheReplicatorTest testReplicatePerf INFO: Items written: 14775 Oct 29, 2007 11:44:49 AM net.sf.ehcache.distribution.RMICacheReplicatorTest testReplicatePerf INFO: Items written: 4088 Oct 29, 2007 11:44:51 AM net.sf.ehcache.distribution.RMICacheReplicatorTest testReplicatePerf INFO: Items written: 5492 Oct 29, 2007 11:44:52 AM net.sf.ehcache.distribution.RMICacheReplicatorTest testReplicatePerf INFO: Items written: 10188 Also no pauses noted.

public  voidtestUpdateViaInvalidate()
     Tests put and update through invalidation initiated from cache1 in a cluster

This test goes into an infinite loop if the chain of notifications is not somehow broken.

public  voidtestUpdateWithEmptyReplicationPropertiesConfig()
     Test put replicated for cache4 - no properties.
public  voidtestUpdateWithExplicitReplicationConfig()
    
public  voidtestUpdateWithExplicitReplicationSynchronousConfig()
    
public  voidupdateViaCopyTest(Ehcache fromCache, Ehcache toCache, boolean asynchronous)
     Tests put and update through copy initiated from cache1 in a cluster

This test goes into an infinite loop if the chain of notifications is not somehow broken.

protected  voidwaitForProgagate()
    
protected  voidwaitForSlowProgagate()
    
public  voidxTestHugePutsBreaksAsynchronous()
     Drive everything to point of breakage within a 64MB VM.

Field Detail
ASYNCHRONOUS
final protected static boolean ASYNCHRONOUS(Code)
A value to represent replicate asynchronously



SYNCHRONOUS
final protected static boolean SYNCHRONOUS(Code)
A value to represent replicate synchronously



cache1
protected Ehcache cache1(Code)
CacheManager 1 of 2s cache being replicated



cache2
protected Ehcache cache2(Code)
CacheManager 2 of 2s cache being replicated



cacheName
protected String cacheName(Code)
The name of the cache under test



cacheNameBase
protected String cacheNameBase(Code)
Allows setup to be the same



manager1
protected CacheManager manager1(Code)
CacheManager 1 in the cluster



manager2
protected CacheManager manager2(Code)
CacheManager 2 in the cluster



manager3
protected CacheManager manager3(Code)
CacheManager 3 in the cluster



manager4
protected CacheManager manager4(Code)
CacheManager 4 in the cluster



manager5
protected CacheManager manager5(Code)
CacheManager 5 in the cluster



manager6
protected CacheManager manager6(Code)
CacheManager 6 in the cluster





Method Detail
getNumberOfReplicatingCachesInCacheManager
protected int getNumberOfReplicatingCachesInCacheManager()(Code)
The number of caches there should be.



main
public static void main(String[] args) throws Exception(Code)
Non JUnit invocation of stability test to get cleaner run
Parameters:
  args -
throws:
  InterruptedException -



manualStabilityTest
public void manualStabilityTest() throws InterruptedException(Code)
Enables long stabilty runs using replication to be done.

This test has been run in a profile for 15 hours without any observed issues.
throws:
  InterruptedException -




putTest
public void putTest(Ehcache fromCache, Ehcache toCache, boolean asynchronous) throws CacheException, InterruptedException(Code)
Tests put and remove initiated from cache1 in a cluster

This test goes into an infinite loop if the chain of notifications is not somehow broken.




putTestWithThreadKiller
public void putTestWithThreadKiller(Ehcache fromCache, Ehcache toCache, boolean asynchronous) throws CacheException, InterruptedException(Code)
Tests put and remove initiated from cache1 in a cluster

This test goes into an infinite loop if the chain of notifications is not somehow broken.




removeAllTest
public void removeAllTest(Ehcache fromCache, Ehcache toCache, boolean asynchronous) throws Exception(Code)
Tests removeAll initiated from a cache to another cache in a cluster

This test goes into an infinite loop if the chain of notifications is not somehow broken.




removeTest
public void removeTest(Ehcache fromCache, Ehcache toCache, boolean asynchronous) throws CacheException, InterruptedException(Code)
Tests put and remove initiated from a cache to another cache in a cluster

This test goes into an infinite loop if the chain of notifications is not somehow broken.




setUp
protected void setUp() throws Exception(Code)
Sets up two caches: cache1 is local. cache2 is to be receive updates
throws:
  Exception -



tearDown
protected void tearDown() throws Exception(Code)

throws:
  Exception -



testBigPutsProgagatesAsynchronous
public void testBigPutsProgagatesAsynchronous() throws CacheException, InterruptedException(Code)
Performance and capacity tests.

The numbers given are for the remote peer tester (java -jar ehcache-1.x-remote-debugger.jar ehcache-distributed1.xml) running on a 10Mbit ethernet network and are measured from the time the peer starts receiving to when it has fully received.

r37 and earlier - initial implementation 38 seconds to get all notifications with 6 peers, 2000 Elements and 400 byte payload 18 seconds to get all notifications with 2 peers, 2000 Elements and 400 byte payload 40 seconds to get all notifications with 2 peers, 2000 Elements and 10k payload 22 seconds to get all notifications with 2 peers, 2000 Elements and 1k payload 26 seconds to get all notifications with 2 peers, 200 Elements and 100k payload

r38 - RMI stub lookup on registration rather than at each lookup. Saves quite a few lookups. Also change to 5 second heartbeat 38 seconds to get 2000 notifications with 6 peers, Elements with 400 byte payload (1 second heartbeat) 16 seconds to get 2000 notifications with 6 peers, Elements with 400 byte payload (5 second heartbeat) 13 seconds to get 2000 notifications with 2 peers, Elements with 400 byte payload

r39 - Batching asyn replicator. Send all queued messages in one RMI call once per second. 2 seconds to get 2000 notifications with 6 peers, Elements with 400 byte payload (5 second heartbeat)




testBigPutsProgagatesSynchronous
public void testBigPutsProgagatesSynchronous() throws CacheException, InterruptedException(Code)
Performance and capacity tests.

5 seconds to send all notifications synchronously with 5 peers, 2000 Elements and 400 byte payload The numbers given below are for the remote peer tester (java -jar ehcache-1.x-remote-debugger.jar ehcache-distributed1.xml) running on a 10Mbit ethernet network and are measured from the time the peer starts receiving to when it has fully received.




testBigRemovesProgagatesAsynchronous
public void testBigRemovesProgagatesAsynchronous() throws CacheException, InterruptedException(Code)
Performance and capacity tests.

The numbers given are for the remote peer tester (java -jar ehcache-1.x-remote-debugger.jar ehcache-distributed1.xml) running on a 10Mbit ethernet network and are measured from the time the peer starts receiving to when it has fully received.

4 seconds to get all remove notifications with 6 peers, 5000 Elements and 400 byte payload




testBootstrap
public void testBootstrap() throws CacheException, InterruptedException, RemoteException(Code)
Performance and capacity tests.




testCacheOperationsAynchronousMultiThreaded
public void testCacheOperationsAynchronousMultiThreaded() throws Exception, InterruptedException(Code)
Distributed operations create extra scope for deadlock. This test checks whether a distributed deadlock scenario exists for asynchronous replication of each distributed operation all at once. It shows that no distributed deadlock exists for asynchronous replication. It is multi thread and multi process safe. It uses sampleCache2, which is configured to be asynchronous

Carefully tailored to exercise:

  1. overflow to disk. We put in 20 things and the memory size is 10
  2. each peer is working on the same set of keys thus maximising contention
  3. we do puts, gets and removes to explore all the execution paths



testCacheOperationsSynchronousMultiThreaded
public void testCacheOperationsSynchronousMultiThreaded() throws Exception, InterruptedException(Code)
Distributed operations create extra scope for deadlock. This test checks whether a distributed deadlock scenario exists for synchronous replication of each distributed operation all at once. It shows that no distributed deadlock exists for asynchronous replication. It is multi thread and multi process safe.

Carefully tailored to exercise:

  1. overflow to disk. We put in 20 things and the memory size is 10
  2. each peer is working on the same set of keys thus maximising contention
  3. we do puts, gets and removes to explore all the execution paths
If a deadlock occurs, processing will stop until a SocketTimeout exception is thrown and the deadlock will be released.



testInfiniteNotificationsLoop
public void testInfiniteNotificationsLoop() throws InterruptedException(Code)
What happens when two cache instances replicate to each other and a change is initiated



testPutProgagatesFromAndToEveryCacheManagerAndCache
public void testPutProgagatesFromAndToEveryCacheManagerAndCache() throws CacheException, InterruptedException(Code)
Tests put and remove initiated from cache1 in a cluster

This test goes into an infinite loop if the chain of notifications is not somehow broken.




testPutProgagatesFromAndToEveryCacheManagerAndCacheDirty
public void testPutProgagatesFromAndToEveryCacheManagerAndCacheDirty() throws CacheException, InterruptedException(Code)
Tests what happens when a CacheManager in the cluster comes and goes. In ehcache-1.2.4 this would cause the new RMI CachePeers in the CacheManager to be permanently corrupt.



testPutWithEmptyReplicationPropertiesConfig
public void testPutWithEmptyReplicationPropertiesConfig() throws InterruptedException(Code)
Test put replicated for cache4 - no properties. Defaults should be replicateAsynchronously=true, replicatePuts=true, replicateUpdates=true, replicateUpdatesViaCopy=true, replicateRemovals=true



testPutWithExplicitReplicationConfig
public void testPutWithExplicitReplicationConfig() throws InterruptedException(Code)
Test various cache configurations for cache1 - explicit setting of: properties="replicateAsynchronously=true, replicatePuts=true, replicateUpdates=true, replicateUpdatesViaCopy=true, replicateRemovals=true "/>



testPutWithExplicitReplicationSynchronousConfig
public void testPutWithExplicitReplicationSynchronousConfig() throws InterruptedException(Code)
Test various cache configurations for cache1 - explicit setting of: properties="replicateAsynchronously=false, replicatePuts=true, replicateUpdates=true, replicateUpdatesViaCopy=true, replicateRemovals=true "/>



testPutWithNewCacheAddedProgressively
public void testPutWithNewCacheAddedProgressively() throws InterruptedException(Code)
manager1 adds a replicating cache, then manager2 and so on. Then we remove one. Does everything work as expected?



testPutWithOneMissingReplicationPropertyConfig
public void testPutWithOneMissingReplicationPropertyConfig() throws InterruptedException(Code)
Test put replicated for cache4 - missing replicatePuts property. replicateAsynchronously=true, replicatePuts=true, replicateUpdates=true, replicateUpdatesViaCopy=true, replicateRemovals=true should equal replicateAsynchronously=true, replicateUpdates=true, replicateUpdatesViaCopy=true, replicateRemovals=true



testPutWithThreadKiller
public void testPutWithThreadKiller() throws InterruptedException(Code)
Test various cache configurations for cache1 - explicit setting of: properties="replicateAsynchronously=true, replicatePuts=true, replicateUpdates=true, replicateUpdatesViaCopy=true, replicateRemovals=true "/>



testRemoteCachePeersDetectsDownCacheManager
public void testRemoteCachePeersDetectsDownCacheManager() throws InterruptedException(Code)
Does a down cache manager in the cluster get removed?



testRemoteCachePeersDetectsDownCacheManagerSlow
public void testRemoteCachePeersDetectsDownCacheManagerSlow() throws InterruptedException(Code)
Does a down cache manager in the cluster get removed?



testRemoteCachePeersDetectsNewCacheManager
public void testRemoteCachePeersDetectsNewCacheManager() throws InterruptedException(Code)
Does a new cache manager in the cluster get detected?



testRemoteCachePeersEqualsNumberOfCacheManagersInCluster
public void testRemoteCachePeersEqualsNumberOfCacheManagersInCluster()(Code)
5 cache managers should means that each cache has four remote peers



testRemotePutNotificationGetsToOtherListeners
public void testRemotePutNotificationGetsToOtherListeners() throws CacheException, InterruptedException(Code)
Checks that a put received from a remote cache notifies any registered listeners.

This test goes into an infinite loop if the chain of notifications is not somehow broken.




testRemotelyReceivedPutNotifiesCountingListener
public void testRemotelyReceivedPutNotifiesCountingListener() throws InterruptedException(Code)
CacheEventListeners that are not CacheReplicators should receive cache events originated from receipt of a remote event by a CachePeer.



testRemoveAllAsynchronous
public void testRemoveAllAsynchronous() throws Exception(Code)
test removeAll sync



testRemoveAllSynchronous
public void testRemoveAllSynchronous() throws Exception(Code)
test removeAll async



testRemoveWithEmptyReplicationPropertiesConfig
public void testRemoveWithEmptyReplicationPropertiesConfig() throws InterruptedException(Code)
Test put replicated for cache4 - no properties. Defaults should be replicateAsynchronously=true, replicatePuts=true, replicateUpdates=true, replicateUpdatesViaCopy=true, replicateRemovals=true



testRemoveWithExplicitReplicationConfig
public void testRemoveWithExplicitReplicationConfig() throws InterruptedException(Code)
Test various cache configurations for cache1 - explicit setting of: properties="replicateAsynchronously=true, replicatePuts=true, replicateUpdates=true, replicateUpdatesViaCopy=true, replicateRemovals=true "/>



testRemoveWithExplicitReplicationSynchronousConfig
public void testRemoveWithExplicitReplicationSynchronousConfig() throws InterruptedException(Code)
Test various cache configurations for cache1 - explicit setting of: properties="replicateAsynchronously=true, replicatePuts=true, replicateUpdates=true, replicateUpdatesViaCopy=true, replicateRemovals=true "/>



testReplicatePerf
public void testReplicatePerf() throws InterruptedException(Code)
Shows result of perf problem and fix in flushReplicationQueue

Behaviour before change:

INFO: Items written: 10381 Oct 29, 2007 11:40:04 AM net.sf.ehcache.distribution.RMICacheReplicatorTest testReplicatePerf INFO: Items written: 29712 Oct 29, 2007 11:40:57 AM net.sf.ehcache.distribution.RMICacheReplicatorTest testReplicatePerf INFO: Items written: 1 Oct 29, 2007 11:40:58 AM net.sf.ehcache.distribution.RMICacheReplicatorTest testReplicatePerf INFO: Items written: 32354 Oct 29, 2007 11:42:34 AM net.sf.ehcache.distribution.RMICacheReplicatorTest testReplicatePerf INFO: Items written: 322 Oct 29, 2007 11:42:35 AM net.sf.ehcache.distribution.RMICacheReplicatorTest testReplicatePerf INFO: Items written: 41909

Behaviour after change: INFO: Items written: 26356 Oct 29, 2007 11:44:39 AM net.sf.ehcache.distribution.RMICacheReplicatorTest testReplicatePerf INFO: Items written: 33656 Oct 29, 2007 11:44:40 AM net.sf.ehcache.distribution.RMICacheReplicatorTest testReplicatePerf INFO: Items written: 32234 Oct 29, 2007 11:44:42 AM net.sf.ehcache.distribution.RMICacheReplicatorTest testReplicatePerf INFO: Items written: 38677 Oct 29, 2007 11:44:43 AM net.sf.ehcache.distribution.RMICacheReplicatorTest testReplicatePerf INFO: Items written: 43418 Oct 29, 2007 11:44:44 AM net.sf.ehcache.distribution.RMICacheReplicatorTest testReplicatePerf INFO: Items written: 31277 Oct 29, 2007 11:44:45 AM net.sf.ehcache.distribution.RMICacheReplicatorTest testReplicatePerf INFO: Items written: 27769 Oct 29, 2007 11:44:46 AM net.sf.ehcache.distribution.RMICacheReplicatorTest testReplicatePerf INFO: Items written: 29596 Oct 29, 2007 11:44:47 AM net.sf.ehcache.distribution.RMICacheReplicatorTest testReplicatePerf INFO: Items written: 17142 Oct 29, 2007 11:44:48 AM net.sf.ehcache.distribution.RMICacheReplicatorTest testReplicatePerf INFO: Items written: 14775 Oct 29, 2007 11:44:49 AM net.sf.ehcache.distribution.RMICacheReplicatorTest testReplicatePerf INFO: Items written: 4088 Oct 29, 2007 11:44:51 AM net.sf.ehcache.distribution.RMICacheReplicatorTest testReplicatePerf INFO: Items written: 5492 Oct 29, 2007 11:44:52 AM net.sf.ehcache.distribution.RMICacheReplicatorTest testReplicatePerf INFO: Items written: 10188 Also no pauses noted.




testUpdateViaInvalidate
public void testUpdateViaInvalidate() throws CacheException, InterruptedException, IOException(Code)
Tests put and update through invalidation initiated from cache1 in a cluster

This test goes into an infinite loop if the chain of notifications is not somehow broken.




testUpdateWithEmptyReplicationPropertiesConfig
public void testUpdateWithEmptyReplicationPropertiesConfig() throws Exception(Code)
Test put replicated for cache4 - no properties. Defaults should be replicateAsynchronously=true, replicatePuts=true, replicateUpdates=true, replicateUpdatesViaCopy=true, replicateRemovals=true



testUpdateWithExplicitReplicationConfig
public void testUpdateWithExplicitReplicationConfig() throws Exception(Code)
Test various cache configurations for cache1 - explicit setting of: properties="replicateAsynchronously=true, replicatePuts=true, replicateUpdates=true, replicateUpdatesViaCopy=true, replicateRemovals=true "/>



testUpdateWithExplicitReplicationSynchronousConfig
public void testUpdateWithExplicitReplicationSynchronousConfig() throws Exception(Code)
Test various cache configurations for cache1 - explicit setting of: properties="replicateAsynchronously=true, replicatePuts=true, replicateUpdates=true, replicateUpdatesViaCopy=true, replicateRemovals=true "/>



updateViaCopyTest
public void updateViaCopyTest(Ehcache fromCache, Ehcache toCache, boolean asynchronous) throws Exception(Code)
Tests put and update through copy initiated from cache1 in a cluster

This test goes into an infinite loop if the chain of notifications is not somehow broken.




waitForProgagate
protected void waitForProgagate() throws InterruptedException(Code)
Need to wait for async
throws:
  InterruptedException -



waitForSlowProgagate
protected void waitForSlowProgagate() throws InterruptedException(Code)
Need to wait for async
throws:
  InterruptedException -



xTestHugePutsBreaksAsynchronous
public void xTestHugePutsBreaksAsynchronous() throws CacheException, InterruptedException(Code)
Drive everything to point of breakage within a 64MB VM.



Fields inherited from net.sf.ehcache.AbstractCacheTest
final public static String SRC_CONFIG_DIR(Code)(Java Doc)
final public static String TEST_CLASSES_DIR(Code)(Java Doc)
final public static String TEST_CONFIG_DIR(Code)(Java Doc)
protected CacheManager manager(Code)(Java Doc)
final protected String sampleCache1(Code)(Java Doc)
final protected String sampleCache2(Code)(Java Doc)

Methods inherited from net.sf.ehcache.AbstractCacheTest
public MBeanServer createMBeanServer()(Code)(Java Doc)
protected void deleteFile(String name) throws IOException(Code)(Java Doc)
public static void forceVMGrowth()(Code)(Java Doc)
protected long measureMemoryUse() throws InterruptedException(Code)(Java Doc)
protected void runThreads(List executables) throws Exception(Code)(Java Doc)
protected void setUp() throws Exception(Code)(Java Doc)
protected void tearDown() throws Exception(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.