public static String [ ] schedulerCommand ( Config config , Config runtime , List < Integer > freePorts ) { List < String > commands = new ArrayList <> ( ) ; // The java executable should be "{JAVA_HOME}/bin/java" String javaExecutable = String . format ( "%s/%s" , Context . clusterJavaHome ( config ) , "bin/java" ) ; commands . add ( javaExecutable ) ; commands . add ( "-cp" ) ; // Construct the complete classpath to start scheduler String completeSchedulerProcessClassPath = String . format ( "%s:%s:%s" , Context . schedulerClassPath ( config ) , Context . packingClassPath ( config ) , Context . stateManagerClassPath ( config ) ) ; commands . add ( completeSchedulerProcessClassPath ) ; commands . add ( "org.apache.heron.scheduler.SchedulerMain" ) ; String [ ] commandArgs = schedulerCommandArgs ( config , runtime , freePorts ) ; commands . addAll ( Arrays . asList ( commandArgs ) ) ; return commands . toArray ( new String [ 0 ] ) ; }
Utils method to construct the command to start heron - scheduler