public List<Task> getTasks(JobInstance jobInstance) {
    return queryJobStatusServers(baseUrl -> String.format(ResourceConstants.GET_TASKS_URL, baseUrl,
        jobInstance.getJobName(), jobInstance.getJobId()), new TypeReference<List<Task>>() { });
  }
This method retrieves and returns the list of tasks that are associated with a JobInstance.
@param jobInstance an instance of the samza job.
@return the list of tasks that are associated with the samza job.
@throws SamzaException if there were any problems with the http request.
samza-rest/src/main/java/org/apache/samza/monitor/JobsClient.java