// ��ǰ�����ļ�
while (startOffset < maxOffset && (msgSet = (FileMessageSet) store.slice(startOffset, MAX_SIZE)) != null) {
final int sizeInBytes = (int) msgSet.getSizeInBytes();
final ByteBuffer buffer = ByteBuffer.allocate(sizeInBytes);
msgSet.read(buffer);
final MessageIterator it = new MessageIterator(topic, buffer.array());
final List<DecodeMessage> msgList = new ArrayList<DecodeMessage>();
// ������Ϣ
long msgOffset = 0;
while (it.hasNext()) {
try {
final Message msg = it.next();
msgList.add(new DecodeMessage(msg.getId(), startOffset + it.getOffset()));
msgOffset = it.getOffset();
}
catch (final InvalidMessageException e) {
// �����ϲ����������������Ԥ����һ���Ǵ�ӡ��־
log.error("Message was corrupted,partition=" + store.getDescription() + ",offset=" + msgOffset);
}
}
// recover��һ����Ϣ
this.recoverOffset(offsetInfos, segRecoverOffsetInfos, msgList);
// ��ǰ�ƶ�startOffset
startOffset = startOffset + it.getOffset();
}
// �Ƴ���segment�ܹ���ƫ��offset
for (final OffsetInfo info : segRecoverOffsetInfos) {
offsetInfos.remove(info.oldMsgId);