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

Vladimir Steshin edited comment on IGNITE-26631 at 10/28/26, 4:53 PM:
----------------------------------------------------------------------

Hi, [~rezataroosheh] 

AFAIK, the cache group is an old and controversial feature brought in to reduce 
the costs of cache metadata processing and resending. Caches in a cache group 
share the same partitions. You can search for methods like `cacheGroupId(...)`.

 

This ticket is mostly research and code cleanup. The question is whether we can 
remove one of the messages, because the group ID and the cache ID are nearly 
the same. Maybe we could use a boolean cache/group flag instead of using  
`instanceof`. Or maybe we can’t. The gain is a typical code simplification.

 

Thank you for the refactoring. It is quite small, so it could be included here. 
However, if it does not touch the main question at all, it should go into a 
separate ticket.

 

Regarding the old code usage, the IDs are requested in a single place. Does 
every single `GridCacheMessage` need `descriptor(GridCacheSharedContext<?, ?> 
ctx)`? I’m not sure.


was (Author: vladsz83):
Hi, [~rezataroosheh] 


AFAIK, the cache group is an old and controversial feature brought in to reduce 
the costs of cache metadata processing and resending. Caches in a cache group 
share the same partitions. You can search for methods like

 
{code:java}
cacheGroupId(...){code}
 

This ticket is mostly research and code cleanup. The question is whether we can 
remove one of the messages, because the group ID and the cache ID are nearly 
the same. Maybe we could use a boolean cache/group flag instead of using  
`instanceof`. Or maybe we can’t. The gain is a typical code simplification.

Thank you for the refactoring. It is quite small, so it could be included here. 
However, if it does not touch the main question at all, it should go into a 
separate ticket.

Regarding the old code usage, the IDs are requested in a single place. Does 
every single `GridCacheMessage` need `descriptor(GridCacheSharedContext<?, ?> 
ctx)`? I’m not sure.

> Combine or refactor GridCacheGroupIdMessage and GridCacheIdMessage
> ------------------------------------------------------------------
>
>                 Key: IGNITE-26631
>                 URL: https://issues.apache.org/jira/browse/IGNITE-26631
>             Project: Ignite
>          Issue Type: Improvement
>            Reporter: Vladimir Steshin
>            Assignee: Reza Taroosheh
>            Priority: Minor
>              Labels: IEP-132, ise, wire-format
>             Fix For: 2.19
>
>          Time Spent: 40m
>  Remaining Estimate: 0h
>
> These messages are similar and are only for providing a cache or a group id 
> to find proper cache message handler. Currently, we use `{_}instance of{_}`. 
> Instead, we should revise these messages and probably combine them.
>  
> Also, check in {_}GridCacheIoManager{_}:
> {code:java}
> private Object descriptorForMessage(GridCacheMessage msg) {
>     if (msg instanceof GridCacheIdMessage)
>         return 
> cctx.cache().cacheDescriptor(((GridCacheIdMessage)msg).cacheId());
>     else if (msg instanceof GridCacheGroupIdMessage)
>         return 
> cctx.cache().cacheGroupDescriptors().get(((GridCacheGroupIdMessage)msg).groupId());
>     return null;
> } {code}
>  



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to