flink-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m..@apache.org
Subject [2/2] flink git commit: [FLINK-2522] improve welcome message of Scala shell for streaming
Date Wed, 06 Apr 2016 13:19:13 GMT
[FLINK-2522] improve welcome message of Scala shell for streaming

This closes #1412.


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

Branch: refs/heads/master
Commit: 593463bde36e35f55ccde2cec9f35fe6f49814e4
Parents: d7948fa
Author: Maximilian Michels <mxm@apache.org>
Authored: Wed Apr 6 15:10:21 2016 +0200
Committer: Maximilian Michels <mxm@apache.org>
Committed: Wed Apr 6 15:17:30 2016 +0200

----------------------------------------------------------------------
 .../org/apache/flink/api/scala/FlinkILoop.scala | 20 ++++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flink/blob/593463bd/flink-scala-shell/src/main/scala/org/apache/flink/api/scala/FlinkILoop.scala
----------------------------------------------------------------------
diff --git a/flink-scala-shell/src/main/scala/org/apache/flink/api/scala/FlinkILoop.scala
b/flink-scala-shell/src/main/scala/org/apache/flink/api/scala/FlinkILoop.scala
index 3d49747..b17cf15 100644
--- a/flink-scala-shell/src/main/scala/org/apache/flink/api/scala/FlinkILoop.scala
+++ b/flink-scala-shell/src/main/scala/org/apache/flink/api/scala/FlinkILoop.scala
@@ -235,11 +235,23 @@ class FlinkILoop(
 
               F L I N K - S C A L A - S H E L L
 
-NOTE: Use the prebound Execution Environment "env" to read data and execute your program:
-  * env.readTextFile("/path/to/data")
-  * env.execute("Program name")
+NOTE: Use the prebound Execution Environments to implement batch or streaming programs.
 
-HINT: You can use print() on a DataSet to print the contents to this shell.
+  Batch - Use the 'benv' variable
+
+    * val dataSet = benv.readTextFile("/path/to/data")
+    * dataSet.writeAsText("/path/to/output")
+    * benv.execute("My batch program")
+
+    HINT: You can use print() on a DataSet to print the contents to the shell.
+
+  Streaming - Use the 'senv' variable
+
+    * val dataStream = senv.fromElements(1, 2, 3, 4)
+    * dataStream.countWindowAll(2).sum(0).print()
+    * senv.execute("My streaming program")
+
+    HINT: You can only print a DataStream to the shell in local mode.
       """
     // scalastyle:on
     )


Mime
View raw message