pelikan icon indicating copy to clipboard operation
pelikan copied to clipboard

Some update for JSegcache

Open JunchengYTwitter opened this issue 2 years ago • 3 comments

This PR contains multiple things (let me know if you want to split them)

  1. Add get_age in segments, then add a new field age in Item so that we can return age to caller.
  2. Add RichItem to return item_info and item_info_ptr, these two are used to support opportunistic concurrency control. Not sure adding a new struct is better than adding the fields to Item, but given there might be fields (like these) that we often do not need, creating a new struct might be better.
  3. add a call to expire before we evict, this avoids the problem that users may forget to call expire.
  4. add key size check when inserting to the cache.

JunchengYTwitter avatar Jul 28 '22 03:07 JunchengYTwitter

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Jul 28 '22 03:07 CLAassistant

@JunchengYTwitter - this looks good overall. Just needs rustfmt. I'm okay with this remaining a single PR.

brayniac avatar Jul 28 '22 18:07 brayniac

updated

JunchengYTwitter avatar Jul 28 '22 20:07 JunchengYTwitter