question: public static String [ ] schedulerCommandArgs ( Config config , Config runtime , List < Integer > freePorts ) { if ( freePorts . size ( ) < PORTS_REQUIRED_FOR_SCHEDULER ) { throw new RuntimeException ( "Failed to find enough ports for executor" ) ; } for ( int port : freePorts ) { if ( port == - 1 ) { throw new RuntimeException ( "Failed to find available ports for executor" ) ; } } int httpPort = freePorts . get ( 0 ) ; List < String > commands = new ArrayList < > ( ) ; commands . add ( "--cluster" ) ; commands . add ( Context . cluster ( config ) ) ; commands . add ( "--role" ) ; commands . add ( Context . role ( config ) ) ; commands . add ( "--environment" ) ; commands . add ( Context . environ ( config ) ) ; commands . add ( "--topology_name" ) ; commands . add ( Context . topologyName ( config ) ) ; commands . add ( "--topology_bin" ) ; commands . add ( Context . topologyBinaryFile ( config ) ) ; commands . add ( "--http_port" ) ; commands . add ( Integer . toString ( httpPort ) ) ; return commands . toArray ( new String [ 0 ] ) ; }
target:  Util method to get the arguments to the heron scheduler.