DIRECTORY ConstArith, YggEnvironment, YggInternal, YggOpenDoc, YggDIDMap, YggTransactionMap; YggOpenDocLog: DEFINITIONS = BEGIN LockSubID: TYPE = YggInternal.LockSubID; LogRecordID: TYPE = YggInternal.LogRecordID; OwnerName: TYPE = YggEnvironment.OwnerName; PageCount: TYPE = YggEnvironment.PageCount; PageRun: TYPE = YggEnvironment.PageRun; ReferencePattern: TYPE = YggEnvironment.ReferencePattern; TransState: TYPE = YggInternal.TransState; VolumeID: TYPE = YggEnvironment.VolumeID; TransID: TYPE = YggEnvironment.TransID; RecordID: TYPE = YggInternal.LogRecordID; logDocID: TYPE = CARD; -- unique ID for the document only used in the log LogCreate: PROCEDURE [openDoc: YggOpenDoc.OpenDoc, initialSize: PageCount, owner: OwnerName]; LogDelete: PROCEDURE [openDoc: YggOpenDoc.OpenDoc]; LogSetSize: PROCEDURE [openDoc: YggOpenDoc.OpenDoc, old, new: PageCount]; LogWritePages: PROCEDURE [openDoc: YggOpenDoc.OpenDoc, where: LONG POINTER, pageRun: PageRun, referencePattern: ReferencePattern] RETURNS [recordID: LogRecordID]; LogReadPages: PROCEDURE [openDoc: YggOpenDoc.OpenDoc, where: LONG POINTER, pageRun: PageRun, recordID: LogRecordID] RETURNS [referencePattern: ReferencePattern]; LogFileLock: PROCEDURE [openDoc: YggOpenDoc.OpenDoc]; RecoverCreate: PROCEDURE [openDoc: YggOpenDoc.OpenDoc, initialSize: PageCount, outcome: TransState]; RecoverDelete: PROCEDURE [openDoc: YggOpenDoc.OpenDoc, outcome: TransState]; RecoverSetSize: PROCEDURE [openDoc: YggOpenDoc.OpenDoc, old, new: PageCount, recordID: LogRecordID, outcome: TransState]; RecoverWritePages: PROCEDURE [openDoc: YggOpenDoc.OpenDoc, recordID: LogRecordID, pageRun: PageRun, outcome: TransState]; RecoverLock: PROCEDURE [openDoc: YggOpenDoc.OpenDoc, lockSubID: LockSubID, outcome: TransState]; AnalyzeSetSizes: PROCEDURE; DoSetSizes: PROCEDURE; DefinedFileRecord: TYPE = YggInternal.FileRecord[writePages..lock]; fixedFLRSize: INT = WORDS[logDocID]; FileLogRecord: PRIVATE TYPE = MACHINE DEPENDENT RECORD [ fileID (0): logDocID, specifics (fixedFLRSize): SELECT COMPUTED DefinedFileRecord FROM writePages => [ pageRun (fixedFLRSize): PageRun, referencePattern (fixedFLRSize+WORDS[PageRun]): ReferencePattern, data (fixedFLRSize+WORDS[PageRun]+WORDS[ReferencePattern]): DataRep], setSize => [old (fixedFLRSize), new (fixedFLRSize+WORDS[PageCount]): PageCount], create => [initialSize (fixedFLRSize): PageCount, owner (fixedFLRSize+WORDS[PageCount]): StringRep], delete => [], lock => [lockSubID (fixedFLRSize): LockSubID], ENDCASE]; DataRep: PRIVATE TYPE = MACHINE DEPENDENT RECORD [ ARRAY [0..0) OF WORD]; StringRep: PRIVATE TYPE = MACHINE DEPENDENT RECORD [ length (0): CARDINAL, text (1): PACKED ARRAY [0..0) OF CHARACTER]; SetSizeList: TYPE = LIST OF SetSizeItem; SetSizeItem: TYPE = RECORD [ old, new: PageCount, trans: TransID, record: RecordID, file: YggDIDMap.Document ]; END. YggOpenDocLog.mesa Copyright Σ 1985, 1988 by Xerox Corporation. All rights reserved. Last edited by: MBrown on January 30, 1984 5:24:32 pm PST Taft on April 6, 1983 5:14 pm Hauser, March 7, 1985 2:56:14 pm PST Carl Hauser, October 20, 1987 2:49:15 pm PDT Bob Hagmann May 5, 1988 11:54:01 am PDT This interface captures all interactions between the AlpineFile implementation and the Log. Exported from YggOpenDocLogImpl, for writing and reading log records during normal operation ! Log.WriteFailed; Logs the creation of a file (as an undo action). Note: this operation forces the log to stable storage. ! Log.WriteFailed; Logs the deletion of a file (as a deferred action). ! Log.WriteFailed; Logs a change in the size of a file. old should be the committed size of the file. This is a deferred action if newold. ! Log.WriteFailed; Writes a writePages log record from memory. Reads the specified pageRun interval of the file designated by openDoc into memory starting at where. recordID identifies a writePages record which the caller asserts includes the requested interval. Returns the ReferencePattern which was passed to LogWritePages. A fatal error occurs if pageRun is not a subinterval of the pageRun actually contained in the log record or if the log record describes a write to the wrong file. ! Log.WriteFailed; Logs the setting of a file write lock (only write locks are logged). Imported by FileLogImpl, for processing log records during recovery. Each takes as arguments the information that was passed to the corresponding WriteXXX procedure which wrote the log record, plus the transaction outcome which is {committed, aborted, ready}. Note that the calls are made only for files which still exist at recovery time. Exported by FileActionsImpl. Note: type and owner are not passed, as they are not actually needed for recovery, and constructing an owner string from the log record is a messy job. Called after the log analysis pass to figure out what the size history of each file must be during recovery. All this is necessary because of direct writing to files above the high water mark, which makes changing their size during recovery incorrect until you know the ultimate committed length. Called after the log update pass to establish each file at the correct length. Log record representation old is needed for undo actions, which arise only if new>old. Hauser, March 7, 1985 2:55:53 pm PST Added copyright. Carl Hauser, October 16, 1987 10:46:27 am PDT Add AnalyzeSetSizes, DoSetSizes. Add SizeList stuff. ΚΚ– "cedar" style˜šœ™IcodešœB™B—šœ™Jšœ)™)Jšœ™K™$K™,K™'—J˜Jšœ[™[unitšΟk ˜ Kšœ ˜ Kšœ˜K˜ K˜ K˜ K˜—šœ œ˜Kš˜K˜Kšœ œ˜(Kšœ œ˜,Kšœ œ˜+Kšœ œ˜+Kšœ œ˜'Kšœœ#˜9Kšœ œ˜*Kšœ œ˜)Kšœ œ˜'Kšœ œ˜)K˜Kšœ œœΟc2˜J—J˜šœ\™\šΟn œ œI˜]Jšœ™Jšœg™g—šŸ œ œ˜3Jšœ™Jšœ3™3—šŸ œ œ4˜IJšœ™Jšœ•™•—š Ÿ œ œ&œœ8œ˜’Jšœ™Jšœ+™+—š Ÿ œ œ&œœ+œ&˜‘Jšœ­™­—šŸ œ œ˜5Jšœ™JšœD™D—J˜—šœς™ςšŸ œ œL˜dJšœ—™——LšŸ œ œ4˜LLšŸœ œ`˜yLšŸœ œ]˜yLšŸ œ œJ˜`šŸœ œ˜K™©—šŸ œ œ˜K™N——J˜J˜šœ™Lšœœ,˜CLšœœœ ˜$š œœœœ œœ˜8K˜šœœœ˜@˜Kšœ¨˜¨—šœP˜PKšœ<™<—Kšœd˜dK˜ Kšœ.˜.Kšœ˜ ——š œ œœœ œœ˜2Kšœœœ˜—š œ œœœ œœ˜4Kšœ œ˜Kš œ œœœ œ˜,K˜—Lšœ œœœ ˜(šœ œœ˜K˜K˜K˜K˜Kšœ˜—K˜Lšœ˜—™$K™—™-KšœΟrœ  œ™5—K™—…— ,