flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From StephanEwen <...@git.apache.org>
Subject [GitHub] flink pull request: [FLINK-1925] Fixes blocking method submitTask ...
Date Mon, 27 Apr 2015 12:11:53 GMT
Github user StephanEwen commented on a diff in the pull request:

    https://github.com/apache/flink/pull/622#discussion_r29140659
  
    --- Diff: flink-runtime/src/main/scala/org/apache/flink/runtime/taskmanager/TaskManager.scala
---
    @@ -795,108 +795,111 @@ extends Actor with ActorLogMessages with ActorLogging {
         var startRegisteringTask = 0L
         var task: Task = null
     
    -    // all operations are in a try / catch block to make sure we send a result upon any
failure
    -    try {
    -      // check that we are already registered
    -      if (!isConnected) {
    -        throw new IllegalStateException("TaskManager is not associated with a JobManager")
    -      }
    -      if (slot < 0 || slot >= numberOfSlots) {
    -        throw new Exception(s"Target slot ${slot} does not exist on TaskManager.")
    -      }
    +    if (!isConnected) {
    +      sender ! Failure(
    +        new IllegalStateException("TaskManager is not associated with a JobManager.")
    +      )
    +    } else if (slot < 0 || slot >= numberOfSlots) {
    +      sender ! Failure(new Exception(s"Target slot $slot does not exist on TaskManager."))
    +    } else {
    +      sender ! Acknowledge
     
    -      val userCodeClassLoader = libraryCacheManager match {
    -        case Some(manager) =>
    -          if (LOG.isDebugEnabled) {
    -            startRegisteringTask = System.currentTimeMillis()
    -          }
    +      Future {
    +        try {
    --- End diff --
    
    Can we pull the code in the future into its own method? Makes it easier to understand
by separating the different parts along the methods.


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