final int recordSize = getLength(_readBuffer);
final int type = getType(_readBuffer);
final long timestamp = getTimestamp(_readBuffer);
if (recordSize >= _blockSize || recordSize < OVERHEAD) {
throw new CorruptJournalException("Bad JournalRecord length " + recordSize + " at position "
+ addressToString(from, timestamp));
}
switch (type) {
case JE.TYPE:
scanJournalEnd(from, timestamp, recordSize);
break;
case JH.TYPE:
break;
case SR.TYPE:
case DR.TYPE:
case DT.TYPE:
case D0.TYPE:
case D1.TYPE:
throw new CorruptJournalException("Unexpected record of type " + type + " at " + addressToString(from));
case IV.TYPE:
scanIdentifyVolume(from, timestamp, recordSize);
break;
case IT.TYPE:
scanIdentifyTree(from, timestamp, recordSize);
break;
case PA.TYPE:
scanLoadPage(from, timestamp, recordSize);
break;
case PM.TYPE:
scanLoadPageMap(from, timestamp, recordSize);
break;
case TM.TYPE:
scanLoadTransactionMap(from, timestamp, recordSize);
break;
case TX.TYPE:
scanOneTransaction(from, timestamp, recordSize);
break;
case CP.TYPE:
scanCheckpoint(from, timestamp, recordSize);
break;
default:
if (!isValidType(type)) {
_currentAddress -= OVERHEAD;
throw new CorruptJournalException("Invalid record type " + type + " at " + addressToString(from));
}
}
_currentAddress = from + recordSize;
return type;
}