You can call `SparkContext#addSparkListener` with a listener that implements `onApplicationEnd`.
On Tue, May 14, 2019 at 1:51 AM Nasrulla Khan Haris <nasrulla.k...@microsoft.com.invalid> wrote: > HI All, > > > > Is there a API for sparkContext where we can add our custom code before > stopping sparkcontext ? > > Appreciate your help. > > Thanks, > > Nasrulla > > >