public static void printJobRuns ( List < JobExecutionInfo > jobExecutionInfos ) { if ( jobExecutionInfos == null ) { System . err . println ( "No job executions found." ) ; System . exit ( 1 ) ; } List < String > labels = Arrays . asList ( "Job Id" , "State" , "Schedule" , "Completed Tasks" , "Launched Tasks" , "Start Time" , "End Time" , "Duration (s)" ) ; List < String > flags = Arrays . asList ( "-" , "-" , "-" , "" , "" , "-" , "-" , "-" ) ; List < List < String > > data = new ArrayList <> ( ) ; for ( JobExecutionInfo jobInfo : jobExecutionInfos ) { List < String > entry = new ArrayList <> ( ) ; entry . add ( jobInfo . getJobId ( ) ) ; entry . add ( jobInfo . getState ( ) . toString ( ) ) ; entry . add ( extractJobSchedule ( jobInfo ) ) ; entry . add ( jobInfo . getCompletedTasks ( ) . toString ( ) ) ; entry . add ( jobInfo . getLaunchedTasks ( ) . toString ( ) ) ; entry . add ( dateTimeFormatter . print ( jobInfo . getStartTime ( ) ) ) ; entry . add ( dateTimeFormatter . print ( jobInfo . getEndTime ( ) ) ) ; entry . add ( jobInfo . getState ( ) == JobStateEnum . COMMITTED ? decimalFormatter . format ( jobInfo . getDuration ( ) / 1000.0 ) : "-" ) ; data . add ( entry ) ; } new CliTablePrinter . Builder ( ) . labels ( labels ) . data ( data ) . flags ( flags ) . delimiterWidth ( 2 ) . build ( ) . printTable ( ) ; }
Print a table describing a bunch of individual job executions .