I have a class like below, and when i run this through command line i want to see progress status. some thing like,
10% completed...
30% completed...
100%
If you are using scala-spark this code will help you to adding spark listener.
Create your SparkContext
val sc=new SparkContext(sparkConf)
Now you can add your spark listener in spark context
sc.addSparkListener(new SparkListener() {
override def onApplicationStart(applicationStart: SparkListenerApplicationStart) {
println("Spark ApplicationStart: " + applicationStart.appName);
}
override def onApplicationEnd(applicationEnd: SparkListenerApplicationEnd) {
println("Spark ApplicationEnd: " + applicationEnd.time);
}
});
Here is the list of Interface for listening to events from the Spark schedule.