Counts words in text encoded with UTF8 received from the network every second.
Usage: NetworkWordCount <master> <hostname> <port>
<master> is the Spark master URL. In local mode, <master> should be 'local[n]' with n > 1.
<hostname> and <port> describe the TCP server that Spark Streaming would connect to receive data.
To run this on your local machine, you need to first run a Netcat server
$ nc -lk 9999
and then run the example
$ ./bin/run-example org.apache.spark.streaming.examples.NetworkWordCount local[2] localhost 9999
Counts words in text encoded with UTF8 received from the network every second.
Usage: NetworkWordCount <master> <hostname> <port> <master> is the Spark master URL. In local mode, <master> should be 'local[n]' with n > 1. <hostname> and <port> describe the TCP server that Spark Streaming would connect to receive data.
To run this on your local machine, you need to first run a Netcat server
$ nc -lk 9999
and then run the example$ ./bin/run-example org.apache.spark.streaming.examples.NetworkWordCount local[2] localhost 9999