DIRECTORY AlpineInternal USING [LogRecordID, LogRecordType, BackupVolume, firstRecordID, lastRecordID, nullLogRecordID], AlpineLog USING [Block], Rope; BackupLog: CEDAR DEFINITIONS ~ BEGIN RecordType: TYPE = AlpineInternal.LogRecordType; RecordID: TYPE = AlpineInternal.LogRecordID; nullRecordID: RecordID = AlpineInternal.nullLogRecordID; BackupVolume: TYPE = AlpineInternal.BackupVolume; firstRecordID: RecordID = AlpineInternal.firstRecordID; lastRecordID: RecordID = AlpineInternal.lastRecordID; Block: TYPE = AlpineLog.Block; OpenForNormalOperation: PROC [backupLogName: Rope.ROPE, initialPosition: RecordID] ; Close: PROC []; OpenForRecovery: PROC [backupLogName: Rope.ROPE] RETURNS [firstRecord: RecordID]; ReadProcStatus: TYPE = {normal, destinationFull, sourceExhausted}; ReadProc: TYPE = UNSAFE PROC [thisRecord: RecordID, wordsToSkip: LONG CARDINAL _ 0, to: Block] RETURNS [status: ReadProcStatus, wordsRead: CARDINAL]; Read: ReadProc; Write: UNSAFE PROC [ continuation: BOOLEAN _ FALSE, recordData: Block, force: BOOL _ FALSE] RETURNS [followingRecord: RecordID]; NearlyFull, Full: ERROR; Force: PROC []; Format: PROC [backupLogName: Rope.ROPE, pages: INT, firstRecordID: RecordID] RETURNS[firstUsableRecordID: RecordID]; RecordIDOfNextWrite: PROC [] RETURNS [RecordID]; END. CHANGE LOG vBackupLog.mesa Copyright c 1985 by Xerox Corporation. All rights reserved. Carl Hauser, March 12, 1986 10:45:21 am PST The backup log is a sequence of Cedar FS files, read and written using stream operations. Each file in the sequence starts with a record containing its own recordID. The recordID of each subsequent record is the sum of this first recordID and the word offset of the record in the file. This interface does not yet have procedures for managing the sequence of files, remembering the order in which they occur, remembering the recordIDs on each file, the dates they correspond to, etc. These would be nice to have. A tag of type RecordType is associated with each log record as it is written. This is used to identify the recovery procedure responsible for the record. Uniquely identifies a record within a log. The 48 bit address space allows for several hundred years of log writing. No log record is identified by this value. for all r, Compare[firstRecordID, r] # greater for all r, Compare[lastRecordID, r] # less Call once before calling Write; Call when done with backup log; Call once before calling Read; firstRecord is the record the client should process first, not BackupLog's own header record. normal means destinationFull and sourceExhausted (normal termination for reading a fixed-length log record). Extracts all or part of the contents of a log record whose type and transaction are known, placing it in "to". Should be called during normal operation of the server to carry out intentions. Note: Perform recovery before calling any of the procedures below. Log writing ! NearlyFull, Full (online log is full - backup volume should be changed). Force all records previously written to be recorded stably in the backup log. This call formats the given file to a well-defined initial state that is acceptable to backup recovery. This should not be called while backup is running. The previous contents of the file is lost. RecordID that Write would have returned as thisRecord, had it been called. There is no way to guarantee that calling Write after calling this proc will generate this RecordID, however. Κ­˜codešœ™Kšœ Οmœ1™