Github user zsxwing commented on a diff in the pull request:
https://github.com/apache/spark/pull/10368#discussion_r48372093
--- Diff: core/src/main/scala/org/apache/spark/scheduler/TaskResult.scala
---
@@ -46,6 +46,26 @@ class DirectTaskResult[T](var valueBytes: ByteBuffer,
var accumUpdates: Map[Long
def this() = this(null.asInstanceOf[ByteBuffer], null, null)
+ override def toString: String = valueBytes.toString + " " + accumUpdates
+ " " + metrics
+
+ override def equals(other: Any): Boolean = other match {
+ case that: DirectTaskResult[_] => {
+ if (!this.valueBytes.equals(that.valueBytes)) return false
+
+ val accumSize = if (accumUpdates != null) accumUpdates.size else 0
+ val thatAccumSize = if (that.accumUpdates != null)
that.accumUpdates.size else 0
+ if (accumSize != thatAccumSize) return false
+ if (accumSize > 0) {
+ val b = this.accumUpdates.keys.forall { key =>
--- End diff --
Why compare two Maps manually? I think `Map` already implements `equals`.
Right?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]