[MGNLIMG-121] Upgrade to Guava 16 Created: 25/Feb/14  Updated: 09/Apr/14  Resolved: 09/Apr/14

Status: Closed
Project: Imaging
Component/s: None
Affects Version/s: None
Fix Version/s: 3.1

Type: Task Priority: Blocker
Reporter: Magnolia International Assignee: Christopher Zimmermann
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
causality
caused by MAGNOLIA-4847 Upgrade to newer version of guava Closed
dependency
depends upon MGNLIMG-127 Update dependency to magnolia-core 5.3 Closed
relation
is related to MGNLIMG-50 Concurrency issues / review Closed
Template:
Acceptance criteria:
Empty
Task DoR:
Empty
Date of First Response:
Epic Link: DAM / CMIS
Sprint: 5.3 Sprint 4, 5.3 Sprint 5

 Description   

Magnolia 5.3 will be shipped with Guava 16. Unfortunately, this means CachingImageStreamer has to be adapted.
See description in linked ticket MAGNOLIA-4847 for details.

Details:
It'll be necessary to change info.magnolia.imaging.caching.CachingImageStreamer class to
not use com.google.common.collect.MapMaker but com.google.common.cache.CacheBuilder.

That's because caching functionality in MapMaker was move to CacheBuilder.
Migration guide: http://code.google.com/p/guava-libraries/wiki/MapMakerMigration



 Comments   
Comment by Magnolia International [ 13/Mar/14 ]

I just read through the MapMaker migration guide, and I'm not sure this evolved for the better, for our very specific case. Our usage of MapMaker is for "current jobs", ie. keeping tracks of various image generation jobs running in parallel. Once the job is done, the job stays in the map for 500ms, but the image isn't regenerated. Further requests don't even go through this map.

It looks like what we really needed was simply the ConcurrentMap, and maybe we took a shortcut by using a Computing version of it.
Now, Guava replaced this by CacheBuilder and LoadingCache, and I'm concerned, among other things, that using these new concepts will introduce further confusion (as is there wasn't enough) as to what CachingImageStreamer does and how (what's cached in which cache)

Sequence diagrams and some clever decoupling and renaming might help.

Comment by Christopher Zimmermann [ 17/Mar/14 ]

In order to upgrade to Guava 16, the usage of MapMaker has been replaced with CacheBuilder, as MapMaker is deprecated.
This necessitated handling ExecutionException instead of ComputationException in serveImage.

Comment by Christopher Zimmermann [ 18/Mar/14 ]

Pushed to master in two commits, one for actual changes, one for upping version to 3.1-SNAPSHOT.

Comment by Milan Divilek [ 08/Apr/14 ]

Imaging has dependency to magnolia main 5.0.2, but this version use guava 10.0.1, which is not compatible with guava 16.0.1.
We should update magnolia main dependency to 5.3, but unfortunately this cause failing tests.

Comment by Christopher Zimmermann [ 09/Apr/14 ]

Closing again. Ive linked the existing ticket for the problem that Milan has mentioned.

Generated at Mon Feb 12 02:12:29 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.