public static void main(String[] args) throws Throwable { OptArgs ARGS = new Arguments(args).extract(new OptArgs()); // Bring up the cluster String[] h2oArgs; String as = ARGS.h2oArgs; if( as != null ) { if( as.startsWith("\"") && as.endsWith("\"") ) as = as.substring(1, as.length()-1); h2oArgs = as.trim().split("[ \t]+"); } else h2oArgs=new String[0]; H2O.main(h2oArgs); // Make sure we shutdown on all exit paths try { main(ARGS); } catch( Throwable t ) { t.printStackTrace(); throw t; } finally { UDPRebooted.T.shutdown.broadcast(); } }
if( H2O.CLOUD.size() > 1 ) { Log.warn("Killing "+h2o+" because of H2O version mismatch (md5 differs)."); UDPRebooted.T.mismatch.send(h2o); } else { Log.err("Attempting to join "+h2o+" with an H2O version mismatch (md5 differs). (Is H2O already running?) Exiting."); if( _cloudLocked ) { Log.warn("Killing "+h2o+" because the cloud is no longer accepting new H2O nodes."); UDPRebooted.T.locked.send(h2o); return 0;
UDPRebooted.T.reboot.broadcast();
public void broadcast() { send(H2O.SELF); } }
@Override public void run() { UDPRebooted.T.shutdown.send(H2O.SELF); H2O.exit(0); } }, 100);
/** Shutdown itself by sending a shutdown UDP packet. */ public void shutdown() { UDPRebooted.T.shutdown.send(H2O.SELF); H2O.exit(0); }
public static void checkForSuicide(int first_byte, AutoBuffer ab) { if( first_byte != UDP.udp.rebooted.ordinal() ) return; int type = ab.get1(); suicide( T.values()[type], ab._h2o); }
public void send(H2ONode target) { assert this != none; new AutoBuffer(target).putUdp(udp.rebooted).put1(ordinal()).close(); } public void broadcast() { send(H2O.SELF); }