tillrohrmann commented on a change in pull request #8539: [FLINK-12617]
[container] StandaloneJobClusterEntrypoint defaults to random JobID for non-HA
setups
URL: https://github.com/apache/flink/pull/8539#discussion_r290267401
##########
File path:
flink-container/src/test/java/org/apache/flink/container/entrypoint/StandaloneJobClusterEntryPointTest.java
##########
@@ -59,6 +66,60 @@ public void testDontOverwriteExecutionMode() {
assertThat(getExecutionMode(configuration),
equalTo(ExecutionMode.NORMAL));
}
+ @Test
+ public void configuredJobIDTakesPrecedenceWithHA() {
+ Optional<JobID> jobID = Optional.of(JobID.generate());
+
+ Configuration globalConfiguration = new Configuration();
+ globalConfiguration.setString(HighAvailabilityOptions.HA_MODE,
"zookeeper");
+
+ JobID jobIdForCluster =
StandaloneJobClusterEntryPoint.createJobIdForCluster(
+ jobID,
+ globalConfiguration);
+
+ assertThat(jobIdForCluster, is(jobID.get()));
+ }
+
+ @Test
+ public void configuredJobIDTakesPrecedenceWithoutHA() {
+ Optional<JobID> jobID = Optional.of(JobID.generate());
+
+ Configuration globalConfiguration = new Configuration();
+
+ JobID jobIdForCluster =
StandaloneJobClusterEntryPoint.createJobIdForCluster(
+ jobID,
+ globalConfiguration);
+
+ assertThat(jobIdForCluster, is(jobID.get()));
+ }
+
+ @Test
+ public void jobIDdefaultsToZeroWithHA() {
+ Optional<JobID> jobID = Optional.empty();
+
+ Configuration globalConfiguration = new Configuration();
+ globalConfiguration.setString(HighAvailabilityOptions.HA_MODE,
"zookeeper");
Review comment:
one could encapsulate this call into `enableHighAvailability(Configuration)`
and that way reduce duplication.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services