static < T extends RemoteRunnable > T runOnH2ONode ( H2ONode node , T runnable ) { if ( node == H2O . SELF ) { // run directly runnable . run ( ) ; return runnable ; } else { RunnableWrapperTask < T > task = new RunnableWrapperTask <> ( runnable ) ; try { return new RPC <> ( node , task ) . call ( ) . get ( ) . _runnable ; } catch ( DistributedException e ) { Log . trace ( "Exception in calling runnable on a remote node" , e ) ; Throwable cause = e . getCause ( ) ; throw cause instanceof RuntimeException ? ( RuntimeException ) cause : e ; } } }
package - private for unit tests