• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

ben-manes / caffeine / 2053
100%

Build:
DEFAULT BRANCH: master
Ran 08 May 2017 05:21AM UTC
Jobs 1
Files 67
Run time 3s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
2053

push

travis-ci

ben-manes
Integrate variable expiration with JCache

JCache has its own expiration policy, but unfortunately differences in
the API and the requirement to retain existing functionality means that
the two cannot be merged yet.

The settings currently allow using both variable and fixed expiration
together. This is because the spec authors assumed that a maximum size
would also be enabled, thereby evicting expired entries lazily. Since
we exposed Caffeine's eager policy, then only for fixed, these two
could be used together. With Caffeine's new variable policy, it does
not allow the combination of fixed and variable in the core library.
Thus, lazy-expiration cannot be mapped directly to Caffeine's version.

To retain the previous combinations, we could adapt only when the
fixed settings are not used. Then supply an eternal no-op policy for
the lazy logic and an adapter for the eager logic. Unfortunately API
differences makes this more difficult. For example, JCache's
putIfAbsent does not return a value when failing and therefore is not
a read. Caffeine's does, which results in TCK failures when the expiry
policy calls are verified.

A possible solution would be to use a ThreadLocal to signal the cases
when the expiry calls should be ignored. That adds brittleness to an
already complex adapter due. Instead, perhaps in v3 we can remove the
lazy and fixed settings, simplify the adapter, and use the ThreadLocal
trick to correct these edge cases.

Given that the major JCache implementors are lazy and expect a maximum
and that JCache's ExpiryPolicy is neutered by not providing the key or
value, I don't think a hacky solution is worth the effort. Users can
use Caffeine's expiry if they need eager behavior.

5660 of 6030 relevant lines covered (93.86%)

0.94 hits per line

Jobs
ID Job ID Ran Files Coverage
1 2053.1 (TERM=dumb) 08 May 2017 05:21AM UTC 0
93.86
Travis Job 2053.1
Source Files on build 2053
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #2053
  • b932e209 on github
  • Prev Build on master (#2052)
  • Next Build on master (#2062)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc