Questions about getAllInternal(...) in GridLocalAtomicCache

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Questions about getAllInternal(...) in GridLocalAtomicCache

steve.hostettler@gmail.com
This post was updated on .
Hello,

in the case of local caches without eviction policy. I have the following
questions:

1) I would to understand why, in the method, getAllInternal the method
entryEx(cacheKey); uses the topology in the case of a local cache.
Furthermore, it calls the method  map.putEntryIfObsoleteOrAbsent. But the
entry cannot be obsolete or absent because it is a local cache.


2) Similarly, why is there a touch on the key : ctx.evicts().touch(entry,
ctx.affinity().affinityTopologyVersion()); when the evicting policy is null
(never evict)? This puts locks even when the context is lock=false.


Thanks a lot for shedding some light on this.

Steve



--
Sent from: http://apache-ignite-developers.2346864.n4.nabble.com/
Reply | Threaded
Open this post in threaded view
|

Re: Questions about getAllInternal(...)

Alexey Goncharuk
Hello Steve,

A cache entry becomes obsolete once the on-heap object is no longer locked
and is not used by any thread. Since we moved to off-heap-first model in
Ignite 2.0, we must clean on-heap entries as soon as possible to keep the
heap small. Thus both of the places you pointed out.

Hope this helps,
--AG

вт, 4 сент. 2018 г. в 12:04, [hidden email] <
[hidden email]>:

> Hello,
>
> in the case of local caches without eviction policy. I have the following
> questions:
>
> 1) I would to understand why, in the method, getAllInternal the method
> entryEx(cacheKey); uses the topology in the case of a local cache.
> Furthermore, it calls the method  map.putEntryIfObsoleteOrAbsent. But the
> entry cannot be obsolete or absent because it is a local cache.
>
>
> 2) Similarly, why is there a touch on the key : ctx.evicts().touch(entry,
> ctx.affinity().affinityTopologyVersion()); when the evicting policy is null
> (never evict)? This puts locks even when the context is lock=false.
>
>
> Thanks a lot for shedding some light on this.
>
> Steve
>
>
>
> --
> Sent from: http://apache-ignite-developers.2346864.n4.nabble.com/
>
Reply | Threaded
Open this post in threaded view
|

Re: Questions about getAllInternal(...)

steve.hostettler@gmail.com
Hello Alexey,

Thanks for the answer. It does help but I can't help thinking that the sort
of one size fits all approach would have important performance consequences
on simple use cases (read only local or replicated caches).

Wouldn't be useful to have the option for a on heap non serialized cache
(local or replicated) ?

Steve




--
Sent from: http://apache-ignite-developers.2346864.n4.nabble.com/