You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ignite.apache.org by "kcheng.mvp" <kc...@gmail.com> on 2018/07/05 04:21:06 UTC

Why GridCacheEvictionManager always use cfg.getEvictionPolicy/cfg.getEvictionPolicyFactory even there is NearEvictionPolicy configured?

As the method
*org.apache.ignite.internal.processors.cache.GridCacheAdapter#isNear* always
returns false, it will make the near cache eviction policy don't take
effect. Here is the code from
*org.apache.ignite.internal.processors.cache.GridCacheEvictionManager#start0*.
is this an expected behavior ? 
==========================
CacheConfiguration cfg = cctx.config();

        if (cctx.isNear()) {
            plc = (cfg.getNearConfiguration().getNearEvictionPolicyFactory()
!= null) ?
               
(EvictionPolicy)cfg.getNearConfiguration().getNearEvictionPolicyFactory().create()
:
                cfg.getNearConfiguration().getNearEvictionPolicy();
        }
        else if (cfg.getEvictionPolicyFactory() != null)
            plc = (EvictionPolicy)cfg.getEvictionPolicyFactory().create();
        else
            plc = cfg.getEvictionPolicy();

        plcEnabled = plc != null;

        filter = cfg.getEvictionFilter();
==========================



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

Re: Why GridCacheEvictionManager always use cfg.getEvictionPolicy/cfg.getEvictionPolicyFactory even there is NearEvictionPolicy configured?

Posted by Dmitry Pavlov <dp...@gmail.com>.
Hi,

Is this question related to some contribution? If not, probably user@ list
is better place to ask, even if question is advanced. Community members
monitors user list, so even advanced question can find asnwer there.

Dev@ list is intended for discussions related to particular contributions,
PRs, tickests, test failures, proposed changes, development infra, etc.

Sincerely,
Dmitriy Pavlov

чт, 5 июл. 2018 г. в 7:21, kcheng.mvp <kc...@gmail.com>:

> As the method
> *org.apache.ignite.internal.processors.cache.GridCacheAdapter#isNear*
> always
> returns false, it will make the near cache eviction policy don't take
> effect. Here is the code from
>
> *org.apache.ignite.internal.processors.cache.GridCacheEvictionManager#start0*.
> is this an expected behavior ?
> ==========================
> CacheConfiguration cfg = cctx.config();
>
>         if (cctx.isNear()) {
>             plc =
> (cfg.getNearConfiguration().getNearEvictionPolicyFactory()
> != null) ?
>
>
> (EvictionPolicy)cfg.getNearConfiguration().getNearEvictionPolicyFactory().create()
> :
>                 cfg.getNearConfiguration().getNearEvictionPolicy();
>         }
>         else if (cfg.getEvictionPolicyFactory() != null)
>             plc = (EvictionPolicy)cfg.getEvictionPolicyFactory().create();
>         else
>             plc = cfg.getEvictionPolicy();
>
>         plcEnabled = plc != null;
>
>         filter = cfg.getEvictionFilter();
> ==========================
>
>
>
> --
> Sent from: http://apache-ignite-developers.2346864.n4.nabble.com/
>