ignite-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexey Goncharuk (JIRA)" <j...@apache.org>
Subject [jira] [Created] (IGNITE-11676) Clean up custom event callbacks
Date Wed, 03 Apr 2019 10:08:00 GMT
Alexey Goncharuk created IGNITE-11676:

             Summary: 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

Currently, {{GridDiscoveryManager}} has several ways of notifying Ignite components of discovery
 * 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

View raw message