<> <> <> <> <> <> <> <> <> DIRECTORY Basics, ConstArith, Camelot, YggEnvironment; YggLog: CEDAR DEFINITIONS = BEGIN Comparison: TYPE = Basics.Comparison; logDeviceCharacteristics: YggEnvironment.DeviceCharacteristics; wordsPerPage: CARD; -- machine dependent words in a Log page RecordType: TYPE = MACHINE DEPENDENT { <> <> --ControlRecord-- noop (0), checkpointBegin(2), checkpointComplete (5), startTrans (10), commitTrans (15), abortTrans (19), --FileRecord-- writeBytes (100), --Reserved-- reserved (200), (LAST[INTEGER]) }; -- s/b LAST[CARDINAL] but for compiler bug RecordID: TYPE = ConstArith.Const; <> nullRecordID: RecordID = [zero, 0, 0]; <> firstRecordID: RecordID = [zero, 0, 0]; <> lastRecordID: RecordID = [positive, LAST[CARD], LAST[CARD]]; <> LogRecordPhaseType: TYPE = { << Identifies during which phase of recovery the record is needed.>> analysis, -- only needed in analysis phase (e.g., transaction commit) redo, -- only needed in redo phase (e.g., writePages) undo, -- only needed in undo phase redoUndo, -- needed in both redo and undo phases other -- other records (e. g., checkpointBegin) }; <<>> Block: TYPE = RECORD [ base: LONG POINTER, length: CARD, -- in 32 bit words rest: BlockPtr _ NIL ]; BlockPtr: TYPE = LONG POINTER TO Block; nullBlock: Block = [base: NIL, length: 0, rest: NIL]; <> RecoveryProc: TYPE = PROC [ record: RecordID, type: RecordType, trans: YggEnvironment.TransID, outcome: YggEnvironment.Outcome]; <> <> <> RegisterRecoveryProc: PROC [recordType: RecordType, recoveryProc: RecoveryProc]; <> <> <> <> <> ReadForRecovery: ReadProc; <> <> <<>> <> <> Write: PROC [trans: YggEnvironment.TransID, logRecordPhaseType: LogRecordPhaseType, recordType: RecordType, optr: Camelot.optrT, recordData: Block, force: BOOL _ FALSE, writeID: BOOL _ FALSE] RETURNS [thisRecord, followingRecord: RecordID, thisWordNumber: YggEnvironment.WordNumber]; <> WriteFailed: ERROR; Force: PROC [followingRecord: RecordID]; <> <> ReadProc: TYPE = PROC [thisRecord: RecordID, wordsToSkip: CARDINAL _ 0, to: Block] RETURNS [status: ReadProcStatus, wordsRead: CARDINAL]; ReadProcStatus: TYPE = {normal, destinationFull, sourceExhausted}; <> <> Read: ReadProc; <> <> <> END.