提交 7582390c 编写于 作者: M mbalassi 提交者: Gábor Hermann

[FLINK-1429] [streaming] Scala programming guide update: intro & operators, minor fixes

This closes #463
上级 bd1b916f
......@@ -58,7 +58,7 @@ public class WordCountExample {
public static void main(String[] args) throws Exception {
final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
DataSet<String> text = env.fromElements(
DataSet<String> text = env.fromElements(
"Who's there?",
"I think I hear them. Stand, ho! Who's there?");
......
此差异已折叠。
......@@ -221,8 +221,8 @@ class DataStream[T](javaStream: JavaStream[T]) {
*
*
*/
def iterate[R](maxWaitTimeMillis:Long = 0)(stepFunction: DataStream[T] => (DataStream[T], DataStream[R]))
: DataStream[R] = {
def iterate[R](maxWaitTimeMillis:Long = 0)
(stepFunction: DataStream[T] => (DataStream[T], DataStream[R])) : DataStream[R] = {
val iterativeStream = javaStream.iterate(maxWaitTimeMillis)
val (feedback, output) = stepFunction(new DataStream[T](iterativeStream))
......@@ -495,23 +495,6 @@ class DataStream[T](javaStream: JavaStream[T]) {
*/
def split(selector: OutputSelector[T]): SplitDataStream[T] = javaStream.split(selector)
// /**
// * Creates a new SplitDataStream that contains only the elements satisfying the
// * given output selector predicate.
// */
// def split(fun: T => String): SplitDataStream[T] = {
// if (fun == null) {
// throw new NullPointerException("OutputSelector must not be null.")
// }
// val selector = new OutputSelector[T] {
// val cleanFun = clean(fun)
// def select(in: T): java.lang.Iterable[String] = {
// List(cleanFun(in))
// }
// }
// split(selector)
// }
/**
* Creates a new SplitDataStream that contains only the elements satisfying the
* given output selector predicate.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册