scheduler.cleanup package

Submodules

scheduler.cleanup.manager module

Defines the class that manages all scheduler cleanup tasks

class scheduler.cleanup.manager.CleanupManager

Bases: object

This class manages all of the scheduler cleanup. This class is thread-safe.

add_job_execution(job_exe)

Adds a job execution that needs to be cleaned up

Parameters:job_exe (job.execution.job_exe.RunningJobExecution) – The job execution to add
update_nodes(nodes)

Updates the manager with the latest copies of the nodes

Parameters:nodes ([scheduler.node.node_class.Node]) – The list of updated nodes

scheduler.cleanup.node module

Defines the class that handles a node’s cleanup

class scheduler.cleanup.node.NodeCleanup

Bases: object

This class manages all of the cleanup for a node.

add_job_execution(job_exe)

Adds a job execution that needs to be cleaned up

Parameters:job_exe (job.execution.job_exe.RunningJobExecution) – The job execution to add
create_next_task(agent_id, hostname, is_initial_cleanup_completed)

Creates and returns the next cleanup task that needs to be run, possibly None

Parameters:
  • agent_id (string) – The node’s agent ID
  • hostname (string) – The node’s hostname
  • is_initial_cleanup_completed (bool) – Indicates if node’s initial cleanup is completed
Returns:

The next cleanup task, possibly None

Return type:

job.tasks.base_task.Task

delete_job_executions(job_exes)

Deletes the given job executions since they have been cleaned up

Parameters:job_exes ([job.execution.job_exe.RunningJobExecution]) – The job executions to delete
get_num_job_exes()

Returns the number of job executions waiting to be cleaned up

Returns:The number of job executions waiting to be cleaned up
Return type:int

Module contents