-
Notifications
You must be signed in to change notification settings - Fork 13.9k
[FLINK-11781][yarn] Remove "DISABLED" as possible value for yarn.per-job-cluster.include-user-jar #7883
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FLINK-11781][yarn] Remove "DISABLED" as possible value for yarn.per-job-cluster.include-user-jar #7883
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -57,8 +57,7 @@ public class YarnConfigOptions { | |
| .defaultValue("ORDER") | ||
| .withDescription("Defines whether user-jars are included in the system class path for per-job-clusters as" + | ||
| " well as their positioning in the path. They can be positioned at the beginning (\"FIRST\"), at the" + | ||
| " end (\"LAST\"), or be positioned based on their name (\"ORDER\"). Setting this parameter to" + | ||
| " \"DISABLED\" causes the jar to be included in the user class path instead."); | ||
| " end (\"LAST\"), or be positioned based on their name (\"ORDER\")."); | ||
|
|
||
| /** | ||
| * The vcores exposed by YARN. | ||
|
|
@@ -156,7 +155,6 @@ private YarnConfigOptions() {} | |
|
|
||
| /** @see YarnConfigOptions#CLASSPATH_INCLUDE_USER_JAR */ | ||
| public enum UserJarInclusion { | ||
| DISABLED, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should check where this is parsed to the enum and throw a meaningful exception explaining that DISABLED has been removed.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. From Flink 1.5 to 1.7:
If we would apply the PR as is, we would always log a warning (because
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. +1 for throwing exception rather than just logging, when mismatch. |
||
| FIRST, | ||
| LAST, | ||
| ORDER | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -53,7 +53,9 @@ | |
| import java.util.Set; | ||
|
|
||
| import static junit.framework.TestCase.assertTrue; | ||
| import static org.hamcrest.Matchers.containsString; | ||
| import static org.junit.Assert.assertEquals; | ||
| import static org.junit.Assert.assertThat; | ||
| import static org.junit.Assert.fail; | ||
|
|
||
| /** | ||
|
|
@@ -89,6 +91,27 @@ public static void tearDownClass() { | |
| yarnClient.stop(); | ||
| } | ||
|
|
||
| /** | ||
| * @see <a href="https://issues.apache.org/jira/browse/FLINK-11781">FLINK-11781</a> | ||
| */ | ||
| @Test | ||
| public void testThrowsExceptionIfUserTriesToDisableUserJarInclusionInSystemClassPath() { | ||
| final Configuration configuration = new Configuration(); | ||
| configuration.setString(YarnConfigOptions.CLASSPATH_INCLUDE_USER_JAR, "DISABLED"); | ||
|
|
||
| try { | ||
| new YarnClusterDescriptor( | ||
| configuration, | ||
| yarnConfiguration, | ||
| temporaryFolder.getRoot().getAbsolutePath(), | ||
| yarnClient, | ||
| true); | ||
| fail("Expected exception not thrown"); | ||
| } catch (final IllegalArgumentException e) { | ||
| assertThat(e.getMessage(), containsString("cannot be set to DISABLED anymore")); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: As before -> I prefer the |
||
| } | ||
| } | ||
|
|
||
| @Test | ||
| public void testFailIfTaskSlotsHigherThanMaxVcores() throws ClusterDeploymentException { | ||
| final Configuration flinkConfiguration = new Configuration(); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Personally prefer the approach with
@RuleThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Current solution is legible, and frequently used in Flink and elsewhere. I'll leave it as is.