Github user mxm commented on a diff in the pull request:
https://github.com/apache/flink/pull/2313#discussion_r75307414
--- Diff:
flink-runtime/src/main/scala/org/apache/flink/runtime/jobmanager/JobInfo.scala
---
@@ -58,10 +62,63 @@ class JobInfo(
}
}
- override def toString = s"JobInfo(client: $client ($listeningBehaviour),
start: $start)"
+
+ /**
+ * Notifies all clients by sending a message
+ * @param message the message to send
+ */
+ def notifyClients(message: Any) = {
+ clients foreach {
+ case (clientActor, _) =>
+ clientActor ! message
+ }
+ }
+
+ /**
+ * Notifies all clients which are not of type detached
+ * @param message the message to sent to non-detached clients
+ */
+ def notifyNonDetachedClients(message: Any) = {
+ clients foreach {
+ case (clientActor, ListeningBehaviour.DETACHED) =>
+ // do nothing
+ case (clientActor, _) =>
+ clientActor ! message
+ }
+ }
+
+ /**
+ * Sends a message to job clients that match the listening behavior
+ * @param message the message to send to all clients
+ * @param listeningBehaviour the desired listening behaviour
+ */
+ def notifyClients(message: Any, listeningBehaviour: ListeningBehaviour)
= {
+ clients foreach {
+ case (clientActor, `listeningBehaviour`) =>
+ clientActor ! message
+ case _ =>
+ }
+ }
def setLastActive() =
lastActive = System.currentTimeMillis()
+
+
+ override def toString = s"JobInfo(clients: ${clients.toString()}, start:
$start)"
+
+ override def equals(other: Any): Boolean = other match {
+ case that: JobInfo =>
+ this.isInstanceOf[JobInfo] &&
--- End diff --
Yes, that's unnecessary because of the case type check.
---
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.
---