Skip to content

Conversation

@yanghua
Copy link
Contributor

@yanghua yanghua commented Feb 28, 2018

What is the purpose of the change

This pull request support flink on yarn to specify yarn node label for yarn flink application both flink session and single job mode

Brief change log

  • define a new command option to specify a yarn node label
  • set the node label for the application through reflection (to support low version hadoop)
  • add command line option description

Verifying this change

This change without any test coverage.

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? (yes)
  • If yes, how is the feature documented? (docs)

@yanghua
Copy link
Contributor Author

yanghua commented Feb 28, 2018

@tillrohrmann could you review this PR? Thanks!

Copy link
Contributor

@tillrohrmann tillrohrmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution @yanghua. I think it's a good addition, but we should add it only as a Yarn specific option and not a general option. Furthermore, it would be good to add a test if possible.


public void setNodeLabel(String nodeLabel) {
this.nodeLabel = nodeLabel;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should get rid of this setter pattern. All values should be set at creation time of the AbstractYarnClusterDescriptor.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tillrohrmann the setter for nodelabel I followed the example of setZookeeperNamespace and setQueue, it seems that the AbstractYarnClusterDescriptor constructor can not set this field if we do not change it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, at some point we should change it in order to make it better maintainable. This will of course not be in the scope of this PR.

docs/ops/cli.md Outdated
-z,--zookeeperNamespace <zookeeperNamespace> Namespace to create the
Zookeeper sub-paths for high
availability mode
-nl,--nodeLabel <nodeLabelExpression> Specify YARN node label for
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should only be a Yarn specific option and not a general option. Mesos and other environments don't necessarily support this.

} catch (NoSuchMethodException e) {
LOG.warn("Ignoring node label setting because the version of YARN does not support it");
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we wrap this call in something like RegisterApplicationMasterResponseReflector?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean wrap this code segment to a new method named this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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?

private final Method applicationTagsMethod;
private final Method attemptFailuresValidityIntervalMethod;
private final Method keepContainersMethod;
private final Method nodeLabelExpressionMethod;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please mark the field @Nullable.

@yanghua
Copy link
Contributor Author

yanghua commented Mar 1, 2018

Hi @tillrohrmann should do more work for this PR?

Copy link
Contributor

@tillrohrmann tillrohrmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look good @yanghua. Have you tried these changes out on a Yarn cluster with node labels enabled?

@yanghua
Copy link
Contributor Author

yanghua commented Mar 1, 2018

@tillrohrmann yes I tested this feature in our inner YARN cluster, both yarn flink session and single job mode. It works fine.

Copy link
Contributor

@tillrohrmann tillrohrmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, merging this then :-) The only thing is that I cannot merge it into the 1.5 release since we already cut the branch.

tillrohrmann pushed a commit to tillrohrmann/flink that referenced this pull request Mar 1, 2018
[FLINK-7836] refactor the code and added some test code

[FLINK-7836][Client] mark field : nodeLabelExpressionMethod @nullable

This closes apache#5593.
@yanghua
Copy link
Contributor Author

yanghua commented May 29, 2018

hi @tillrohrmann can this PR been merged into master branch, so that we can close it?

1 similar comment
@yanghua
Copy link
Contributor Author

yanghua commented May 29, 2018

hi @tillrohrmann can this PR been merged into master branch, so that we can close it?

@tillrohrmann
Copy link
Contributor

Thanks for the reminder @yanghua. I forgot about it and will merge it now. Thanks again for your contributions. Flink wouldn't be what it is without you!

tillrohrmann pushed a commit to tillrohrmann/flink that referenced this pull request May 30, 2018
[FLINK-7836] refactor the code and added some test code

[FLINK-7836][Client] mark field : nodeLabelExpressionMethod @nullable

This closes apache#5593.
@asfgit asfgit closed this in b644801 May 30, 2018
sampathBhat pushed a commit to sampathBhat/flink that referenced this pull request Jul 26, 2018
[FLINK-7836] refactor the code and added some test code

[FLINK-7836][Client] mark field : nodeLabelExpressionMethod @nullable

This closes apache#5593.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants