Spark教程

时间:2016-11-14 04:33:06

标签: scala spark-streaming

1 个答案:

答案 0 :(得分:0)

在终端上使用此命令。

nc -lk 9999

这将是这样的:

# TERMINAL 1:
# Running Netcat

$ nc -lk 9999
apache spark
apache hadoop

输出结果为:

-------------------------------------------
Batch: 0
-------------------------------------------
+------+-----+
| value|count|
+------+-----+
|apache|    1|
| spark|    1|
+------+-----+

-------------------------------------------
Batch: 1
-------------------------------------------
+------+-----+
| value|count|
+------+-----+
|apache|    2|
| spark|    1|
|hadoop|    1|
+------+-----+
...

并相应地查看输出。

在此更好地记录:https://home.apache.org/~pwendell/spark-nightly/spark-branch-2.0-docs/latest/structured-streaming-programming-guide.html#quick-example