DIRECTORY AlpineEnvironment, AlpineFile, LeaderPageFormat, FileInstance, TransactionMap; LeaderPage: DEFINITIONS = BEGIN LockOption: TYPE = AlpineEnvironment.LockOption; Property: TYPE = AlpineEnvironment.Property; PropertySet: TYPE = AlpineFile.PropertySet; PropertyValuePair: TYPE = AlpineEnvironment.PropertyValuePair; UserProperty: TYPE = AlpineEnvironment.UserProperty; UserProperties: TYPE = AlpineEnvironment.UserProperties; UserPropertyValuePair: TYPE = AlpineEnvironment.UserPropertyValuePair; UserPropertyValuePairs: TYPE = AlpineEnvironment.UserPropertyValuePairs; Initialize: PROCEDURE [fileInstance: FileInstance.Handle]; GetProperty: PROCEDURE [fileInstance: FileInstance.Handle, property: Property, lock: LockOption _ [read, wait]] RETURNS [propertyValue: PropertyValuePair]; GetPropertyList: PROCEDURE [fileInstance: FileInstance.Handle, desiredProperties: PropertySet _ ALL [TRUE], lock: LockOption _ [read, wait]] RETURNS [propertyList: LIST OF PropertyValuePair]; GetUserProperty: PROCEDURE [fileInstance: FileInstance.Handle, property: UserProperty, lock: LockOption _ [read, wait]] RETURNS [propertyValue: UserPropertyValuePair]; GetUserPropertyList: PROCEDURE [fileInstance: FileInstance.Handle, desiredProperties: UserProperties, lock: LockOption _ [read, wait]] RETURNS [properties: UserPropertyValuePairs]; SetProperty: PROCEDURE [fileInstance: FileInstance.Handle, propertyValue: PropertyValuePair, lock: LockOption _ [update, wait]]; SetUserProperty: PROCEDURE [fileInstance: FileInstance.Handle, propertyValue: UserPropertyValuePair, lock: LockOption _ [update, wait]]; SetPropertyList: PROCEDURE [fileInstance: FileInstance.Handle, propertyList: LIST OF PropertyValuePair, lock: LockOption _ [update, wait]]; Validate: PROCEDURE [fileInstance: FileInstance.Handle]; newLeaderPageObject: PROCEDURE [nPages: CARDINAL] RETURNS [leaderPage: LeaderPageFormat.LeaderPageHandle]; Finalize: PROCEDURE [fileInstance: FileInstance.Handle]; CarryOut: PROCEDURE [fileInstance: FileInstance.Handle]; Error: ERROR [errorType: ErrorType]; ErrorType: TYPE = {damaged, full, nameTooLong, notVirginFile, unwritableProperty}; validateBeforeEveryOperation: BOOLEAN; validateAfterEveryUpdate: BOOLEAN; END. ÔLeaderPage.mesa Copyright c 1985 by Xerox Corporation. All rights reserved. Last edited by: Taft on April 9, 1983 2:23 pm Hauser, March 8, 1985 10:36:18 am PST Carl Hauser, June 17, 1986 11:42:46 am PDT ! Error {notVirginFile}; Initializes the leader page and sets all properties to default values, which are: byteLength, highWaterMark: 0; createTime: now; modifyAccess, readAccess: empty; owner, stringName: empty strings. Should be called only for a newly-created file; operates directly on the base file system. Does not set any locks. The following procedures operate either on the base file system or on a copy of the leader page cached in the LogMap, and set locks on the leader page as necessary. ! Lock.Failed, Lock.TransAborting; Gets any property, even type (which is not actually kept in the leader page). If a cached leader page copy exists which belongs to this transaction then gets the property from it; otherwise gets the property from the base file. Sets the specified lock on the leader page. ! Lock.Failed, Lock.TransAborting; ! Lock.Failed, Lock.TransAborting; ! Lock.Failed, Lock.TransAborting; ! Error {full, unwritableProperty}, Lock.Failed, Lock.TransAborting; Sets a property as specified by propertyValue, does not permit setting type or version. If Initialize has previously been called for this file then sets the property directly in the base file. Otherwise, checks to see whether or not a leader page copy is cached in the LogMap, and creates one if not; then sets the property in that copy. Sets the specified lock on the leader page. ! Error {full, unwritableProperty}, Lock.Failed, Lock.TransAborting; Sets a user property as specified by propertyValue. Sets the specified lock on the leader page. ! Error {full, unwritableProperty}, Lock.Failed, Lock.TransAborting; Error {damaged}; Inspects the leader page for openFile and raises Error[damaged] if it looks bogus. newLeaderPageObject is used by FileLog.LogReadLeaderPages to get storage for the leader page contents. The following procedures are used only during transaction commit. ! Lock.Failed, Lock.TransAborting; Obtains a write lock on the version number, computes the new version number, and writes a log record for it (if necessary). Called during phase 1 of transaction commit. Writes the updated leader page into the base file (if necessary). Called during phase 2 of transaction commit. Exceptions. Debugging switches, settable by client Hauser, March 8, 1985 10:36:18 am PST Added copyright., DIRECTORY ÊÅ– "cedar" style˜šœ™Icodešœ Ïmœ1™<—šœ™Jšœ™K™%K™*—unitšÏk ˜ K˜K˜ Kšœ˜K˜ K˜—šœ ž œ˜Jšž˜J˜Kšœ žœ ˜0Kšœ žœ˜,Kšœ žœ˜+Kšœžœ'˜>Kšœžœ"˜4Kšœžœ$˜8Kšœžœ+˜FKšœžœ,˜HšÏn œž œ%˜:Jšœ™Jšœ·™·——J˜šœ¤™¤šŸ œž œZžœ$˜›Jšœ"™"Jšœ™—šŸœž œFžœžœ$žœžœžœ˜¿Jšœ"™"—šŸœž œ^žœ(˜§Jšœ"™"—šŸœž œižœ&˜´Jšœ"™"—šŸ œž œj˜€JšœD™DJšœþ™þ—šŸœž œn˜ˆJšœD™DJšœ`™`—šŸœž œ3žœžœ7˜‹JšœD™D—šŸœž œ%˜8Jšœ™JšœR™RJ™——™fJ˜JšŸœž œ žœžœ2˜k—J˜šœA™AšŸœž œ%˜8Jšœ"™"Jšœ¨™¨—šŸœž œ%˜8Jšœn™n——J™šœ ™ Lšœžœ˜$Kšœ žœC˜R—J˜šœ&™&Lšœžœ˜&Lšœžœ˜"Lšžœ˜—™%KšœÏr ™—K™K™—…—®G