use of org.apache.ignite.internal.pagemem.wal.record.WALRecord.RecordType in project ignite by apache.
the class RecordV1Serializer method readRecordType.
/**
* Reads record type from given {@code in}.
*
* @param in Buffer to read record type.
* @return Record type.
* @throws IgniteCheckedException If logical end of segment is reached.
* @throws IOException In case of I/O problems.
*/
static RecordType readRecordType(DataInput in) throws IgniteCheckedException, IOException {
int type = in.readUnsignedByte();
if (type == WALRecord.RecordType.STOP_ITERATION_RECORD_TYPE)
throw new SegmentEofException("Reached logical end of the segment", null);
RecordType recType = RecordType.fromOrdinal(type - 1);
if (recType == null)
throw new IOException("Unknown record type: " + type);
return recType;
}
Aggregations