public abstract class AbstractPipelineLauncher
extends java.lang.Object
implements org.apache.beam.it.common.PipelineLauncher
Generally, the methods here are the ones that focus more on the Dataflow jobs rather than launching a specific type of template.
org.apache.beam.it.common.PipelineLauncher.JobState, org.apache.beam.it.common.PipelineLauncher.LaunchConfig, org.apache.beam.it.common.PipelineLauncher.LaunchInfo, org.apache.beam.it.common.PipelineLauncher.Sdk
Modifier and Type | Field and Description |
---|---|
protected Dataflow |
client |
protected java.util.List<java.lang.String> |
launchedJobs |
static java.lang.String |
LEGACY_RUNNER |
static java.lang.String |
PARAM_JOB_ID |
static java.lang.String |
PARAM_JOB_TYPE |
static java.lang.String |
PARAM_RUNNER |
static java.lang.String |
RUNNER_V2 |
Modifier | Constructor and Description |
---|---|
protected |
AbstractPipelineLauncher(Dataflow client) |
Modifier and Type | Method and Description |
---|---|
Job |
cancelJob(java.lang.String project,
java.lang.String region,
java.lang.String jobId) |
void |
cleanupAll() |
Job |
drainJob(java.lang.String project,
java.lang.String region,
java.lang.String jobId) |
Job |
getJob(java.lang.String project,
java.lang.String region,
java.lang.String jobId) |
Job |
getJob(java.lang.String project,
java.lang.String region,
java.lang.String jobId,
java.lang.String view) |
protected org.apache.beam.it.common.PipelineLauncher.LaunchInfo |
getJobInfo(org.apache.beam.it.common.PipelineLauncher.LaunchConfig options,
org.apache.beam.it.common.PipelineLauncher.JobState state,
Job job)
Creates a JobInfo object from the provided parameters.
|
protected org.apache.beam.it.common.PipelineLauncher.LaunchInfo.Builder |
getJobInfoBuilder(org.apache.beam.it.common.PipelineLauncher.LaunchConfig options,
org.apache.beam.it.common.PipelineLauncher.JobState state,
Job job)
Creates a JobInfo builder object from the provided parameters, enable derived class to add info
incrementally.
|
org.apache.beam.it.common.PipelineLauncher.JobState |
getJobStatus(java.lang.String project,
java.lang.String region,
java.lang.String jobId) |
java.lang.Double |
getMetric(java.lang.String project,
java.lang.String region,
java.lang.String jobId,
java.lang.String metricName) |
java.util.Map<java.lang.String,java.lang.Double> |
getMetrics(java.lang.String project,
java.lang.String region,
java.lang.String jobId) |
protected org.apache.beam.it.common.PipelineLauncher.JobState |
handleJobState(Job job)
Parses the job state if available or returns
JobState#UNKNOWN if not given. |
java.util.List<JobMessage> |
listMessages(java.lang.String project,
java.lang.String region,
java.lang.String jobId,
java.lang.String minimumImportance) |
protected void |
printJobResponse(Job job) |
org.apache.beam.it.common.PipelineLauncher.JobState |
waitUntilActive(java.lang.String project,
java.lang.String region,
java.lang.String jobId)
Waits until the specified job is not in a pending state.
|
public static final java.lang.String LEGACY_RUNNER
public static final java.lang.String RUNNER_V2
public static final java.lang.String PARAM_RUNNER
public static final java.lang.String PARAM_JOB_TYPE
public static final java.lang.String PARAM_JOB_ID
protected final java.util.List<java.lang.String> launchedJobs
protected final Dataflow client
protected AbstractPipelineLauncher(Dataflow client)
public Job getJob(java.lang.String project, java.lang.String region, java.lang.String jobId) throws java.io.IOException
getJob
in interface org.apache.beam.it.common.PipelineLauncher
java.io.IOException
public Job getJob(java.lang.String project, java.lang.String region, java.lang.String jobId, java.lang.String view)
getJob
in interface org.apache.beam.it.common.PipelineLauncher
public org.apache.beam.it.common.PipelineLauncher.JobState getJobStatus(java.lang.String project, java.lang.String region, java.lang.String jobId) throws java.io.IOException
getJobStatus
in interface org.apache.beam.it.common.PipelineLauncher
java.io.IOException
public java.util.List<JobMessage> listMessages(java.lang.String project, java.lang.String region, java.lang.String jobId, java.lang.String minimumImportance)
listMessages
in interface org.apache.beam.it.common.PipelineLauncher
public Job cancelJob(java.lang.String project, java.lang.String region, java.lang.String jobId)
cancelJob
in interface org.apache.beam.it.common.PipelineLauncher
public Job drainJob(java.lang.String project, java.lang.String region, java.lang.String jobId)
drainJob
in interface org.apache.beam.it.common.PipelineLauncher
@Nullable public java.lang.Double getMetric(java.lang.String project, java.lang.String region, java.lang.String jobId, java.lang.String metricName) throws java.io.IOException
getMetric
in interface org.apache.beam.it.common.PipelineLauncher
java.io.IOException
public java.util.Map<java.lang.String,java.lang.Double> getMetrics(java.lang.String project, java.lang.String region, java.lang.String jobId) throws java.io.IOException
getMetrics
in interface org.apache.beam.it.common.PipelineLauncher
java.io.IOException
protected void printJobResponse(Job job)
protected org.apache.beam.it.common.PipelineLauncher.JobState handleJobState(Job job)
JobState#UNKNOWN
if not given.protected org.apache.beam.it.common.PipelineLauncher.LaunchInfo.Builder getJobInfoBuilder(org.apache.beam.it.common.PipelineLauncher.LaunchConfig options, org.apache.beam.it.common.PipelineLauncher.JobState state, Job job)
protected final org.apache.beam.it.common.PipelineLauncher.LaunchInfo getJobInfo(org.apache.beam.it.common.PipelineLauncher.LaunchConfig options, org.apache.beam.it.common.PipelineLauncher.JobState state, Job job)
public org.apache.beam.it.common.PipelineLauncher.JobState waitUntilActive(java.lang.String project, java.lang.String region, java.lang.String jobId) throws java.io.IOException
java.io.IOException
public void cleanupAll() throws java.io.IOException
cleanupAll
in interface org.apache.beam.it.common.PipelineLauncher
java.io.IOException