I have a spark application written in Java which runs everyday. I have a requirement to exit the program(stop the spark application) based on a condition. I am currently using System.exit(0) for shutting down the application. But i see the application status shows as FAILED in Yarn UI.
FinalStatus Reported by AM: FAILED
Inside Code:
if(<some condition>){
System.exit(0);
}
Please suggest how to completely stop/shutdown the spark application internally from the code, where the FinalStatus shows "SUCCESS".