Github user rmetzger commented on a diff in the pull request:
https://github.com/apache/flink/pull/1612#discussion_r52385934
--- Diff:
flink-runtime/src/main/java/org/apache/flink/runtime/jobgraph/JobGraph.java ---
@@ -102,60 +101,150 @@
//
--------------------------------------------------------------------------------------------
/**
- * Constructs a new job graph with no name and a random job ID.
+ * Constructs a new job graph with no name, a random job ID, and the
default
+ * {@link ExecutionConfig} parameters.
*/
public JobGraph() {
this((String) null);
}
/**
- * Constructs a new job graph with the given name, a random job ID.
+ * Constructs a new job graph with the given name, a random job ID and
the default
+ * {@link ExecutionConfig} parameters.
*
* @param jobName The name of the job
*/
public JobGraph(String jobName) {
- this(null, jobName);
+ this(null, jobName, new ExecutionConfig());
+ }
+
+ /**
+ * Constructs a new job graph with the given job ID, the given name,
and the default
+ * {@link ExecutionConfig} parameters.
+ *
+ * @param jobID The id of the job. A random ID is generated, if {@code
null} is passed.
+ * @param jobName The name of the job.
+ */
+ public JobGraph(JobID jobID, String jobName) {
+ this(jobID, jobName, new ExecutionConfig());
}
/**
- * Constructs a new job graph with the given name and a random job ID
if null supplied as an id.
+ * Constructs a new job graph with the given name, the given {@link
ExecutionConfig},
+ * and a random job ID.
+ *
+ * @param jobName The name of the job.
+ * @param config The execution configuration of the job.
+ */
+ public JobGraph(String jobName, ExecutionConfig config) {
+ this(null, jobName, config);
+ }
+
+ /**
+ * Constructs a new job graph with the given job ID (or a random ID, if
{@code null} is passed),
+ * the given name and the given execution configuration (see {@link
ExecutionConfig}).
*
* @param jobId The id of the job. A random ID is generated, if {@code
null} is passed.
* @param jobName The name of the job.
+ * @param config The execution configuration of the job.
*/
- public JobGraph(JobID jobId, String jobName) {
+ public JobGraph(JobID jobId, String jobName, ExecutionConfig config) {
this.jobID = jobId == null ? new JobID() : jobId;
this.jobName = jobName == null ? "(unnamed job)" : jobName;
+ this.executionConfig = config;
+ }
+
+ /**
+ * Constructs a new job graph containing the provided <b>single</b>
{@code JobVertex} (see {@link JobVertex}),
+ * with no name, a random ID, and the default execution configuration
(see {@link ExecutionConfig}).
+ *
+ * @param vertex The single vertex of the graph.
+ * */
+ public JobGraph(JobVertex vertex) {
+ this(null, Collections.singletonList(vertex));
+ }
+
+ /**
+ * Constructs a new job graph containing the provided <b>single</b>
{@code JobVertex} (see {@link JobVertex}),
+ * with the given name, a random ID, and the default execution
configuration (see {@link ExecutionConfig}).
+ *
+ * @param jobName The name of the job.
+ * @param vertex The single vertex of the graph.
+ * */
+ public JobGraph(String jobName, JobVertex vertex) {
+ this(jobName, Collections.singletonList(vertex));
+ }
+
+ /**
+ * Constructs a new job graph containing the provided <b>two</b> {@code
JobVertices} (see {@link JobVertex}),
+ * with the given name, a random ID, and the default execution
configuration (see {@link ExecutionConfig}).
+ *
+ * @param jobName The name of the job.
+ * @param vertex1 The first vertex of the graph.
+ * @param vertex2 The second vertex of the graph.
+ * */
+ public JobGraph(String jobName, JobVertex vertex1, JobVertex vertex2) {
+ this(jobName, Arrays.asList(vertex1, vertex2));
}
/**
- * Constructs a new job graph with no name and a random job ID if null
supplied as an id.
+ * Constructs a new job graph containing the provided {@code
JobVertices} (see {@link JobVertex}),
+ * with no name, a random job ID, and the default execution
configuration (see {@link ExecutionConfig}).
*
* @param vertices The vertices to add to the graph.
*/
- public JobGraph(JobVertex... vertices) {
--- End diff --
Why did you remove the varargs constructor?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---