My Java application runs on mapper and creates child processes using Qubole API. Application stores child qubole queryIDs. I need to intercept kill signal and shutdown child processes before exit. hadoop job -kill jobId
and yarn application -kill applicationId
commands are killing job in a SIGKILL manner, I do not know how to intercept shutdown. Is it possible to intercept job kill somehow or configure hadoop to give application chance to shutdown gracefully?
Application successfully intercepts shutdown using ShutdownHook
when running locally, not in mapper container and able to kill it's child processes.
Please suggest how to intercept shutdown when running in mapper, or maybe I'm doing something wrong?