pelikan
pelikan copied to clipboard
Some update for JSegcache
This PR contains multiple things (let me know if you want to split them)
- Add
get_age
in segments, then add a new fieldage
inItem
so that we can return age to caller. - Add
RichItem
to returnitem_info
anditem_info_ptr
, these two are used to support opportunistic concurrency control. Not sure adding a new struct is better than adding the fields toItem
, but given there might be fields (like these) that we often do not need, creating a new struct might be better. - add a call to expire before we evict, this avoids the problem that users may forget to call
expire
. - add key size check when inserting to the cache.
@JunchengYTwitter - this looks good overall. Just needs rustfmt. I'm okay with this remaining a single PR.
updated