<> <> <> <> <> <> <> <> <> DIRECTORY ConstArith; YggInternal: DEFINITIONS = BEGIN <> FileHandle: TYPE = REF FileObject; -- base type of FileMap.Handle FileObject: TYPE; FileInstanceHandle: TYPE = REF FileInstanceObject; -- base type of FileInstance.Handle FileInstanceObject: TYPE; OpenFileHandle: TYPE = REF OpenFileObject; -- base type of OpenFileMap.Handle OpenFileObject: TYPE; <> LeaderPageHandle: TYPE = REF LeaderPageObject; LeaderPageObject: TYPE; <> FPMFileHandle: TYPE = REF FPMFileObject; -- base type of FilePageMgr.FPMFileHandle FPMFileObject: TYPE; <> LockID: TYPE = RECORD [entity: UniversalID, subEntity: ID2, subSubEntity: LockSubID]; UniversalID: TYPE [12]; -- can be compressed someday by implementing a separate map ID2: TYPE [4]; -- large enough to hold file ID within volume LockSubID: TYPE [8]; -- large enough to hold [tag, page number within file] nullLockIDRep: ARRAY [0..SIZE[LockID]/SIZE[UNIT]) OF WORD = [0,0,0,0,0,0]; nullLockID: LockID = LOOPHOLE[nullLockIDRep]; LockTransHeaderHandle: TYPE = REF LockTransHeaderObject; LockTransHeaderObject: TYPE; <> LogRecordID: TYPE = ConstArith.Const; nullLogRecordID, firstRecordID: LogRecordID = [zero, 0, 0]; lastRecordID: LogRecordID = [positive, LAST[CARD], LAST[CARD]]; LogRecordType: TYPE = MACHINE DEPENDENT { <> --ControlRecord-- noop (0), checkpointBegin, checkpointComplete, coordinatorBegin (10), coordinatorRegisterWorker, coordinatorCollecting, coordinatorCompleting, coordinatorComplete, workerBegin (30), workerReady, workerCompleting, workerComplete, --FileRecord-- writePages (100), writeLeaderPage, setSize, create, delete, lock, --Reserved-- reserved (200), (LAST[INTEGER]) }; -- s/b LAST[CARDINAL] but for compiler bug ControlRecord: TYPE = LogRecordType [noop..writePages); FileRecord: TYPE = LogRecordType [writePages..reserved); 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) }; <> TransHandle: TYPE = REF TransObject; -- Base type of TransactionMap.Handle TransObject: TYPE; WorkerOutcome: TYPE = {abort, readOnly, commit}; Difficulty: TYPE = {zero, normal, hard}; WorkLevel: TYPE = Difficulty [normal .. hard]; TransState: TYPE = {committed, aborted, ready}; CoordinatorHandle: TYPE = REF CoordinatorObject; CoordinatorObject: TYPE; END.