You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "kcheng.mvp (JIRA)" <ji...@apache.org> on 2018/07/04 06:36:00 UTC

[jira] [Commented] (IGNITE-8776) Eviction policy MBeans are never registered if evictionPolicyFactory is used

    [ https://issues.apache.org/jira/browse/IGNITE-8776?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16532329#comment-16532329 ] 

kcheng.mvp commented on IGNITE-8776:
------------------------------------

Hi [~slukyanov],Here is my investigation:

-- org.apache.ignite.internal.processors.cache.GridCacheProcessor#prepareCacheStart
----- *call org.apache.ignite.internal.processors.cache.GridCacheProcessor#createCache* at line #1944
----- *startCache(cache, desc.schema() != null ? desc.schema() : new QuerySchema());* at line #1963

For case using *FifoEvictionPolicyFactory* and *LruEvictionPolicyFactory* the backend eviction policy is generated by factory's *create()* method when starting a cache. That's to say even through the eviction factory full fill the *MBean interface or IgniteMBeanAware interface*, it can still not be registered at *org.apache.ignite.internal.processors.cache.GridCacheProcessor#registerMbean*, as the instances have not been generated.

so I think the best place to register the mbeans is in *org.apache.ignite.internal.processors.cache.GridCacheEvictionManager*.

please advise me if I am wrong.
[~slukyanov]

> Eviction policy MBeans are never registered if evictionPolicyFactory is used
> ----------------------------------------------------------------------------
>
>                 Key: IGNITE-8776
>                 URL: https://issues.apache.org/jira/browse/IGNITE-8776
>             Project: Ignite
>          Issue Type: Bug
>    Affects Versions: 2.5
>            Reporter: Stanislav Lukyanov
>            Assignee: kcheng.mvp
>            Priority: Minor
>              Labels: newbie
>
> Eviction policy MBeans, such as LruEvictionPolicyMBean, are never registered if evictionPolicyFactory is set instead of evictionPolicy (the latter is deprecated).
> This happens because GridCacheProcessor::registerMbean attempts to find either an *MBean interface or IgniteMBeanAware interface on the passed object. It works for LruEvictionPolicy but not for LruEvictionPolicyFactory (which doesn't implement these interfaces).
> The code needs to be adjusted to handle factories correctly.
> New tests are needed to make sure that all standard beans are registered (IgniteKernalMbeansTest does that for kernal mbeans - need the same for cache beans).



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)