You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Andrey Mashenkov (Jira)" <ji...@apache.org> on 2023/02/24 12:21:00 UTC

[jira] [Updated] (IGNITE-18897) TopologyService must cache local ClusterNode.

     [ https://issues.apache.org/jira/browse/IGNITE-18897?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andrey Mashenkov updated IGNITE-18897:
--------------------------------------
    Description: 
As of now, ScaleCudeTopologyService.localMember() creates a new ClusterNode instance on each call.

This method used widely in the project, so it make sense to avoid unwanted instantiations.
Moreover, every message is checked if it is sent to a local node or not, and uses topologyService.localMember().
We can get faster equality checks if local ClusterNode will be a single object.

Let's cache ClusterNode object for the local node, and maybe do the same for all objects using `intern()` ideas.
See how it is is done in RelDataTypeFactoryImpl.DATATYPE_CACHE in Calcite (it uses Interners.newWeakInterner() from Guava)  

  was:
As of now, ScaleCudeTopologyService.localMember() creates a new ClusterNode instance on each call.

This method used widely in the project, so it make sense to avoid unwanted instantiations.
Moreover, every message is checked if it is sent to a local node or not, and uses topologyService.localMember(). We can get faster equality checks if local ClusterNode will be a single object.

Let's cache ClusterNode object for the local node, 
and maybbe do the same for all objects using `intern()` ideas, like is is done in RelDataTypeFactoryImpl in Calcite (see Interners.newWeakInterner() from Guava)  


> TopologyService must cache local ClusterNode.
> ---------------------------------------------
>
>                 Key: IGNITE-18897
>                 URL: https://issues.apache.org/jira/browse/IGNITE-18897
>             Project: Ignite
>          Issue Type: Improvement
>          Components: networking
>            Reporter: Andrey Mashenkov
>            Priority: Major
>              Labels: ignite-3
>             Fix For: 3.0.0-beta2
>
>
> As of now, ScaleCudeTopologyService.localMember() creates a new ClusterNode instance on each call.
> This method used widely in the project, so it make sense to avoid unwanted instantiations.
> Moreover, every message is checked if it is sent to a local node or not, and uses topologyService.localMember().
> We can get faster equality checks if local ClusterNode will be a single object.
> Let's cache ClusterNode object for the local node, and maybe do the same for all objects using `intern()` ideas.
> See how it is is done in RelDataTypeFactoryImpl.DATATYPE_CACHE in Calcite (it uses Interners.newWeakInterner() from Guava)  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)