This is an example that demonstrates usage of:
- Spark streaming and embedded Spark instance.
- Different spark data analysis approaches.
- Commons CLI to parse parameters.
- Build project with
$ mvn package
. - Locate created spark-folder-monitor-xxx-jar-with-dependencies.jar in target folder.
- Run
$ java -jar spark-folder-monitor-xxx-jar-with-dependencies.jar --help
to get information about available parameters. - Run
$ java -jar spark-folder-monitor-xxx-jar-with-dependencies.jar
to use default parameters (check monitor folder, display 10 items, use 10 seconds interval). - Move some text files to monitored folder.
- Check console output. You should see analysis results - top used words, longest line etc.
Feel free to use, comment or collaborate.