DIRECTORY BasicTime, YggEnvironment, YggInternal; YggTransactionMap: DEFINITIONS = BEGIN Conversation: TYPE = YggEnvironment.Conversation; TransID: TYPE = YggEnvironment.TransID; Handle: TYPE = YggInternal.TransHandle; nullHandle: Handle = NIL; Register: PROC [self: Handle] RETURNS [alreadyRegistered: BOOL]; GetHandle: PROC [transID: TransID] RETURNS [Handle]; Unregister: PROC [self: Handle]; EnumProc: TYPE = PROC [Handle] RETURNS [stop: BOOL]; LockedEnumerate: PROC [proc: EnumProc]; UnlockedEnumerate: PROC [proc: EnumProc]; GetTransID: PROC [self: Handle] RETURNS [TransID]; StartWork: PROC [self: Handle, difficulty: YggInternal.WorkLevel _ normal] RETURNS [canWork: BOOL]; StopWork: PROC [self: Handle, estimatedUpdateCost: INT]; GetTimeOfLastStartWork: PROC [self: Handle] RETURNS [BasicTime.GMT]; GetEstimatedUpdateCost: PROC [self: Handle] RETURNS [INT]; EnableYggdrasilWheel: PROC [self: Handle, conversation: Conversation, enable: BOOL]; IsYggdrasilWheel: PROC [self: Handle, conversation: Conversation] RETURNS [enabled: BOOL]; GetLockHeader: PROC [self: Handle] RETURNS [lockHeader: YggInternal.LockTransHeaderHandle]; IsCommitted: PROC [self: Handle] RETURNS [BOOL]; TransState: TYPE = YggInternal.TransState; --{committed, aborted, ready}-- StateDuringRecovery: PROC [self: Handle] RETURNS [TransState]; AbortUnilaterally: PROC [self: Handle, why: AbortReason]; AbortReason: TYPE = { clientRequest, deadlock, timeout, blockingNewLockRequest, tooManyTransactions, oldUncommittedUpdates }; AssertUpdatesAreComplete: PROC [self: Handle]; END. @YggTransactionMap.mesa Copyright Σ 1985, 1988 by Xerox Corporation. All rights reserved. TransID -> YgTransactionMap.Handle, and public operations on YgTransactionMap.Handle. Last edited by Taft on 16-Feb-82 17:22:37 MBrown on January 24, 1983 2:23 pm Kolling on November 2, 1983 12:45 pm Hauser, March 8, 1985 11:11:09 am PST Bob Hagmann March 23, 1988 9:26:01 am PST FileInstanceHandle: TYPE = YggInternal.FileInstanceHandle; Creating, finding, and deleting Handles If a transaction object with TransID self.transID exists in the map, return alreadyRegistered = TRUE. Otherwise insert self into the map and return alreadyRegistered = FALSE. Returns nullHandle if transID is not registered. proc is called with TransactionMap monitor locked. All Handles Registered before the start of the enumeration and not Unregistered before the start of the enumeration will be seen exactly once. proc is called with TransactionMap monitor unlocked. All Handles Registered before the start of the enumeration and not Unregistered before the end of the enumeration will be seen at least once. Using Handles Returns the TransID established by the Register call that generated the Handle. Called during normal operation at start of any operation (CreateFile, WritePages, ...) for transaction self. Not called by recovery procedures for these operations. Called with difficulty = hard if the operation may dirty a cache that is flushed during transaction prepare by calling through the YgFile interface. For instance, CreateFile dirties the owner database cache in this way. If StartWork returns canWork ~ FALSE, then operation must terminate (raising an error to indicate that the transaction or open file is "unknown"). Called at end of any operation (CreateFile, WritePages, ...) for transaction self. The estimatedUpdateCost parameter is an estimate of the work involved in doing updates that implement the operation (both immediate and deferred updates). Pass estimatedUpdateCost = 0 if the operation was readonly. Returns number of seconds that have elapsed since the last successful call to StartWork on self. Returns the total of all estimatedUpdateCosts for operations on this transaction. If self = YgIdentity.myFileStore, then returns TRUE. Otherwise, if there has been a call to IsYggdrasilWheel for this (Handle, Conversation) pair, returns the value of "enable" passed on the last such call. Otherwise returns FALSE. GetFileInstanceList: PROC [self: Handle] RETURNS [fileInstanceList: FileInstanceHandle]; Does not enter self's monitor. SetFileInstanceList: PROC [self: Handle, fileInstanceList: FileInstanceHandle]; Does not enter self's monitor. Does not enter self's monitor. Called during normal operation and during recovery. Error if self is not active or completing. Called during recovery only. Returns the state that the transaction will reach at the end of recovery. Aborts self without any communication with self's coordinator. why is for informational purposes only. Asserts that all updates called for by the transaction self have been completed (if self committed) or have been undone (if self aborted), at the level of the FilePageMgr interface. These updates may still not be recoverable except from the log; calling FilePageMgr.ForceOutEverything is guaranteed to make the updates recoverable. Hauser, March 8, 1985 11:10:56 am PST Nodified, added copyright. Κφ˜šœ™IcodešœB™B—JšœU™Ušœ™Jšœ™Jšœ"™"Jšœ$™$K™%K™)—J˜šΟk ˜ J˜ Jšœ˜Jšœ ˜ J˜—šœ œ˜ Jš˜Jšœœ˜1Jšœ œ˜'Jšœœ"™:J˜Jšœœ˜'Jšœœ˜J˜J˜Jšœ'™'J˜šΟnœœœœ˜@JšœK™KJšœH™HJšœ™J˜—šž œœœ ˜4Jšœ0™0J˜—Jšž œœ˜ J˜Jš žœœœ œœ˜4šžœœ˜'JšœJ™JJšœP™PJšœ&™&—šžœœ˜)JšœL™LJšœN™NJšœ'™'J˜J˜—Jšœ ™ J˜šž œœœ ˜2JšœO™OJ˜—šž œœ;˜JJšœ œ˜JšœV™VJšœN™NJšœP™PJšœQ™QJšœ8™8JšœL™LJšœE™EJ˜—šžœœ%œ˜8JšœR™RJšœN™NJšœQ™QJšœ6™6J˜—šžœœœ œ˜DJšœJ™JJšœ™J˜—šžœœœœ˜:JšœQ™QJ˜—Jšžœœ4œ˜Tšžœœ+˜AJšœ œ˜JšœM™MJšœQ™QJšœI™IJ˜—šžœœœ(™XJšœ™—šžœœ6™OJšœ™—šž œœ˜"Jšœ1˜8Jšœ™J˜—šž œœœœ˜0Jšœ3™3Jšœ*™*J˜—Jšœ œΟc˜Jšžœœœ˜>Jšœ™JšœI™IJ˜—šžœœ"˜9Jšœ>™>Jšœ'™'J˜—šœ œ˜J˜J˜ J˜J˜J˜J˜J˜J˜—šžœœ˜.JšœO™OJšœN™NJšœN™NJšœI™IJšœ™J˜—Jšœ˜—™%K™—K™—…—0f