YggEnvironment.mesa
Copyright © 1985, 1987, 1988 by Xerox Corporation. All rights reserved.
Common definitions for public Yggdrasil interfaces
Converted from AlpineEnvironment.mesa
Last edited by:
MBrown on February 1, 1984 5:04:15 pm PST
Kolling on October 28, 1983 12:32 pm
Taft on April 8, 1983 5:02 pm
Hauser, March 7, 1985 2:09:45 pm PST
Willie-Sue, December 22, 1986 12:27:19 pm PST
Bob Hagmann May 13, 1988 4:26:09 pm PDT
DIRECTORY
Basics,
ConstArith,
Rope,
YggDID,
YggDummyRPC,
YggHostFS;
YggEnvironment: CEDAR DEFINITIONS =
BEGIN
Identification and authentication (see YggDummyRPC.mesa and Lupine documentation for details)
Must fix this: Cedar RPC and Grapevine are not the right
Principal: TYPE = Rope.ROPE; -- an individual (Grapevine, Clearinghouse, ...???)
FileStore: TYPE = Principal; -- an Yggdrasil instance
RName: TYPE = Rope.ROPE; -- an arbitrary Grapevine RName (or other name server)
OwnerName: TYPE = Rope.ROPE; -- an Alpine owner, not necessarily an RName
AccessList: TYPE = LIST OF RName;
Conversation: TYPE = YggDummyRPC.Conversation;
File system
VolOrVolGroupID: TYPE = YggHostFS.VolumeID;
VolumeID: TYPE = RECORD [VolOrVolGroupID];
VolumeGroupID: TYPE = RECORD [VolOrVolGroupID];
nullVolumeID: VolumeID = [YggHostFS.nullVolumeID]; -- the ID of no volume
nullVolumeGroupID: VolumeGroupID = [YggHostFS.nullVolumeID]; -- the ID of no volume group
Documents
DID: TYPE = YggDID.DID; -- ID of a document
nullDID: DID = NIL; -- the ID of no document
PageNumber: TYPE = INT; -- should be [0..maxPagesPerFile]
PageCount: TYPE = INT;
PageRun: TYPE = RECORD [
firstPage: PageNumber,
count: INT ← 1];
maxPagesPerFile: INT = YggHostFS.PageCount.LAST;
WordNumber: TYPE = ConstArith.Const;
This represents a word index (0-origin) into a file. This limits us to a 4 Exabyte file, which may be a problem eventually but not today. Writing a byte a nanosecond, this will last 130 centuries.
WordCount: TYPE = WordNumber;
This represents a difference of two WordNumbers, the length of an file, etc.
DeviceCharacteristics: TYPE = REF DeviceCharacteristicsRep;
wordsPerPage: CARD;
bytesPerPage: CARD;
DeviceCharacteristicsRep: TYPE = RECORD [
wordsPerPage: CARD32,
bytesPerPage: CARD32,
logWordsPerPage: CARD16,
logBytesPerPage: CARD16];
File access
OpenFileID: TYPE [UNITS[CARD32]]; -- represents a single client's access to a single file under a single transaction. Unique only within a single Alpine instance.
nullOpenFileID: OpenFileID = LOOPHOLE[LONG[0]]; -- ID of no open file
AccessRights: TYPE = {readOnly, readWrite};
LockMode: TYPE = {none, read, update, write, readIntendUpdate, readIntendWrite, intendRead, intendUpdate, intendWrite};
LockOption: TYPE = RECORD [
mode: LockMode,
ifConflict: {wait, fail}];
RecoveryOption: TYPE = {log, noLog};
ReferencePattern: TYPE = {random, sequential}; -- a client-supplied hint about the expected pattern of references to pages of a file. Sequential means that when the client reads or writes an interval [p .. p+n) of the file, there is a high likelihood that it will reference pages [p+n .. p+2*n) in the near future. Random means that no such pattern is expected. Specifying this hint accurately enables the server to perform the operations more quickly and efficiently.
Transactions
TransID: TYPE [3*UNITS[CARD32]]; -- globally permanently unique capability for a transaction
nullTransIDRep: ARRAY [0..3) OF CARD32 = [0,0,0];
nullTransID: TransID = LOOPHOLE[nullTransIDRep]; -- ID of no transaction
Outcome: TYPE = {abort, commit, unknown};
CommitOrAbort: TYPE = Outcome [abort .. commit];
WorkerState: TYPE = {notReady, readOnlyReady, ready};
Error enumerations
NeededAccess: TYPE = {alpineWheel, fileModify, fileRead, handleReadWrite, ownerCreate, ownerEntry, spaceQuota}; -- when access is denied, indicates the access control list in which client's membership was required but not present
OperationFailure: TYPE = {
busy, -- server is too busy to start another transaction
duplicateOwner,
duplicateVolumeGroup,
duplicateVolume,
inconsistentDescriptor, -- PageBuffer word count and PageRun page count are inconsistent
volumeFragmented, -- cannot find enough contiguous pages to create or extend file
insufficientSpace, -- in volume group to create or extend file
nonexistentFilePage, -- attempted to access page beyond last page of file
notAlpineWheel, -- failure from AssertAlpineWheel
ownerDatabaseFull,
ownerFileFormatOrVolGroupMismatch,
ownerRecordFull,
ownerRecordInUse,
quotaExceeded, -- attempt to create or extend file would exceed owner's quota
regServersUnavailable, -- access check failed due to Grapevine unavailability
spaceInUseByThisOwner,
tooManyRNames,
totalQuotaExceeded,
unwritableProperty}; -- attempted to write the version property with WriteProperties
LockFailure: TYPE = {
conflict, -- lock cannot immediately be set because a conflicting lock is already set by another transaction
timeout}; -- lock cannot be set even after waiting a long time, perhaps due to undetected deadlock
UnknownType: TYPE = {
coordinator, -- coordinator RName not known to Grapevine (CreateWorker)
fileID, -- no file with this ID in specified volume
openFileID, -- no open file with this ID, or ID presented from wrong conversation
owner, -- no owner with this name in owner data base for specified volume group
transID, -- no transaction active with this ID on this Alpine instance. It may be that the transaction has aborted or that the server has crashed and restarted.
volumeID, -- no volume with this ID is on-line
volumeGroupID}; -- no volume group with this ID is on-line
END.