public boolean isExit ( ) { if ( currentRow > finalRow ) { //request new block of work String newBlock = this . sendRequestSync ( "this/request/block" ) ; LineCountManager . LineCountBlock block = new LineCountManager . LineCountBlock ( 0 , 0 ) ; if ( newBlock . contains ( "exit" ) ) { getExitFlag ( ) . set ( true ) ; makeReport ( true ) ; return true ; } else { block . buildFromResponse ( newBlock ) ; } currentRow = block . getStart ( ) ; finalRow = block . getStop ( ) ; } else { //report the number of lines written makeReport ( false ) ; if ( exit . get ( ) ) { getExitFlag ( ) . set ( true ) ; return true ; } } return false ; }
Exit reporting up to distributor using information gained from status reports to the LineCountManager