private static boolean repStep ( BufferedReader in , boolean readConsoleInput ) throws IOException , InterruptedException { // wait until CLIENT_POLLING_INTERVAL is over or the user entered something. long startTime = System . currentTimeMillis ( ) ; while ( ( System . currentTimeMillis ( ) - startTime ) < CLIENT_POLLING_INTERVAL_MS && ( ! readConsoleInput || ! in . ready ( ) ) ) { Thread . sleep ( 200L ) ; } //------------- handle interactive command by user. ---------------------- if ( readConsoleInput && in . ready ( ) ) { String command = in . readLine ( ) ; switch ( command ) { case "quit" : case "stop" : return false ; case "help" : System . err . println ( YARN_SESSION_HELP ) ; break ; default : System . err . println ( "Unknown command '" + command + "'. Showing help:" ) ; System . err . println ( YARN_SESSION_HELP ) ; break ; } } return true ; }
Read - Evaluate - Print step for the REPL .