@@ -27,7 +27,7 @@ use prost::Message;
2727use tokio:: sync:: OwnedMutexGuard ;
2828
2929use ballista_core:: serde:: protobuf:: {
30- self , job_status, task_status, CompletedJob , CompletedTask , ExecutorHeartbeat ,
30+ job_status, task_status, CompletedJob , CompletedTask , ExecutorHeartbeat ,
3131 ExecutorMetadata , FailedJob , FailedTask , JobStatus , PhysicalPlanNode , RunningJob ,
3232 RunningTask , TaskStatus ,
3333} ;
@@ -254,9 +254,9 @@ impl SchedulerState {
254254 executors : & [ ExecutorMeta ] ,
255255 ) -> Result < bool > {
256256 let executor_id: & str = match & task_status. status {
257- Some ( task_status:: Status :: Completed ( CompletedTask {
258- executor_id, ..
259- } ) ) => executor_id ,
257+ Some ( task_status:: Status :: Completed ( CompletedTask { executor_id } ) ) => {
258+ executor_id
259+ }
260260 Some ( task_status:: Status :: Running ( RunningTask { executor_id } ) ) => {
261261 executor_id
262262 }
@@ -318,36 +318,29 @@ impl SchedulerState {
318318 if task_is_dead {
319319 continue ' tasks;
320320 } else if let Some ( task_status:: Status :: Completed (
321- CompletedTask {
322- executor_id,
323- partition_stats,
324- } ,
321+ CompletedTask { executor_id } ,
325322 ) ) = & referenced_task. status
326323 {
327- // skip reading empty partitions
328- if partition_stats. as_ref ( ) . unwrap ( ) . num_rows > 0 {
329- let empty = vec ! [ ] ;
330- let locations = partition_locations
331- . entry ( stage_id)
332- . or_insert ( empty) ;
333- let executor_meta = executors
334- . iter ( )
335- . find ( |exec| exec. id == * executor_id)
336- . unwrap ( )
337- . clone ( ) ;
338- locations. push ( vec ! [
339- ballista_core:: serde:: scheduler:: PartitionLocation {
340- partition_id:
324+ let empty = vec ! [ ] ;
325+ let locations =
326+ partition_locations. entry ( stage_id) . or_insert ( empty) ;
327+ let executor_meta = executors
328+ . iter ( )
329+ . find ( |exec| exec. id == * executor_id)
330+ . unwrap ( )
331+ . clone ( ) ;
332+ locations. push ( vec ! [
333+ ballista_core:: serde:: scheduler:: PartitionLocation {
334+ partition_id:
341335 ballista_core:: serde:: scheduler:: PartitionId {
342336 job_id: partition. job_id. clone( ) ,
343337 stage_id,
344338 partition_id,
345339 } ,
346- executor_meta,
347- partition_stats: PartitionStats :: default ( ) ,
348- } ,
349- ] ) ;
350- }
340+ executor_meta,
341+ partition_stats: PartitionStats :: default ( ) ,
342+ } ,
343+ ] ) ;
351344 } else {
352345 continue ' tasks;
353346 }
@@ -460,31 +453,23 @@ impl SchedulerState {
460453 let mut job_status = statuses
461454 . iter ( )
462455 . map ( |status| match & status. status {
463- Some ( task_status:: Status :: Completed ( CompletedTask {
464- executor_id,
465- partition_stats,
466- } ) ) => Ok ( ( status, executor_id, partition_stats) ) ,
456+ Some ( task_status:: Status :: Completed ( CompletedTask { executor_id } ) ) => {
457+ Ok ( ( status, executor_id) )
458+ }
467459 _ => Err ( BallistaError :: General ( "Task not completed" . to_string ( ) ) ) ,
468460 } )
469461 . collect :: < Result < Vec < _ > > > ( )
470462 . ok ( )
471463 . map ( |info| {
472464 let partition_location = info
473465 . into_iter ( )
474- . map (
475- |( status, execution_id, partition_stats) | PartitionLocation {
476- partition_id : status. partition_id . to_owned ( ) ,
477- executor_meta : executors
478- . get ( execution_id)
479- . map ( |e| e. clone ( ) . into ( ) ) ,
480- partition_stats : Some ( protobuf:: PartitionStats {
481- num_rows : partition_stats. as_ref ( ) . unwrap ( ) . num_rows , //TODO
482- num_batches : 0 ,
483- num_bytes : 0 ,
484- column_stats : vec ! [ ] ,
485- } ) ,
486- } ,
487- )
466+ . map ( |( status, execution_id) | PartitionLocation {
467+ partition_id : status. partition_id . to_owned ( ) ,
468+ executor_meta : executors
469+ . get ( execution_id)
470+ . map ( |e| e. clone ( ) . into ( ) ) ,
471+ partition_stats : None ,
472+ } )
488473 . collect ( ) ;
489474 job_status:: Status :: Completed ( CompletedJob { partition_location } )
490475 } ) ;
@@ -761,7 +746,6 @@ mod test {
761746 let meta = TaskStatus {
762747 status : Some ( task_status:: Status :: Completed ( CompletedTask {
763748 executor_id : "" . to_owned ( ) ,
764- partition_stats : None ,
765749 } ) ) ,
766750 partition_id : Some ( PartitionId {
767751 job_id : job_id. to_owned ( ) ,
@@ -801,7 +785,6 @@ mod test {
801785 let meta = TaskStatus {
802786 status : Some ( task_status:: Status :: Completed ( CompletedTask {
803787 executor_id : "" . to_owned ( ) ,
804- partition_stats : None ,
805788 } ) ) ,
806789 partition_id : Some ( PartitionId {
807790 job_id : job_id. to_owned ( ) ,
@@ -839,7 +822,6 @@ mod test {
839822 let meta = TaskStatus {
840823 status : Some ( task_status:: Status :: Completed ( CompletedTask {
841824 executor_id : "" . to_owned ( ) ,
842- partition_stats : None ,
843825 } ) ) ,
844826 partition_id : Some ( PartitionId {
845827 job_id : job_id. to_owned ( ) ,
@@ -851,7 +833,6 @@ mod test {
851833 let meta = TaskStatus {
852834 status : Some ( task_status:: Status :: Completed ( CompletedTask {
853835 executor_id : "" . to_owned ( ) ,
854- partition_stats : None ,
855836 } ) ) ,
856837 partition_id : Some ( PartitionId {
857838 job_id : job_id. to_owned ( ) ,
@@ -883,7 +864,6 @@ mod test {
883864 let meta = TaskStatus {
884865 status : Some ( task_status:: Status :: Completed ( CompletedTask {
885866 executor_id : "" . to_owned ( ) ,
886- partition_stats : None ,
887867 } ) ) ,
888868 partition_id : Some ( PartitionId {
889869 job_id : job_id. to_owned ( ) ,
@@ -895,7 +875,6 @@ mod test {
895875 let meta = TaskStatus {
896876 status : Some ( task_status:: Status :: Completed ( CompletedTask {
897877 executor_id : "" . to_owned ( ) ,
898- partition_stats : None ,
899878 } ) ) ,
900879 partition_id : Some ( PartitionId {
901880 job_id : job_id. to_owned ( ) ,
@@ -927,7 +906,6 @@ mod test {
927906 let meta = TaskStatus {
928907 status : Some ( task_status:: Status :: Completed ( CompletedTask {
929908 executor_id : "" . to_owned ( ) ,
930- partition_stats : None ,
931909 } ) ) ,
932910 partition_id : Some ( PartitionId {
933911 job_id : job_id. to_owned ( ) ,
0 commit comments