swh.scheduler package

Module contents

swh.scheduler.compute_nb_tasks_from(num_tasks)[source]
Compute and returns the tuple, number of tasks without priority,

number of tasks with priority.

Parameters

num_tasks (int) –

Returns

tuple number of tasks without priority (int), number of tasks with priority (int)

swh.scheduler.get_scheduler(cls, args={})[source]

Get a scheduler object of class scheduler_class with arguments scheduler_args.

Parameters
  • scheduler (dict) – dictionary with keys:

  • cls (str) – scheduler’s class, either ‘local’ or ‘remote’

  • args (dict) – dictionary with keys, default to empty.

Returns

local: swh.scheduler.backend.SchedulerBackend remote: swh.scheduler.api.client.RemoteScheduler

Return type

an instance of swh.scheduler, either local or remote

Raises

ValueError if passed an unknown storage class.