Пример #1
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)