public class SamzaTaskProxy extends java.lang.Object implements TaskProxy
TaskProxy
interface implementation for samza jobs running in yarn execution environment.
getTasks implementation reads the jobModel of the job specified by JobInstance
from coordinator stream.Constructor and Description |
---|
SamzaTaskProxy(TaskResourceConfig taskResourceConfig,
InstallationFinder installFinder) |
Modifier and Type | Method and Description |
---|---|
java.util.List<Task> |
getTasks(JobInstance jobInstance)
Fetches the complete job model from the coordinator stream based upon the provided
JobInstance
param, transforms it to a list of Task and returns it. |
protected org.apache.samza.coordinator.stream.CoordinatorStreamSystemConsumer |
initializeCoordinatorStreamConsumer(JobInstance jobInstance)
Initialize
CoordinatorStreamSystemConsumer based upon JobInstance parameter. |
protected java.util.List<Task> |
readTasksFromCoordinatorStream(org.apache.samza.coordinator.stream.CoordinatorStreamSystemConsumer consumer)
Builds list of
Task from job model in coordinator stream. |
public SamzaTaskProxy(TaskResourceConfig taskResourceConfig, InstallationFinder installFinder)
public java.util.List<Task> getTasks(JobInstance jobInstance) throws java.io.IOException, java.lang.InterruptedException
JobInstance
param, transforms it to a list of Task
and returns it.
getTasks
in interface TaskProxy
jobInstance
- the job instance to get the tasks for.Task
tasks that belongs to the JobInstance
.
Each task will have a preferred host and stream partitions assigned to it by
the samza job coordinator.java.io.IOException
- if there was a problem executing the command to get the tasks.java.lang.InterruptedException
- if the thread was interrupted while waiting for the result.protected org.apache.samza.coordinator.stream.CoordinatorStreamSystemConsumer initializeCoordinatorStreamConsumer(JobInstance jobInstance)
CoordinatorStreamSystemConsumer
based upon JobInstance
parameter.jobInstance
- the job instance to get CoordinatorStreamSystemConsumer for.protected java.util.List<Task> readTasksFromCoordinatorStream(org.apache.samza.coordinator.stream.CoordinatorStreamSystemConsumer consumer)
Task
from job model in coordinator stream.consumer
- system consumer associated with a job's coordinator stream.Task
constructed from job model in coordinator stream.