flink-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aljos...@apache.org
Subject [1/3] flink git commit: Properly include Scala Shell in Documentation
Date Thu, 28 May 2015 13:48:58 GMT
Repository: flink
Updated Branches:
  refs/heads/master 7f5edeb9a -> 41181603d


Properly include Scala Shell in Documentation

This closes #672


Project: http://git-wip-us.apache.org/repos/asf/flink/repo
Commit: http://git-wip-us.apache.org/repos/asf/flink/commit/41181603
Tree: http://git-wip-us.apache.org/repos/asf/flink/tree/41181603
Diff: http://git-wip-us.apache.org/repos/asf/flink/diff/41181603

Branch: refs/heads/master
Commit: 41181603d2d89d948a515090176fe0f4949cf909
Parents: 6bb6de2
Author: Aljoscha Krettek <aljoscha.krettek@gmail.com>
Authored: Tue May 26 15:17:29 2015 +0200
Committer: Aljoscha Krettek <aljoscha.krettek@gmail.com>
Committed: Thu May 28 15:48:17 2015 +0200

----------------------------------------------------------------------
 docs/_includes/navbar.html     |  1 +
 docs/scala_shell.md            | 70 ++++++++++++++++++++++++++++++++++++
 docs/scala_shell_quickstart.md | 72 -------------------------------------
 3 files changed, 71 insertions(+), 72 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flink/blob/41181603/docs/_includes/navbar.html
----------------------------------------------------------------------
diff --git a/docs/_includes/navbar.html b/docs/_includes/navbar.html
index 6628e09..750e580 100644
--- a/docs/_includes/navbar.html
+++ b/docs/_includes/navbar.html
@@ -68,6 +68,7 @@ under the License.
                 <li><a href="{{ apis }}/python.html">Python API <span class="badge">Beta</span></a></li>
 
                 <li class="divider"></li>
+                <li><a href="scala_shell.html">Interactive Scala Shell</a></li>
                 <li><a href="{{ apis }}/dataset_transformations.html">Dataset
Transformations</a></li>
                 <li><a href="{{ apis }}/best_practices.html">Best Practices</a></li>
                 <li><a href="{{ apis }}/example_connectors.html">Connectors</a></li>

http://git-wip-us.apache.org/repos/asf/flink/blob/41181603/docs/scala_shell.md
----------------------------------------------------------------------
diff --git a/docs/scala_shell.md b/docs/scala_shell.md
new file mode 100644
index 0000000..fe26188
--- /dev/null
+++ b/docs/scala_shell.md
@@ -0,0 +1,70 @@
+---
+title: "Interactive Scala Shell"
+---
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+
+Flink comes with an integrated interactive Scala Shell.
+It can be used in a local setup as well as in a cluster setup. To get started with downloading
+Flink and setting up a cluster please refer to
+[local setup]({{ site.baseurl }}/setup/local_setup.html) or
+[cluster setup]({{ site.baseurl }}/setup/cluster.html) 
+
+To use the shell with an integrated Flink cluster just execute:
+
+~~~bash
+bin/start-scala-shell.sh 
+~~~
+
+in your link directory.
+
+To use it with a running cluster you can supply the host and port of the JobManager with:
+
+~~~bash
+bin/start-scala-shell.sh -host <hostname> -port <portnumber>
+~~~
+
+## Usage
+
+The shell will prebind the ExecutionEnvironment as "env", so far only batch mode is supported.
+
+The following example will execute the wordcount program in the Scala shell:
+
+~~~scala
+Scala-Flink> val text = env.fromElements(
+  "To be, or not to be,--that is the question:--",
+  "Whether 'tis nobler in the mind to suffer",
+  "The slings and arrows of outrageous fortune",
+  "Or to take arms against a sea of troubles,")
+Scala-Flink> val counts = text.flatMap { _.toLowerCase.split("\\W+") }.map { (_, 1) }.groupBy(0).sum(1)
+Scala-Flink> counts.print()
+~~~
+
+
+The print() command will automatically send the specified tasks to the JobManager for execution
and will show the result of the computation in the terminal.
+
+It is possbile to write results to a file. However, in this case you need to call `execute`,
to run your program:
+
+~~~scala
+Scala-Flink> env.execute("MyProgram")
+~~~
+
+The Flink Shell comes with command history and autocompletion.
+

http://git-wip-us.apache.org/repos/asf/flink/blob/41181603/docs/scala_shell_quickstart.md
----------------------------------------------------------------------
diff --git a/docs/scala_shell_quickstart.md b/docs/scala_shell_quickstart.md
deleted file mode 100644
index 4ad7f5b..0000000
--- a/docs/scala_shell_quickstart.md
+++ /dev/null
@@ -1,72 +0,0 @@
----
-title: "Quickstart: Scala Shell"
----
-<!--
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
--->
-
-* This will be replaced by the TOC
-{:toc}
-
-Start working on your Flink Scala program in a few simple steps.
-
-## Startup Flink interactive Scala shell
-
-Flink has an integrated interactive Scala shell.
-It can be used in a local setup as well as in a cluster setup.
-
-To use it in a local setup just execute:
-
-__Sample Input__:
-~~~bash
-flink/bin/start-scala-shell.sh 
-~~~
-
-And it will initialize a local JobManager by itself.
-
-To use it in a cluster setup you can supply the host and port of the JobManager with:
-
-__Sample Input__:
-~~~bash
-flink/bin/start-scala-shell.sh -host "<hostname>" -port <portnumber>
-~~~
-
-
-## Usage
-
-The shell will prebind the ExecutionEnvironment as "env", so far only batch mode is supported.
-
-The following example will execute the wordcount program in the Scala shell:
-
-~~~scala
-Flink-Shell> val text = env.fromElements("To be, or not to be,--that is the question:--","Whether
'tis nobler in the mind to suffer", "The slings and arrows of outrageous fortune","Or to take
arms against a sea of troubles,")
-Flink-Shell> val counts = text.flatMap { _.toLowerCase.split("\\W+") }.map { (_, 1) }.groupBy(0).sum(1)
-Flink-Shell> counts.print()
-~~~
-
-
-The print() command will automatically send the specified tasks to the JobManager for execution
and will show the result of the computation in the terminal.
-
-It is possbile to write results to a file, like in the standard Scala api. However, in this
case you need to call, to run your program:
-
-~~~scala
-Flink-Shell> env.execute("MyProgram")
-~~~
-
-The Flink Shell comes with command history and autocompletion.
-


Mime
View raw message