Registers a list of task types with the conductor server

@param taskDefs List of task types to be registered.
421047
public void registerTaskDefs(List<TaskDef> taskDefs) {
        Preconditions.checkNotNull(taskDefs, "Task defs list cannot be null");
        stub.createTasks(MetadataServicePb.CreateTasksRequest.newBuilder()
                .addAllDefs(
                        taskDefs.stream().map(protoMapper::toProto)::iterator
                )
                .build()
        );
    }
908246
public void setTaskSets(java.util.Collection<String> taskSets) {
        if (taskSets == null) {
            this.taskSets = null;
            return;
        }

        this.taskSets = new com.amazonaws.internal.SdkInternalList<String>(taskSets);
    }
513788
private void validate(TaskDef taskDef) {
        Preconditions.checkNotNull(taskDef, "TaskDef object cannot be null");
        Preconditions.checkNotNull(taskDef.getName(), "TaskDef name cannot be null");
    }
69566
public static void setTaskFailureException(Collection<? extends WorkUnitState> taskStates, Throwable t) {
    for (WorkUnitState taskState : taskStates) {
      ((TaskState) taskState).setTaskFailureException(t);
    }
  }
339952
def register_scf_task(self, *args, **kwargs):
        """"""
        kwargs["task_class"] = ScfTask
        return self.register_task(*args, **kwargs)
1047329
public void setConversionTasks(java.util.Collection<ConversionTask> conversionTasks) {
        if (conversionTasks == null) {
            this.conversionTasks = null;
            return;
        }

        this.conversionTasks = new com.amazonaws.internal.SdkInternalList<ConversionTask>(conversionTasks);
    }
1309314
private List<Task> getAppTasks(ApplicationDefinition appDef) {
        List<Task> appTasks = new ArrayList<>();
        try {
            StorageService service = SchemaService.instance().getStorageService(appDef);
            Collection<Task> appTaskColl = service.getAppTasks(appDef);
            if (appTaskColl != null) {
                appTasks.addAll(service.getAppTasks(appDef));
            }
        } catch (IllegalArgumentException e) {
            // StorageService has not been initialized; no tasks for this application.
        }
        return appTasks;
    }
503454
public void unregisterTaskDef(String taskType) {
        Preconditions.checkArgument(StringUtils.isNotBlank(taskType), "Task type cannot be blank");
        delete("metadata/taskdefs/{tasktype}", taskType);
    }
1073735
public void registerWorkflowDef(WorkflowDef workflowDef) {
        Preconditions.checkNotNull(workflowDef, "Worfklow definition cannot be null");
        stub.createWorkflow(
                MetadataServicePb.CreateWorkflowRequest.newBuilder()
                        .setWorkflow(protoMapper.toProto(workflowDef))
                        .build()
        );
    }
439015
public void registerTask(Task task) throws IOException {
		final ResultPartition[] producedPartitions = task.getProducedPartitions();

		synchronized (lock) {
			if (isShutdown) {
				throw new IllegalStateException("NetworkEnvironment is shut down");
			}

			for (final ResultPartition partition : producedPartitions) {
				setupPartition(partition);
			}

			// Setup the buffer pool for each buffer reader
			final SingleInputGate[] inputGates = task.getAllInputGates();
			for (SingleInputGate gate : inputGates) {
				setupInputGate(gate);
			}
		}
	}
429555
private void aggregateTasklets(final AggregateTriggerType type) {
    final List<WorkerToMasterReport> workerToMasterReports = new ArrayList<>();
    final List<Object> results = new ArrayList<>();
    final List<Integer> aggregatedTasklets = new ArrayList<>();

    // Synchronization to prevent duplication of work on the same aggregation function on the same worker.
    synchronized (stateLock) {
      switch(type) {
      case ALARM:
        aggregateTasklets(workerToMasterReports, results, aggregatedTasklets);
        break;
      case COUNT:
        if (!aggregateOnCount()) {
          return;
        }

        aggregateTasklets(workerToMasterReports, results, aggregatedTasklets);
        break;
      default:
        throw new RuntimeException("Unexpected aggregate type.");
      }
    }

    if (!results.isEmpty()) {
      // Run the aggregation function.
      try {
        final Object aggregationResult = taskletAggregationRequest.executeAggregation(results);
        workerToMasterReports.add(new TaskletAggregationResultReport(aggregatedTasklets, aggregationResult));
      } catch (final Exception e) {
        workerToMasterReports.add(new TaskletAggregationFailureReport(aggregatedTasklets, e));
      }
    }

    // Add to worker report only if there is something to report back.
    if (!workerToMasterReports.isEmpty()) {
      workerReportsQueue.addLast(kryoUtils.serialize(new WorkerToMasterReports(workerToMasterReports)));
      heartBeatTriggerManager.triggerHeartBeat();
    }
  }
225295
private function registerTaskDispatcherCollection()
    {
        $this->getContainer()[TaskDispatcherCollection::CONTAINER_ID] = function(){
            $collection = new TaskDispatcherCollection();
            $event = new TaskDispatcherCollectionInitializedEvent($this->container, $collection);
            $this->container->events()->dispatch(TaskDispatcherCollectionInitializedEvent::EVENT_NAME, $event);

            return $collection;
        };
    }
515035
public TaskDef getTaskDef(String taskType) {
        Preconditions.checkArgument(StringUtils.isNotBlank(taskType), "Task type cannot be blank");
        return getForEntity("metadata/taskdefs/{tasktype}", null, TaskDef.class, taskType);
    }
1108516
protected function _runTasks( $dbtype, array $tasknames, array $stack = array() )
	{
		foreach( $tasknames as $taskname )
		{
			if( in_array( $taskname, $this->_tasksDone ) ) { continue; }

			if( in_array( $taskname, $stack ) ) {
				$msg = 'Circular dependency for "%1$s" detected. Task stack: %2$s';
				throw new MW_Setup_Exception( sprintf( $msg, $taskname, implode( ', ', $stack ) ) );
			}

			$stack[] = $taskname;

			if( isset( $this->_dependencies[$taskname] ) ) {
				$this->_runTasks( $dbtype, (array) $this->_dependencies[$taskname], $stack );
			}

			if( isset( $this->_tasks[$taskname] ) ) {
				$this->_tasks[$taskname]->run( $dbtype );
			}

			$this->_tasksDone[] = $taskname;
		}
	}
556903
public void registerTaskManager(final TaskExecutorConnection taskExecutorConnection, SlotReport initialSlotReport) {
		checkInit();

		LOG.debug("Registering TaskManager {} under {} at the SlotManager.", taskExecutorConnection.getResourceID(), taskExecutorConnection.getInstanceID());

		// we identify task managers by their instance id
		if (taskManagerRegistrations.containsKey(taskExecutorConnection.getInstanceID())) {
			reportSlotStatus(taskExecutorConnection.getInstanceID(), initialSlotReport);
		} else {
			// first register the TaskManager
			ArrayList<SlotID> reportedSlots = new ArrayList<>();

			for (SlotStatus slotStatus : initialSlotReport) {
				reportedSlots.add(slotStatus.getSlotID());
			}

			TaskManagerRegistration taskManagerRegistration = new TaskManagerRegistration(
				taskExecutorConnection,
				reportedSlots);

			taskManagerRegistrations.put(taskExecutorConnection.getInstanceID(), taskManagerRegistration);

			// next register the new slots
			for (SlotStatus slotStatus : initialSlotReport) {
				registerSlot(
					slotStatus.getSlotID(),
					slotStatus.getAllocationID(),
					slotStatus.getJobID(),
					slotStatus.getResourceProfile(),
					taskExecutorConnection);
			}
		}

	}
652750
def _register_task(self, output_type, rule, union_rules):
    """"""
    func = Function(self._to_key(rule.func))
    self._native.lib.tasks_task_begin(self._tasks, func, self._to_type(output_type), rule.cacheable)
    for selector in rule.input_selectors:
      self._native.lib.tasks_add_select(self._tasks, self._to_type(selector))

    def add_get_edge(product, subject):
      self._native.lib.tasks_add_get(self._tasks, self._to_type(product), self._to_type(subject))

    for the_get in rule.input_gets:
      union_members = union_rules.get(the_get.subject_declared_type, None)
      if union_members:
        # If the registered subject type is a union, add Get edges to all registered union members.
        for union_member in union_members:
          add_get_edge(the_get.product, union_member)
      else:
        # Otherwise, the Get subject is a "concrete" type, so add a single Get edge.
        add_get_edge(the_get.product, the_get.subject_declared_type)

    self._native.lib.tasks_task_end(self._tasks)
1136738
def register_nscf_task(self, *args, **kwargs):
        """"""
        kwargs["task_class"] = NscfTask
        return self.register_task(*args, **kwargs)