fapaul commented on a change in pull request #18105:
URL: https://github.com/apache/flink/pull/18105#discussion_r771378586
##########
File path:
flink-end-to-end-tests/flink-end-to-end-tests-common/src/main/java/org/apache/flink/tests/util/flink/container/FlinkContainers.java
##########
@@ -254,6 +259,55 @@ public void submitSQLJob(SQLJobSubmission job) throws
IOException, InterruptedEx
}
}
+ /**
+ * Submits the given job to the cluster.
+ *
+ * @param job job to submit
+ */
+ public JobID submitJob(JobSubmission job) throws IOException,
InterruptedException {
+ final List<String> commands = new ArrayList<>();
+ commands.add("flink/bin/flink");
+ commands.add("run");
+
+ if (job.isDetached()) {
+ commands.add("-d");
+ }
+ if (job.getParallelism() > 0) {
+ commands.add("-p");
+ commands.add(String.valueOf(job.getParallelism()));
+ }
+ job.getMainClass()
+ .ifPresent(
+ mainClass -> {
+ commands.add("--class");
+ commands.add(mainClass);
+ });
+ final Path jobJar = job.getJar();
+ final String containerPath = "/tmp/" + jobJar.getFileName();
+ commands.add(containerPath);
+ jobManager.copyFileToContainer(
+ MountableFile.forHostPath(jobJar.toAbsolutePath()),
containerPath);
Review comment:
It should work. For a new submission, we create another file in the temp
directory of the container.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]