public SeqnoList getMissing ( int max_msgs ) { lock . lock ( ) ; try { if ( size == 0 ) return null ; long start_seqno = getHighestDeliverable ( ) + 1 ; int capacity = ( int ) ( hr - start_seqno ) ; int max_size = max_msgs > 0 ? Math . min ( max_msgs , capacity ) : capacity ; if ( max_size <= 0 ) return null ; Missing missing = new Missing ( start_seqno , max_size ) ; long to = max_size > 0 ? Math . min ( start_seqno + max_size - 1 , hr - 1 ) : hr - 1 ; forEach ( start_seqno , to , missing ) ; return missing . getMissingElements ( ) ; } finally { lock . unlock ( ) ; } }
Returns a list of missing messages