public MessageSet read ( long offset , int length ) throws IOException { List < LogSegment > views = segments . getView ( ) ; LogSegment found = findRange ( views , offset , views . size ( ) ) ; if ( found == null ) { if ( logger . isTraceEnabled ( ) ) { logger . trace ( format ( "NOT FOUND MessageSet from Log[%s], offset=%d, length=%d" , name , offset , length ) ) ; } return MessageSet . Empty ; } return found . getMessageSet ( ) . read ( offset - found . start ( ) , length ) ; }
read messages beginning from offset