@ SuppressWarnings ( "rawtypes" ) public static WorkerShutdown mk_worker ( Map conf , IContext context , String topologyId , String supervisorId , int port , String workerId , String jarPath ) throws Exception { StringBuilder sb = new StringBuilder ( ) ; sb . append ( "topologyId:" ) . append ( topologyId ) . append ( ", " ) ; sb . append ( "port:" ) . append ( port ) . append ( ", " ) ; sb . append ( "workerId:" ) . append ( workerId ) . append ( ", " ) ; sb . append ( "jarPath:" ) . append ( jarPath ) . append ( "\n" ) ; LOG . info ( "Begin to run worker:" + sb . toString ( ) ) ; Worker w = new Worker ( conf , context , topologyId , supervisorId , port , workerId , jarPath ) ; // w.redirectOutput(); return w . execute ( ) ; }
create worker instance and run it