private void issueRequestIfNeeded ( ) { //compute read length based on current offset up to which the events are read. int updatedReadLength = computeReadLength ( offset + buffer . dataAvailable ( ) ) ; if ( ! receivedEndOfSegment && ! receivedTruncated && updatedReadLength > 0 && outstandingRequest == null ) { log . trace ( "Issuing read request for segment {} of {} bytes" , getSegmentId ( ) , updatedReadLength ) ; outstandingRequest = asyncInput . read ( offset + buffer . dataAvailable ( ) , updatedReadLength ) ; } }
Issues a request - if there is enough room for another request and we aren t already waiting on one and - if we have not read up to the configured endOffset .