scheduler.tasks package

Submodules

scheduler.tasks.db_update_task module

Defines the class for a database update task

class scheduler.tasks.db_update_task.DatabaseUpdateTask(framework_id)

Bases: scheduler.tasks.system_task.SystemTask

Represents a task that updates the Scale database. This class is thread-safe.

get_resources()

See job.tasks.base_task.Task.get_resources()

scheduler.tasks.manager module

Defines the class that manages system tasks

class scheduler.tasks.manager.SystemTaskManager

Bases: object

This class manages all Scale system tasks. This class is thread-safe.

DATABASE_UPDATE_ERR_THRESHOLD = datetime.timedelta(0, 120)
generate_status_json(status_dict)

Generates the portion of the status JSON that describes system-level information

Parameters:status_dict (dict) – The status JSON dict
get_tasks_to_kill()

Returns a list of system tasks that need to be killed as soon as possible

Returns:The list of system tasks to kill
Return type:list()
get_tasks_to_schedule(when)

Returns a list of system tasks that need to be scheduled as soon as possible

Parameters:when (datetime.datetime) – The current time
Returns:The list of system tasks to schedule
Return type:list()
handle_task_update(task_update)

Handles the given task update

Parameters:task_update (job.tasks.update.TaskStatusUpdate) – The task update

scheduler.tasks.system_task module

Defines the abstract base class for all system tasks

class scheduler.tasks.system_task.SystemTask(task_id, task_name)

Bases: job.tasks.base_task.Task

Abstract base class for a system task

Module contents