viirya commented on code in PR #59331:
URL: https://github.com/apache/spark/pull/59331#discussion_r4252848271


##########
core/src/main/java/org/apache/spark/memory/MemoryConsumer.java:
##########
@@ -156,6 +166,21 @@ public void freeMemory(long size) {
     used.getAndAdd(-size);
   }
 
+  /**
+   * Memory consumers are compared by identity. This is not final so that 
existing subclasses which
+   * override it keep compiling, but its presence stops Scala case classes 
from generating value
+   * equality.
+   */
+  @Override
+  public boolean equals(Object other) {

Review Comment:
   #59282 merged first, so I updated the `HybridQueue` comment here: it now 
says that `MemoryConsumer` already defines identity equality and that the 
overrides only make it final. I kept the overrides, since `final` still stops a 
`HybridQueue` subclass from switching back to value equality.
   



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