NodeManager Source
Read the NodeManager source of the time to notice a very interesting Java code, as follows
public static void Main (string[] args) throws IOException {
Thread.setdefaultuncaughtexceptionhandler (new Yarnuncaughtexceptionhandler ());
Stringutils.startupshutdownmessage (Nodemanager.class, args, LOG);
NodeManager NodeManager = new NodeManager ();
Configuration conf = new yarnconfiguration ();
New Genericoptionsparser (conf, args);
Nodemanager.initandstartnodemanager (conf, false);
Test
The following test comes from confirming whether the scenario will take effect under the multithreaded submission task. Because another article inside said executorservice.submit the scene does not take effect. But in fact it can still be effective.
Article referred to: http://blog.csdn.net/u013256816/article/details/50417822
public class Mydefaultuncaughtexceptionhandler {static Class Myuncauthexceptionhandler Impl
Ements thread.uncaughtexceptionhandler{@Override public void uncaughtexception (Thread t, Throwable e) {
System.out.println ("uncaughtexception:" + t.getname () + "" + e.getmessage ()); } public static void Main (String args[]) {Thread.setdefaultuncaughtexceptionhandler (new myuncauthexcept
Ionhandler ());
Executorservice es = Executors.newcachedthreadpool ();
Es.execute (New Runnable () {@Override public void run () {int i = 2/0;
}
});
Es.shutdown (); }
}