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-2613] Print usage information for Scala Shell #1106
Conversation
Looks good. Is it possible that we cover both cases with tests?
|
9ef4470
to
f835a0f
Compare
The tests use the shell scripts ( |
659f868
to
e714c7a
Compare
|
||
|
||
/** | ||
* Created by nikste on 9/16/15. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove this comment
156716e
to
135ca75
Compare
Should be fixed according to your comments @fhueske |
*/ | ||
test("start flink scala shell with remote cluster") { | ||
|
||
val input: String = "val els = env.fromElements(\"a\",\"b\");\n" + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you also add a check, that the program was actually executed for example by checking that the correct output was produced?
Thanks for the update @nikste! I have only one minor thing to add. |
135ca75
to
b3c7d01
Compare
@nikste, since you need to change the pull request again, can you also fix the directory name of the classes |
b3c7d01
to
40f4253
Compare
@nikste Could you renaming the directory by using |
40f4253
to
2cc5d98
Compare
@chiwanpark I moved the files with git mv, however they still don't show the history. However, the history still exists and can be accessed via: git log --follow <some path to a moved file> |
Hey @nikste , you should rebase this to the current master. |
@@ -68,38 +94,62 @@ object FlinkShell { | |||
|
|||
def startShell( | |||
userHost : String, | |||
userPort : Int, | |||
userPort : Int, | |||
executionMode : ExecutionMode.Value, | |||
externalJars : Option[Array[String]] = None): Unit ={ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove space after parameter name like following:
def startShell(
userHost: String,
userPort: Int,
executionMode: ExecutionMode.value
Hi @nikste, thanks for update. It looks good to merge except some style issues. |
d4997d0
to
0bad350
Compare
@chiwanpark, white line issues are now fixed. |
Okay, if there is no objection and the travis passes, I'll merge this. |
miniCluster.start() | ||
val port = miniCluster.getLeaderRPCPort | ||
println(s"\nStarting local Flink cluster (host: localhost, port: $port).\n") | ||
("localhost",port, Some(miniCluster)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need a space after ,
.
@nikste Sorry for bothering you, but there are still some style issues. Looks good to merge except the issues. |
// buffered reader for testing | ||
FlinkShell.bufferedReader = Some(in) | ||
FlinkShell.main(args) | ||
baos.flush |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the return type of method or function is Unit
, adding parenthesis after name is recommended.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually the official reasoning is if it has some "side-effects" it should have some parenthesis (which it does in this case)
http://docs.scala-lang.org/style/method-invocation.html
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, right. And almost all the method of which return type is Unit
have some side-effects. :)
On Oct 8, 2015, at 5:05 PM, Nikolaas Steenbergen notifications@github.com wrote:
In flink-staging/flink-scala-shell/src/test/scala/org/apache/flink/api/scala/ScalaShellITSuite.scala:
- val (c, args) = cluster match{
case Some(cl) =>
val arg = Array("remote",
cl.hostname,
Integer.toString(cl.getLeaderRPCPort))
(cl, arg)
case None =>
fail("Cluster creation failed!")
- }
- //start scala shell with initialized
- // buffered reader for testing
- FlinkShell.bufferedReader = Some(in)
- FlinkShell.main(args)
- baos.flush
Actually the official reasoning is if it has some "side-effects" it should have some parenthesis (which it does in this case)
http://docs.scala-lang.org/style/method-invocation.html—
Reply to this email directly or view it on GitHub.
Regards,
Chiwan Park
05c06dc
to
5fb4738
Compare
@chiwanpark issues should be fixed now.. |
changed startup of scala shell user has to specify local or remote mode explicitly now.
5fb4738
to
e3e311b
Compare
@chiwanpark issues should be fixed NOW ;) |
Merging... |
- Change startup code of scala shell - User has to specify local or remote mode explicitly now. This closes apache#1106.
- Change startup code of scala shell - User has to specify local or remote mode explicitly now. This closes apache#1106.
changed startup of scala shell