[ https://issues.apache.org/jira/browse/FLINK-7836?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16380053#comment-16380053 ]
ASF GitHub Bot commented on FLINK-7836: --------------------------------------- Github user yanghua commented on a diff in the pull request: https://github.com/apache/flink/pull/5593#discussion_r171187437 --- Diff: flink-yarn/src/main/java/org/apache/flink/yarn/AbstractYarnClusterDescriptor.java --- @@ -979,6 +989,16 @@ public ApplicationReport startAppMaster( appContext.setApplicationType("Apache Flink"); appContext.setAMContainerSpec(amContainer); appContext.setResource(capability); + + if (nodeLabel != null) { + try { + Method method = appContext.getClass().getMethod("setNodeLabelExpression", String.class); + method.invoke(appContext, nodeLabel); + } catch (NoSuchMethodException e) { + LOG.warn("Ignoring node label setting because the version of YARN does not support it"); + } + } --- End diff -- @tillrohrmann I know, I just find there is a inner static class `ApplicationSubmissionContextReflector`, it uses reflection to set fields for `ApplicationSubmissionContext` such as `setApplicationTags`. I think add this code segment to this class and wrap it to a method named `setApplicationNodeLabel` could be better. What's your opinion? > specifying node label for flink job to run on yarn > -------------------------------------------------- > > Key: FLINK-7836 > URL: https://issues.apache.org/jira/browse/FLINK-7836 > Project: Flink > Issue Type: New Feature > Components: Client > Affects Versions: 1.3.2 > Reporter: zhaibaba > Assignee: vinoyang > Priority: Major > > flink client cannot specify node label for flink job to run on yarn -- This message was sent by Atlassian JIRA (v7.6.3#76005)