parameters: (cls, mapreduce_spec)
docstring: Schedule finalize task.
  
      Args:
        mapreduce_spec: mapreduce specification as MapreduceSpec.
docstring_summary: Schedule finalize task.
docstring_tokens: Schedule finalize task .
function: def schedule(cls, mapreduce_spec):
      """Schedule finalize task.
  
      Args:
        mapreduce_spec: mapreduce specification as MapreduceSpec.
      """
      task_name = mapreduce_spec.mapreduce_id + "-finalize"
      finalize_task = taskqueue.Task(
          name=task_name,
          url=(mapreduce_spec.params["base_path"] + "/finalizejob_callback/" +
               mapreduce_spec.mapreduce_id),
          params={"mapreduce_id": mapreduce_spec.mapreduce_id},
          headers=util._get_task_headers(mapreduce_spec.mapreduce_id))
      queue_name = util.get_queue_name(None)
      if not _run_task_hook(mapreduce_spec.get_hooks(),
                            "enqueue_controller_task",
                            finalize_task,
                            queue_name):
        try:
          finalize_task.add(queue_name)
        except (taskqueue.TombstonedTaskError,
                taskqueue.TaskAlreadyExistsError), e:
          logging.warning("Task %r already exists. %s: %s",
                          task_name, e.__class__, e)
function_tokens: def schedule ( cls , mapreduce_spec ) : task_name = mapreduce_spec . mapreduce_id + "-finalize" finalize_task = taskqueue . Task ( name = task_name , url = ( mapreduce_spec . params [ "base_path" ] + "/finalizejob_callback/" + mapreduce_spec . mapreduce_id ) , params = { "mapreduce_id" : mapreduce_spec . mapreduce_id } , headers = util . _get_task_headers ( mapreduce_spec . mapreduce_id ) ) queue_name = util . get_queue_name ( None ) if not _run_task_hook ( mapreduce_spec . get_hooks ( ) , "enqueue_controller_task" , finalize_task , queue_name ) : try : finalize_task . add ( queue_name ) except ( taskqueue . TombstonedTaskError , taskqueue . TaskAlreadyExistsError ) , e : logging . warning ( "Task %r already exists. %s: %s" , task_name , e . __class__ , e )