public abstract class AbstractJobProxy extends java.lang.Object implements JobProxy
JobProxy
interface with the default, cluster-agnostic,
implementations. Subclasses are expected to override these default methods where necessary.Modifier and Type | Field and Description |
---|---|
protected JobsResourceConfig |
config |
Constructor and Description |
---|
AbstractJobProxy(JobsResourceConfig config)
Required constructor.
|
Modifier and Type | Method and Description |
---|---|
static JobProxy |
fromFactory(JobsResourceConfig config)
Creates a new JobProxy instance from the factory class specified in the config.
|
protected abstract java.util.Set<JobInstance> |
getAllJobInstances() |
java.util.List<Job> |
getAllJobStatuses() |
protected org.apache.samza.config.ConfigFactory |
getJobConfigFactory() |
protected JobStatus |
getJobSamzaStatus(JobInstance jobInstance)
Convenience method to get the Samza job status from the name and id.
|
Job |
getJobStatus(JobInstance jobInstance) |
protected abstract JobStatusProvider |
getJobStatusProvider() |
boolean |
jobExists(JobInstance jobInstance) |
protected final JobsResourceConfig config
public AbstractJobProxy(JobsResourceConfig config)
config
- the config containing the installations path.public static JobProxy fromFactory(JobsResourceConfig config)
config
- the config containing the job proxy factory property.public java.util.List<Job> getAllJobStatuses() throws java.io.IOException, java.lang.InterruptedException
getAllJobStatuses
in interface JobProxy
Job
for each Samza job instance installed on this host.java.io.IOException
- if there was a problem executing the command to get the status.java.lang.InterruptedException
- if the thread was interrupted while waiting for the status result.protected JobStatus getJobSamzaStatus(JobInstance jobInstance) throws java.io.IOException, java.lang.InterruptedException
jobInstance
- the instance of the job.java.io.IOException
- if there was a problem executing the command to get the status.java.lang.InterruptedException
- if the thread was interrupted while waiting for the status result.public Job getJobStatus(JobInstance jobInstance) throws java.io.IOException, java.lang.InterruptedException
getJobStatus
in interface JobProxy
jobInstance
- the instance of the job for which the status is needed.Job
containing
the status for the job specified by jobName and jobId.java.io.IOException
- if there was a problem executing the command to get the status.java.lang.InterruptedException
- if the thread was interrupted while waiting for the status result.public boolean jobExists(JobInstance jobInstance)
protected org.apache.samza.config.ConfigFactory getJobConfigFactory()
ConfigFactory
to use to read job configuration files.protected abstract JobStatusProvider getJobStatusProvider()
JobStatusProvider
to use in retrieving the job status.protected abstract java.util.Set<JobInstance> getAllJobInstances()