History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: CACHE-188
Type: Improvement Improvement
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Lars Torunski
Reporter: Christoph Kutzinski
Votes: 0
Watchers: 2
Operations

If you were logged in you would be able to see more operations.
OSCache

removeEntry should update group mappings

Created: 19/Jul/05 09:46 AM   Updated: 19/Jul/06 02:29 PM
Component/s: Base Classes
Affects Version/s: 2.1.1
Fix Version/s: 2.3.2

File Attachments: 1. Java Source File AbstractConcurrentReadCache.java (73 kb)
2. Java Source File AbstractConcurrentReadCache.java (73 kb)
3. Java Source File AbstractConcurrentReadCache.java (73 kb)
4. Java Source File TestAbstractCache.java (7 kb)

Issue Links:
Duplicate
 
This issue is duplicated by:
CACHE-244 Cache group is not updated if entry i... Major Closed
Related
 
This issue is related to:
CACHE-181 addGroupMappings leads to inconsisten... Minor Closed


 Description  « Hide
The removeEntry method in the Cache class should remove the removed entry from its groups. Currently it doesn't.

I'm currently implementing this behaviour for my project and can provide the patched sources when I'm done with it.

 All   Comments   Change History      Sort Order:
Lars Torunski - [20/Jul/05 12:31 AM ]
Please provide the patch when you are finished.

Christoph Kutzinski - [20/Jul/05 05:05 AM ]
I haven't found any tests testing groups, so I added I method to TestAbstractCache.java
Doing this I stumbled upon this:
When I have overflow persistence enabled and put an entry with a group (without exceeding the maxEntries limit) the entry is correctly not persisted, but the group is. Is this expected behaviour or a bug?

Christoph Kutzinski - [03/Aug/05 03:39 AM ]
These are the changed classes AbstractConcurrentReadCache and TestAbstractCache. I've already checked them in into my local CVS. I don't how how to create a patch in this case, so I send the full files, sorry.

I've made some more changes to AbstractConcurrentReadCache:
- a new removeForce-Method that will remove the entry form the persistent store in any case (even if you have unlimitedDisk or overflowtoDisk). This is important if you need a removeEntry analog to flushEntry as I do. I call this method in my own Cache subclass
- some changes to serialization (de/serialization wouldn't work anyway if one would use it as it is currently implemented):
  - listeners should not be serialized
  - readObject() must be implemented in subclasses, as AbstractConcurrentReadCache's readObject call the subclasses via put(key, value) and e.g. the list in LRUCache would be null in that moment

Christoph Kutzinski - [03/Aug/05 03:53 AM ]
Working with the new remove method I realized that removing a bigger number of entries is incredible slow now if one is using a DiskPersistenceListener (ca. 55 sec for 760 entries). This is apperently due to the fact that for each entry you don't have to touch just one file but 1 + x files. Where x is the number of groups the entry is in.
While I didn't fix the source of the problem (yet), I've made some changes to disk persistence (escpecially for groups) that will speed up things generally a little bit. I have now ca. 36 sec for the 760 entries.

Should I add this as an attachment for this case, too, or should I open a new feature request?

Lars Torunski - [11/Sep/05 04:58 AM ]
Christoph, please open an improvement issue for speed up the disk persistence and attach the source code.

Christoph Kutzinski - [26/Sep/05 06:53 AM ]
I opened the improvement issue under : http://jira.opensymphony.com/browse/CACHE-197

Lars Torunski - [24/Jun/06 02:21 AM ]
AbstractConcurrentReadCache fixed in CVS HEAD. All unit tests and the new unit test group are OK.