Пример #1
0
 def frameworkMessage(self, driver, executorId, slaveId, data):
     message = SubTaskMessage.fromString(data)
     if message.isValid() and message.getType() == SubTaskMessage.SUBTASK_UPDATE:
         self.statusUpdate(driver, message.getPayload()[1])
     else:
         chunk_utils.SchedulerWrapper.frameworkMessage(self, driver,
                 executorId, slaveId, data)
Пример #2
0
 def frameworkMessage(self, driver, message):
     """
     Parses through framework messages to determine if KILL_SUBTASK message
     recieved.
     """
     parsedMessage = SubTaskMessage.fromString(message)
     if parsedMessage.isValid() and parsedMessage.getType() == SubTaskMessage.KILL_SUBTASKS:
         self.killSubTasks(driver, parsedMessage.getPayload())
     else:
         chunk_utils.ExecutorWrapper.frameworkMessage(self, driver, message)
Пример #3
0
 def frameworkMessage(self, driver, executor_id, slave_id, data):
     """
     Receives a framework message. Squelches stolen task updates and
     updates the table on subtask updates.
     """
     message = SubTaskMessage.fromString(data)
     if message.isValid() and message.getType() == SubTaskMessage.SUBTASK_UPDATE:
         parentTaskId, update = message.getPayload()
         if (parentTaskId.value, update.task_id.value) in self.stolenTaskIds:
             # Potentially log this and remove from stolenTasks.
             if update.state == mesos_pb2.TASK_KILLED:
                 print "\tSquelched ack of killed/stolen sub task '{0}' from task chunk '{1}'".format(
                         update.task_id.value, parentTaskId.value)
             else:
                 print "\tSquelched update from stolen task '{0}' in task chunk '{1}'".format(
                         update.task_id.value, parentTaskId.value)
         else:
             TaskChunkScheduler.frameworkMessage(self, driver, executor_id,
                     slave_id, data)
     else:
         TaskChunkScheduler.frameworkMessage(self, driver, executor_id,
                 slave_id, data)