Isnt that something that the app could/should do own its own? Probably has
not much to do with Tez itself.



*From:* Thaddeus Diamond [mailto:[email protected]]
*Sent:* Monday, August 11, 2014 12:09 PM
*To:* [email protected]
*Subject:* Re: Application Shutdown



Neither.  Sorry for the lack of clarity.  What I want is an API so that the
following is added:



Runtime.getRuntime().addShutdownHook(new Thread() {

     public void run() {

        tezClient.stop();

     }

});



This would just be sugar.  It could be a configuration setting IMHO or just
a call like:



tezClient.stopOnJvmShutdown();



It just may be desirable if a single JVM is responsible for it's own
session.  My application is a single JVM that reuses the same session, but
no other JVM has access to that session.



On Mon, Aug 11, 2014 at 2:22 PM, Hitesh Shah <[email protected]> wrote:

Hi Thad,

To clarify, are you looking for an API in the client to invoke a callback
when a session has shut down? Or invoke user logic in the AM when the
session is about to shut down?

For the former, given that client does not poll the session continuously,
detecting the session shutdown is only done when an API is invoked that
requires the client to communicate with the AM. In such cases, a
SessionNotRunning exception should be thrown. If you are looking at
maintaining a live session handle all the time, one approach maybe to
launch a thread that periodically invokes getAppMasterStatus and handle
cases when the session has died.

For the latter, there is no such support today.

— Hitesh



On Aug 11, 2014, at 11:14 AM, Bikas Saha <[email protected]> wrote:

> This tracks it https://issues.apache.org/jira/browse/TEZ-1191
>
> From: Thaddeus Diamond [mailto:[email protected]]
> Sent: Monday, August 11, 2014 9:03 AM
> To: [email protected]
> Subject: Application Shutdown
>
> Hey,
>
> Is there a way to trap a Tez session shutdown on JVM shutdown?  The best
I can think of is some manual shutdown hook like
http://stackoverflow.com/questions/2921945/useful-example-of-a-shutdown-hook-in-java,
but it would be nice to be able to say:
>
> TezClient tezSession = new TezClient(...);
> tezSession.shutdownOnJvmExit();
> tezSession.start();
>
> Or some TezConfiguration setting.
>
> Is there something like this?  Should I file a JIRA?
>
> - Thad
>
> CONFIDENTIALITY NOTICE
> NOTICE: This message is intended for the use of the individual or entity
to which it is addressed and may contain information that is confidential,
privileged and exempt from disclosure under applicable law. If the reader
of this message is not the intended recipient, you are hereby notified that
any printing, copying, dissemination, distribution, disclosure or
forwarding of this communication is strictly prohibited. If you have
received this communication in error, please contact the sender immediately
and delete it from your system. Thank You.

-- 
CONFIDENTIALITY NOTICE
NOTICE: This message is intended for the use of the individual or entity to 
which it is addressed and may contain information that is confidential, 
privileged and exempt from disclosure under applicable law. If the reader 
of this message is not the intended recipient, you are hereby notified that 
any printing, copying, dissemination, distribution, disclosure or 
forwarding of this communication is strictly prohibited. If you have 
received this communication in error, please contact the sender immediately 
and delete it from your system. Thank You.

Reply via email to