@classmethod
  def __add_kickoff_task(cls, job_config, mapreduce_spec):
    """Add kickoff task to taskqueue.

    Args:
      job_config: map_job.JobConfig.
      mapreduce_spec: model.MapreduceSpec,
    """
    params = {"mapreduce_id": job_config.job_id}
    # Task is not named so that it can be added within a transaction.
    kickoff_task = taskqueue.Task(
        # TODO(user): Perhaps make this url a computed field of job_config.
        url=job_config._base_path + "/kickoffjob_callback/" + job_config.job_id,
        headers=util._get_task_headers(job_config.job_id),
        params=params)
    if job_config._hooks_cls:
      hooks = job_config._hooks_cls(mapreduce_spec)
      try:
        hooks.enqueue_kickoff_task(kickoff_task, job_config.queue_name)
        return
      except __HOLE__:
        pass
    kickoff_task.add(job_config.queue_name, transactional=True)
dataset/ETHPy150Open GoogleCloudPlatform/appengine-mapreduce/python/src/mapreduce/api/map_job/map_job_control.py/Job.__add_kickoff_task