You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ignite.apache.org by Andrey Kuznetsov <st...@gmail.com> on 2018/02/08 12:19:12 UTC
EvictableEntry.isCached() state meaning
Hi Igniters!
I can't comprehend the meaning of the following note in javadoc for
EvictableEntry.isCached() method.
"If entry is not in cache (e.g. has been removed) {@code false} is
returned. In this case all operations on this entry will cause creation of
a new entry in cache."
That is, if I call getKey() or getValue() on removed entry it will be
resurrected in cache? This sounds too magically. Could someone explain the
real message of the phrase, please?
--
Best regards,
Andrey Kuznetsov.
Re: EvictableEntry.isCached() state meaning
Posted by Alexey Goncharuk <al...@gmail.com>.
Andrey,
isCached() may return false if the entry was concurrently removed from the
heap (note that EvictableEntry covers only on-heap evictions since it is
passed to the instance of an EvictionPolicy). Any cache access of the entry
key (get or update) will bring the entry back on-heap.
--AG
2018-02-08 15:19 GMT+03:00 Andrey Kuznetsov <st...@gmail.com>:
> Hi Igniters!
>
> I can't comprehend the meaning of the following note in javadoc for
> EvictableEntry.isCached() method.
>
> "If entry is not in cache (e.g. has been removed) {@code false} is
> returned. In this case all operations on this entry will cause creation of
> a new entry in cache."
>
> That is, if I call getKey() or getValue() on removed entry it will be
> resurrected in cache? This sounds too magically. Could someone explain the
> real message of the phrase, please?
>
> --
> Best regards,
> Andrey Kuznetsov.
>