Skip to content

[FLINK-9156][REST][CLI] Update --jobmanager option logic for REST client#5838

Closed
zentol wants to merge 2 commits intoapache:masterfrom
zentol:9156
Closed

[FLINK-9156][REST][CLI] Update --jobmanager option logic for REST client#5838
zentol wants to merge 2 commits intoapache:masterfrom
zentol:9156

Conversation

@zentol
Copy link
Contributor

@zentol zentol commented Apr 11, 2018

What is the purpose of the change

With this PR the --jobmanager option is properly respected by the RestClusterClient. The problem was that the existing code was only setting JobManagerOptions.ADDRESS and JobManagerOptions.PORT, but not the corresponding RestOptions that are used for all REST API calls. The RestOptions are accessed inHighAvailabilityServicesUtils#createHighAvailabilityServices to create the webmonitor URL that is used by the client.

Brief change log

  • set appropriate RestOptions in CliFrontend#setJobManagerAddressInConfig
  • add test

Verifying this change

  • run RestClusterClientTest#testRESTManualConfigurationOverride

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 applicable)

Copy link
Member

@GJL GJL left a comment

Choose a reason for hiding this comment

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

Some comments of rather cosmetic nature.
image


URL webMonitorBaseUrl = clusterClient.getWebMonitorBaseUrl().get();
assertThat(webMonitorBaseUrl.getHost(), Matchers.equalTo(manualHostname));
assertThat(webMonitorBaseUrl.getPort(), Matchers.equalTo(manualPort));
Copy link
Member

Choose a reason for hiding this comment

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

There is already a static import for equalTo in this file. I think it should be used, i.e.,

assertThat(webMonitorBaseUrl.getHost(), equalTo(manualHostname));
assertThat(webMonitorBaseUrl.getPort(), equalTo(manualPort));

*/
@Test
public void testRESTManualConfigurationOverride() throws Exception {
final String localhost = "localhost";
Copy link
Member

Choose a reason for hiding this comment

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

Maybe configuredHostname, to be consistent with manualHostname. localhost is an arbitrary value, and should not be the name of the variable.

@zentol
Copy link
Contributor Author

zentol commented Apr 16, 2018

merging.

zentol added a commit to zentol/flink that referenced this pull request Apr 16, 2018
zentol added a commit to zentol/flink that referenced this pull request Apr 16, 2018
asfgit pushed a commit that referenced this pull request Apr 16, 2018
@asfgit asfgit closed this in 4f0fa0b Apr 16, 2018
@zentol zentol deleted the 9156 branch April 16, 2018 19:25
sampathBhat pushed a commit to sampathBhat/flink that referenced this pull request Jul 26, 2018
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