[
https://issues.apache.org/jira/browse/IGNITE-11676?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Alexey Goncharuk updated IGNITE-11676:
--------------------------------------
Ignite Flags: (was: Docs Required)
> Clean up custom event callbacks
> -------------------------------
>
> Key: IGNITE-11676
> URL: https://issues.apache.org/jira/browse/IGNITE-11676
> Project: Ignite
> Issue Type: Improvement
> Reporter: Alexey Goncharuk
> Priority: Major
>
> Currently, {{GridDiscoveryManager}} has several ways of notifying Ignite
> components of discovery events:
> * Line 668: a set of {{instanceof}} statements to invoke specific callbacks
> for components (for example, {{ctx.state().onStateChangeMessage(...)}},
> {{ctx.cache().onCustomEvent(...)}}
> * Later, on line 715: we call a somewhat generic custom event listeners
> * Finally, on line 876, if the custom message was of a specific type, we
> fire EVT_DISCOVERY_CUSTOM_EVT
> Overall, this is a huge abstraction leak, and all non-discovery specifics
> should be eliminated from {{GridDiscoveryManager}}. I suggest the following:
> 1) Change {{CustomEventListener}} to have two methods: one of them should
> return {{true}} or {{false}} to determine whether the minor topology version
> should be incremented
> 2) Move all logic to corresponding components
> 3) Get rid of code on line 876, I see no need in this. Also, consider
> removing {{EVT_DISCOVERY_CUSTOM_EVT}}, as this is private API and should now
> be covered by the specific listener
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)