Closed GoogleCodeExporter closed 9 years ago
This is a duplicate of issue 31.
The usual solution is to change from a unit == 1 byte to a larger sector size,
such as 1kb.
I think a long capacity is fine, but I'm not actively working on a next release
to roll this into soon. If this is critical than it could be a patch release.
You are of course welcome to fork if neither of those options are okay.
I helped my former colleagues at Google with Guava's CacheBuilder (formerly
MapMaker), which could be considered the successor to this project. There the
maximum weight is a long.
Original comment by Ben.Manes@gmail.com
on 13 Apr 2012 at 10:38
Hi Ben,
The problem is that we dont usually have the unit to be 1Kb or in a constant
chunks and guava doesn't provide us with descendingKeySetWithLimit method.
Looks like long fixes the problem but breaks most of the test's.
I can fix it but is this something of your intrest?
Other option is to move hasOverflowed() extendable and be set via builder so
the extension can count and manage the weightedSize of their own.
Original comment by vijay2...@gmail.com
on 16 Apr 2012 at 10:10
>>> Other option is to move hasOverflowed() extendable and be set via builder
so the extension can count and manage the weightedSize of
Attached patch allows users to specify capacity in KB, MB and bytes so the
existing limitation can be removed. Thanks!
Original comment by vijay2...@gmail.com
on 18 Apr 2012 at 4:53
Attachments:
Fixed in v1.3. I plan on releasing this tonight.
Also introduced EntryWeigher<K, V> to allow key/value weighing. We fixed this
oversight in Guava's CacheBuilder from the get-go.
I believe Cassandra wanted entry weighers too, but it wasn't high priority (no
bug filed). Please consider adopting it when you upgrade the library.
Original comment by Ben.Manes@gmail.com
on 8 May 2012 at 9:45
Original issue reported on code.google.com by
vijay2...@gmail.com
on 13 Apr 2012 at 8:29