public void createTask(final String id, TaskSpec spec)
            throws Throwable {
        try {
            executor.submit(new CreateTask(id, spec)).get();
        } catch (ExecutionException | JsonProcessingException e) {
            log.info("createTask(id={}, spec={}) error", id, spec, e);
            throw e.getCause();
        }
    }
Create a task.

@param id                    The ID of the task to create.
@param spec                  The specification of the task to create.
@throws RequestConflictException - if a task with the same ID but different spec exists
trogdor/src/main/java/org/apache/kafka/trogdor/coordinator/TaskManager.java