gianm commented on code in PR #18886:
URL: https://github.com/apache/druid/pull/18886#discussion_r2670845131


##########
multi-stage-query/src/main/java/org/apache/druid/msq/counters/CounterSnapshotsTree.java:
##########
@@ -109,6 +109,31 @@ private void putAll(final Map<Integer, Map<Integer, 
CounterSnapshots>> otherMap)
     }
   }
 
+  @Override
+  public boolean equals(final Object o)
+  {
+    if (this == o) {
+      return true;
+    }
+    if (o == null || getClass() != o.getClass()) {
+      return false;
+    }
+    final CounterSnapshotsTree that = (CounterSnapshotsTree) o;
+    synchronized (snapshotsMap) {
+      synchronized (that.snapshotsMap) {

Review Comment:
   Hmm, I think in theory yes. It's only going to happen in unit tests though 
so it probably doesn't matter (this was added to make a test case easier to 
write). But, still not great, so I'll change it to 
`copyMap().equals(that.copyMap())`.



##########
multi-stage-query/src/main/java/org/apache/druid/msq/counters/CounterSnapshotsTree.java:
##########
@@ -109,6 +109,31 @@ private void putAll(final Map<Integer, Map<Integer, 
CounterSnapshots>> otherMap)
     }
   }
 
+  @Override
+  public boolean equals(final Object o)
+  {
+    if (this == o) {
+      return true;
+    }
+    if (o == null || getClass() != o.getClass()) {
+      return false;
+    }
+    final CounterSnapshotsTree that = (CounterSnapshotsTree) o;
+    synchronized (snapshotsMap) {
+      synchronized (that.snapshotsMap) {

Review Comment:
   Hmm, I think in theory yes. `equals` is only going to be used in unit tests 
though so it probably doesn't matter (this was added to make a test case easier 
to write). But, still not great, so I'll change it to 
`copyMap().equals(that.copyMap())`.



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