rezataroosheh opened a new pull request, #13652: URL: https://github.com/apache/ignite/pull/13652
IGNITE-26631 Replace instanceof checks in GridCacheIoManager#descriptorForMessage with polymorphism ### What `GridCacheIoManager#descriptorForMessage()` no longer uses `instanceof` checks to find the cache or cache group descriptor of a message. `GridCacheMessage` gets a new method, `descriptor(GridCacheSharedContext)`, which returns `null` by default. `GridCacheIdMessage` overrides it to return the cache descriptor, and `GridCacheGroupIdMessage` overrides it to return the cache group descriptor. ### Why Each message now knows how to find its own descriptor, so `GridCacheIoManager` doesn't need to check the message type. Only the two base classes override the method; other messages keep the default. No message fields change, so the wire format is unchanged. ### Tests No behavior change. Covered by existing tests (`GridCacheMessageSelfTest`, `GridCacheConditionalDeploymentSelfTest`). ### The Contribution Checklist - [*] There is a single JIRA ticket related to the pull request. - [*] The web-link to the pull request is attached to the JIRA ticket. - [ ] The JIRA ticket has the _Patch Available_ state. - [*] The pull request body describes changes that have been made. The description explains _WHAT_ and _WHY_ was made instead of _HOW_. - [*] The pull request title is treated as the final commit message. The following pattern must be used: `IGNITE-XXXX Change summary` where `XXXX` - number of JIRA issue. - [ ] A reviewer has been mentioned through the JIRA comments (see [the Maintainers list](https://cwiki.apache.org/confluence/display/IGNITE/How+to+Contribute#HowtoContribute-ReviewProcessandMaintainers)) - [ ] The pull request has been checked by the Teamcity Bot and the `green visa` attached to the JIRA ticket (see tab `PR Check` at [TC.Bot - Instance 1](https://tcbot2.sbt-ignite-dev.ru/prs.html) or [TC.Bot - Instance 2](https://mtcga.gridgain.com/prs.html)) ### Notes - [How to Contribute](https://cwiki.apache.org/confluence/display/IGNITE/How+to+Contribute) - [Coding abbreviation rules](https://cwiki.apache.org/confluence/display/IGNITE/Abbreviation+Rules) - [Coding Guidelines](https://cwiki.apache.org/confluence/display/IGNITE/Coding+Guidelines) - [Apache Ignite Teamcity Bot](https://cwiki.apache.org/confluence/display/IGNITE/Apache+Ignite+Teamcity+Bot) If you need any help, please email [email protected] or ask anу advice on http://asf.slack.com _#ignite_ channel. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
