Vladsz83 commented on code in PR #13084:
URL: https://github.com/apache/ignite/pull/13084#discussion_r3201169218
##########
modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/internal/TcpDiscoveryNode.java:
##########
@@ -686,19 +703,28 @@ public TcpDiscoveryNode clientReconnectNode(Map<String,
Object> nodeAttrs) {
}
/**
- * IMPORTANT!
- * Only purpose of this constructor is creating node which contains
necessary data to store on disc only
- * @param node to copy data from
+ * Downcasts type of map's key value.
+ *
+ * @param <PK> Map parent key type.
+ * @param <CK> Child key type.
+ * @param <V> Map value type.
+ * @param m Initial collections map.
+ * @return Resulting map.
*/
- public TcpDiscoveryNode(ClusterNode node) {
- this.id = node.id();
- this.consistentId = node.consistentId();
- this.addrs = node.addresses();
- this.hostNames = node.hostNames();
- this.order = node.order();
- this.ver = node.version();
- this.clientRouterNodeId = node.isClient() ? node.id() : null;
-
- attrs = Collections.singletonMap(ATTR_NODE_CONSISTENT_ID,
consistentId);
+ public static <PK, CK extends PK, V> Map<CK, V> downcast(Map<PK, V> m) {
Review Comment:
It is only about TcoDiscoveryNode and ZookeeperNode which might be removed
in future with zookeper discovery removal. With zookeper removal, the upcast
and downcast would be even rarer.
--
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]