flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tillrohrmann <...@git.apache.org>
Subject [GitHub] flink pull request #2313: [FLINK-4273] Modify JobClient to attach to running...
Date Thu, 18 Aug 2016 13:20:11 GMT
Github user tillrohrmann commented on a diff in the pull request:

    https://github.com/apache/flink/pull/2313#discussion_r75305767
  
    --- 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 --
    
    Why do we need this check here?


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message