[GitHub] flink pull request #5617: [FLINK-8799][YARN] Make AbstractYarnClusterDescrip...
Github user GJL commented on a diff in the pull request: https://github.com/apache/flink/pull/5617#discussion_r172979651 --- Diff: flink-yarn/src/main/java/org/apache/flink/yarn/AbstractYarnClusterDescriptor.java --- @@ -172,6 +181,88 @@ public AbstractYarnClusterDescriptor( userJarInclusion = getUserJarInclusionMode(flinkConfiguration); this.configurationDirectory = Preconditions.checkNotNull(configurationDirectory); + + String yarnQueueConfigValue = flinkConfiguration.getString(YarnConfigOptions.YARN_QUEUE); --- End diff -- The difficulty of this ticket (FLINK-8799) is that `flinkConfiguration` is mutable. As long as a reference of `flinkConfiguration` can possibly leak, this class remains mutable. Also, there are some private methods that mutate the configuration. There are several places where we would need to make defensive copies, e.g., in the constructor. ---
[GitHub] flink pull request #5617: [FLINK-8799][YARN] Make AbstractYarnClusterDescrip...
Github user zhangminglei commented on a diff in the pull request: https://github.com/apache/flink/pull/5617#discussion_r172009559 --- Diff: flink-yarn/src/main/java/org/apache/flink/yarn/cli/FlinkYarnSessionCli.java --- @@ -476,14 +379,12 @@ protected Configuration applyCommandLineOptionsToConfiguration(CommandLine comma final ApplicationId applicationId = getClusterId(commandLine); - if (applicationId != null) { - final String zooKeeperNamespace; - if (commandLine.hasOption(zookeeperNamespace.getOpt())){ - zooKeeperNamespace = commandLine.getOptionValue(zookeeperNamespace.getOpt()); - } else { - zooKeeperNamespace = effectiveConfiguration.getString(HA_CLUSTER_ID, applicationId.toString()); - } - + final String zooKeeperNamespace; + if (commandLine.hasOption(zookeeperNamespace.getOpt())){ + zooKeeperNamespace = commandLine.getOptionValue(zookeeperNamespace.getOpt()); --- End diff -- Should have a space after ```if``` ---
[GitHub] flink pull request #5617: [FLINK-8799][YARN] Make AbstractYarnClusterDescrip...
GitHub user yanghua opened a pull request: https://github.com/apache/flink/pull/5617 [FLINK-8799][YARN] Make AbstractYarnClusterDescriptor immutable ## What is the purpose of the change *This pull request Make AbstractYarnClusterDescriptor immutable* ## Brief change log - *removed or closed some setter accessor in class `AbstractYarnClusterDescriptor`* - *deleted some set property code and replaced with adding option to `Configuration` instance* - *fetch the config item from `Configuration` and init the field for `AbstractYarnClusterDescriptor`* - *add some config to `YarnConfigOptions`* - *fixed some old test cast and some new test case for refactored config properties* ## Verifying this change This change added tests and can be verified as follows: - *fixed some old test cast and some new test case for refactored config properties such as flink jar path and name and so on* ## Does this pull request potentially affect one of the following parts: - Dependencies (does it add or upgrade a dependency): (no) - The public API, i.e., is any changed class annotated with `@Public(Evolving)`: (no) - The serializers: (no) - The runtime per-record code paths (performance sensitive): (no) - Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Yarn/Mesos, ZooKeeper: (no) - The S3 file system connector: (no) ## Documentation - Does this pull request introduce a new feature? ( no) - If yes, how is the feature documented? (not documented) You can merge this pull request into a Git repository by running: $ git pull https://github.com/yanghua/flink FLINK-8799 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/flink/pull/5617.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #5617 commit f04f8d68a0859923dcdba594ce22b5f420305df5 Author: vinoyang Date: 2018-03-02T09:22:54Z [FLINK-8799][YARN] Make AbstractYarnClusterDescriptor immutable ---