示例#1
0
    def _consider_cleanup_tasks(self):
        """Considers any cleanup tasks to schedule
        """

        if scheduler_mgr.is_paused():
            return

        for task in cleanup_mgr.get_next_tasks():
            offer_mgr.consider_task(task)
示例#2
0
    def _consider_node_tasks(self, when):
        """Considers any node tasks to schedule

        :param when: The current time
        :type when: :class:`datetime.datetime`
        """

        if scheduler_mgr.is_paused():
            return

        for task in node_mgr.get_next_tasks(when):
            offer_mgr.consider_task(task)
示例#3
0
    def _consider_new_job_exes(self):
        """Considers any queued job executions for scheduling
        """

        if scheduler_mgr.is_paused():
            return

        num_job_exes = 0
        for queue in Queue.objects.get_queue(scheduler_mgr.queue_mode())[:500]:
            job_type_id = queue.job_type_id

            if job_type_id not in self._job_types or self._job_types[job_type_id].is_paused:
                continue

            if job_type_id in self._job_type_limit_available and self._job_type_limit_available[job_type_id] < 1:
                continue

            queued_job_exe = QueuedJobExecution(queue)
            if offer_mgr.consider_new_job_exe(queued_job_exe) == OfferManager.ACCEPTED:
                num_job_exes += 1
                if job_type_id in self._job_type_limit_available:
                    self._job_type_limit_available[job_type_id] -= 1
                if num_job_exes >= SchedulingThread.MAX_NEW_JOB_EXES:
                    break
示例#4
0
    def _consider_new_job_exes(self):
        """Considers any queued job executions for scheduling
        """

        if scheduler_mgr.is_paused():
            return

        num_job_exes = 0
        for queue in Queue.objects.get_queue():
            job_type_id = queue.job_type_id

            if job_type_id not in self._job_types or self._job_types[job_type_id].is_paused:
                continue

            if job_type_id in self._job_type_limit_available and self._job_type_limit_available[job_type_id] < 1:
                continue

            queued_job_exe = QueuedJobExecution(queue)
            if offer_mgr.consider_new_job_exe(queued_job_exe) == OfferManager.ACCEPTED:
                num_job_exes += 1
                if job_type_id in self._job_type_limit_available:
                    self._job_type_limit_available[job_type_id] -= 1
                if num_job_exes >= SchedulingThread.MAX_NEW_JOB_EXES:
                    break