Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 346228

Summary: Compilation regression on Java Discoverer based on CDO (Indigo RC1)
Product: [Modeling] MoDisco Reporter: Fabien Giquel <fabien.giquel>
Component: InfrastructureAssignee: Fabien Giquel <fabien.giquel>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P1 CC: gdupe, hugo.bruneliere, modisco.web-inbox, stepper
Version: 0.9.0Flags: fabien.giquel: indigo+
gdupe: review+
Target Milestone: 0.9.0 RC1   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
JavaDiscovererCDO patch
none
old JavaDiscovererCDO patch none

Description Fabien Giquel CLA 2011-05-18 08:16:30 EDT
The MoDisco org.eclipse.gmt.modisco.java.discoverer.cdo component uses the
org.eclipse.emf.cdo.common component.
A method signature has recently evolved (Indigo RC1 build) on one non-internal CDO class :

org.eclipse.emf.cdo.common.revision.CDORevisionUtil.

The public static method createRevisionCache() has disappeared.
A new method createRevisionCache(boolean, boolean) is now available.
Comment 1 Eike Stepper CLA 2011-05-18 08:37:59 EDT
Just out of curiosity, why are you creating the revision cache yourself?
Comment 2 Fabien Giquel CLA 2011-05-18 08:44:39 EDT
A fix has been commited into SVN (rev 4408) to enable RC1 MoDisco build. Gregoire you will have to approve the patchs I will add.
Comment 3 Fabien Giquel CLA 2011-05-18 08:46:04 EDT
Created attachment 195963 [details]
JavaDiscovererCDO patch
Comment 4 Fabien Giquel CLA 2011-05-18 08:48:00 EDT
Created attachment 195964 [details]
old JavaDiscovererCDO patch
Comment 5 Gregoire Dupe CLA 2011-05-18 09:44:52 EDT
(In reply to comment #1)
> Just out of curiosity, why are you creating the revision cache yourself?

Hello,

Since two years we try to use CDO to solve code discovery scalability problems. 

We tried to use different configuration of CDO including the different RevisionCache. A CDO documentation provides information about that: http://wiki.eclipse.org/CDO/Tweaking_Performance#Tweaking_the_CDORevisionCaches

Since the bug 329887 (Indigo M3), the revisionCache customization has been disabled. Here is the peace of code which use the CDORevisionCache:

CDORevisionCache revisionCache = CDORevisionUtil.createRevisionCache();
// TODO Bug 329887
// if (cacheType.equals(JavaDiscovererCDO.MEM_CACHE)) {
// revisionCache = CDORevisionCacheUtil.createMEMCache();
// } else if (cacheType.equals(JavaDiscovererCDO.LRU_CACHE)) {
// revisionCache = CDORevisionCacheUtil.createLRUCache(
// JavaDiscovererCDO.DEFAULT_LRU_CAPACITY,
// JavaDiscovererCDO.DEFAULT_LRU_CAPACITY);
// } else if (cacheType.equals(JavaDiscovererCDO.TWO_LEVEL_CACHE)) {
// revisionCache = CDORevisionCacheUtil.createTwoLevelCache(
// CDORevisionCacheUtil.createLRUCache(
// JavaDiscovererCDO.LRU_CAPACITY_CURRENT,
// JavaDiscovererCDO.LRU_CAPACITY_REVISED),
// CDORevisionCacheUtil.createMEMCache());
// }

This code is contained by the method org.eclipse.gmt.modisco.java.discoverer.cdo.JavaDiscovererCDO.getOrCreateCDOResource(String, EPackage, String, int)

Regards,
Gregoire Dupe
Comment 6 Eike Stepper CLA 2011-05-18 13:20:12 EDT
Hi Gregoire,

It is still possible to override the (CDO) system default for the revision cache implementation with the SPI method org.eclipse.emf.cdo.spi.common.revision.InternalCDORevisionManager.setCache(CDORevisionCache). 

That said, we came to the conclusion that the additional complexity of maintaining implementations like LRURevisionCache faces almost no efficiency gains, especially since we introduced the new branching mode.

Rather than fostering fundamentally different cache implemenations that must support all three modes (non-auditing, auditing and branching) we've decided to come up with only three fundamental implementations, each optimized for exactly one mode. Instances of these cache types are created by org.eclipse.emf.cdo.common.revision.CDORevisionUtil.createRevisionCache(boolean, boolean). We've not kept the old mode-agnostic factory method to make this fundamental paradigm change obvious to our users.

In particular for the non-auditing mode cache users that deal with really huge models (transform of big COBOL programs) have reported enormous footprint decreases.
Comment 7 Hugo Bruneliere CLA 2011-08-18 08:25:41 EDT
Bug solved.