[ 
https://issues.apache.org/jira/browse/FLINK-2613?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14948717#comment-14948717
 ] 

ASF GitHub Bot commented on FLINK-2613:
---------------------------------------

Github user chiwanpark commented on a diff in the pull request:

    https://github.com/apache/flink/pull/1106#discussion_r41518056
  
    --- Diff: 
flink-staging/flink-scala-shell/src/main/scala/org/apache/flink/api/scala/FlinkShell.scala
 ---
    @@ -67,39 +93,62 @@ object FlinkShell {
     
     
       def startShell(
    -      userHost : String, 
    -      userPort : Int, 
    -      externalJars : Option[Array[String]] = None): Unit ={
    +      userHost: String,
    +      userPort: Int,
    +      executionMode: ExecutionMode.Value,
    +      externalJars: Option[Array[String]] = None): Unit ={
         
         println("Starting Flink Shell:")
     
    -    var cluster: LocalFlinkMiniCluster = null
    -
         // either port or userhost not specified by user, create new 
minicluster
    -    val (host,port) = if (userHost == "none" || userPort == -1 ) {
    -      println("Creating new local server")
    -      cluster = new LocalFlinkMiniCluster(new Configuration, false)
    -      cluster.start()
    -      ("localhost",cluster.getLeaderRPCPort)
    -    } else {
    -      println(s"Connecting to remote server (host: $userHost, port: 
$userPort).")
    -      (userHost, userPort)
    -    }
    -    
    -    // custom shell
    -    val repl = new FlinkILoop(host, port, externalJars) //new MyILoop();
    -
    -    repl.settings = new Settings()
    -
    -    repl.settings.usejavacp.value = true
    -
    -    // start scala interpreter shell
    -    repl.process(repl.settings)
    -
    -    //repl.closeInterpreter()
    -
    -    if (cluster != null) {
    -      cluster.stop()
    +    val (host: String, port: Int, cluster: Option[LocalFlinkMiniCluster]) =
    +      executionMode match {
    +        case ExecutionMode.LOCAL =>
    +          val miniCluster = new LocalFlinkMiniCluster(new Configuration, 
false)
    +          miniCluster.start()
    +          val port = miniCluster.getLeaderRPCPort
    +          println(s"\nStarting local Flink cluster (host: localhost, port: 
$port).\n")
    +          ("localhost",port, Some(miniCluster))
    --- End diff --
    
    Need a space after `,`.


> Print usage information for Scala Shell
> ---------------------------------------
>
>                 Key: FLINK-2613
>                 URL: https://issues.apache.org/jira/browse/FLINK-2613
>             Project: Flink
>          Issue Type: Improvement
>          Components: Scala Shell
>    Affects Versions: 0.10
>            Reporter: Maximilian Michels
>            Assignee: Nikolaas Steenbergen
>            Priority: Minor
>              Labels: starter
>             Fix For: 0.10
>
>
> The Scala Shell startup script starts a {{FlinkMiniCluster}} by default if 
> invoked with no arguments.
> We should add a {{--help}} or {{-h}} option to make it easier for people to 
> find out how to configure remote execution. Alternatively, we could print a 
> notice on the local startup explaining how to start the shell in remote mode.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to