I know we can use the use count(). But I'm trying to capture the count using sparkListener. But I'm failing to write a proper java code for the same. I've tried following the exact approach given in this How to implement custom job listener/tracker in Spark? But I'm not able to reproduce it in JAVA. This is something that I've tried.
sparkContext.sparkContext().addSparkListener(new SparkListener()
{
@Override
private void onTaskEnd(SparkListenerTaskEnd taskEnd){
taskEnd.taskInfo().accumulables().name
}
});
But it throws a lot of errors related to override and name.Any help is appreciated. Thanks.