Ejemplo n.º 1
0
    def sendStatusUpdate(self, update):
        pending_tasks = self.chunkExecutor.pendingTaskChunks

        if pending_tasks.isSubTask(update.task_id):
            parentTaskId = pending_tasks.getParent(update.task_id).task_id
            updateMessage = chunk_utils.SubTaskUpdateMessage((parentTaskId, update))
            chunk_utils.ExecutorDriverWrapper.sendFrameworkMessage(self,
                    updateMessage.toString())
            if (chunk_utils.isTerminalUpdate(update) and
                    not update.state == mesos_pb2.TASK_KILLED):
                del pending_tasks[update.task_id]
                self.chunkExecutor.runNextSubTask(self, parentTaskId)
        else:
            if update.task_id in pending_tasks and chunk_utils.isTerminalUpdate(update):
                del pending_tasks[update.task_id]

            chunk_utils.ExecutorDriverWrapper.sendStatusUpdate(self,update)
Ejemplo n.º 2
0
    def statusUpdate(self, driver, update):
        """
        Updates internal state before passing on to the underlying framework.
        """
        if update.task_id in driver.pendingTasks:
            if chunk_utils.isTerminalUpdate(update):
                del driver.pendingTasks[update.task_id]
            else:
                driver.pendingTasks.setActive(update.task_id)

        TaskChunkScheduler.statusUpdate(self, driver, update)