I am trying to execute below code using eclipse (with maven conf) with 2 worker and each have 2 core or also tried with spark-submit.
public class StreamingW
textFileStream can only monitor a folder when the files in the folder are being added or updated.
textFileStream
If you just want to read files, you can rather use SparkContext.textFile.
SparkContext.textFile