Skip to content
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-3774] [shell] Forwards Flink configuration to PlanExecutor #1904

Closed
wants to merge 4 commits into from

Conversation

tillrohrmann
Copy link
Contributor

Thanks for contributing to Apache Flink. Before you open your pull request, please take the following check list into consideration.
If your changes take all of the items into account, feel free to open your pull request. For more information and/or questions please refer to the How To Contribute guide.
In addition to going through the list, please provide a meaningful description of your changes.

  • General
    • The pull request references the related JIRA issue
    • The pull request addresses only one issue
    • Each commit in the PR has a meaningful commit message
  • Documentation
    • Documentation has been added for new functionality
    • Old documentation affected by the pull request has been updated
    • JavaDoc for public methods has been added
  • Tests & Build
    • Functionality added by the pull request is covered by tests
    • mvn clean verify has been executed successfully locally or a Travis build has passed

The ScalaShellRemoteEnvironment did not properly forward the given Flink configuration
to the PlanExecutor. Consequently, it was not possible to configure the Client to connect
to an HA cluster. This PR corrects the forwarding.

The ScalaShellRemoteEnvironment did not properly forward the given Flink configuration
to the PlanExecutor. Consequently, it was not possible to configure the Client to connect
to an HA cluster. This PR corrects the forwarding.
}

// ------------------------------------------------------------------------

@Override
public JobExecutionResult execute(String jobName) throws Exception {
ensureExecutorCreated();
PlanExecutor executor = getExecutor();
Copy link
Contributor

Choose a reason for hiding this comment

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

would it make sense to move the assignment to this.executor from getExecutor() to this line? as it stands the ScalaShellRemoteEnvironment executor is never closed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You're right, it's bad that the PlanExecutor is not stopped after it has been used. I will fix this by checking in ScalaShellRemoteEnvironment.getExecutor whether this.executor is set. If true, then it will call this.executor.stop(). That way, there will always be at most one PlanExecutor active and the last one is stopped by the dispose call.

@@ -133,26 +137,31 @@ public RemoteEnvironment(String host, int port, Configuration clientConfig,
this.port = port;
this.clientConfiguration = clientConfig == null ? new Configuration() : clientConfig;
if (jarFiles != null) {
this.jarFiles = new URL[jarFiles.length];
this.jarFiles = new ArrayList<URL>(jarFiles.length);
Copy link
Member

Choose a reason for hiding this comment

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

Nitpick - No need of :(

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will fix it.

this.jarFiles = new URL[jarFiles.length];
for (int i = 0; i < jarFiles.length; i++) {
this.jarFiles = new ArrayList<>(jarFiles.length);
for(String jarFile : jarFiles) {
Copy link
Contributor

Choose a reason for hiding this comment

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

whitespace missing after for

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will fix it.

@uce
Copy link
Contributor

uce commented Apr 25, 2016

Changes look good! +1 to merge

@tillrohrmann
Copy link
Contributor Author

Thanks for the review @uce, @smarthi and @zentol. Will fix the test problem with Scala 2.11 and then merge this PR.

@tillrohrmann
Copy link
Contributor Author

Failing test case is unrelated. Merging.

@asfgit asfgit closed this in 0ee7c79 Apr 25, 2016
kl0u pushed a commit to kl0u/flink that referenced this pull request Apr 29, 2016
The ScalaShellRemoteEnvironment did not properly forward the given Flink configuration
to the PlanExecutor. Consequently, it was not possible to configure the Client to connect
to an HA cluster. This PR corrects the forwarding.

Fix failing FlinkILoopTest with Scala 2.11

This closes apache#1904.
StefanRRichter pushed a commit to StefanRRichter/flink that referenced this pull request May 3, 2016
The ScalaShellRemoteEnvironment did not properly forward the given Flink configuration
to the PlanExecutor. Consequently, it was not possible to configure the Client to connect
to an HA cluster. This PR corrects the forwarding.

Fix failing FlinkILoopTest with Scala 2.11

This closes apache#1904.
@tillrohrmann tillrohrmann deleted the fixScalaShell branch August 19, 2016 12:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants