SiyaoIsHiding commented on code in PR #1743:
URL: 
https://github.com/apache/cassandra-java-driver/pull/1743#discussion_r1649462101


##########
core/src/main/java/com/datastax/oss/driver/internal/core/metadata/NodeStateEvent.java:
##########
@@ -53,14 +55,19 @@ public static NodeStateEvent removed(DefaultNode node) {
    */
   public final NodeState newState;
 
-  public final DefaultNode node;
+  private final WeakReference<DefaultNode> node;

Review Comment:
   Confirmed that if we put `lastStateEvent` and `lastDistanceEvent` as two 
fields of `DefaultNode`, then it will work. `DefaultNode` <-> `NodeStateEvent` 
only point to each other, same for `DistanceEvent`. Objects of all three 
classes will be collected. However, I understand this is not an ideal solution. 



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to