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 December 20, 1988 7:47:11 am PST
DIRECTORY
Basics,
Camelot,
ConstArith,
Mach,
Rope,
YggDID;
YggEnvironment: CEDAR DEFINITIONS =
BEGIN
Ports and other Mach/Camelot things
dsPort: Mach.portT;
serverID: Camelot.serverIdT;
tsPort: Mach.portT;
mPort: Mach.portT;
sPort: Mach.portT;
sharedMemAddr: Mach.vmAddressT;
tPort: Mach.portT;
aPort: Mach.portT;
atPort: Mach.portT;
taPort: Mach.portT;
applicationID: Camelot.applicationIdT;
Identification and authentication
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;
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 = INT.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 = {read, write, directoryRead, directoryWrite};
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 = Camelot.tidT;
nullTransID: Camelot.tidT = [];
Outcome: TYPE = {active, suspended, 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
ownerFileFormatOrVolGroupMismatch,
ownerRecordInUse,
quotaExceeded, -- attempt to create or extend file would exceed owner's quota
regServersUnavailable, -- access check failed due to Grapevine unavailability
spaceInUseByThisOwner,
tooManyRNames,
totalQuotaExceeded,
cantCommitSuspendedTrans,
cantAbortSuspendedTrans,
cantCommitCommittedTrans,
cantAbortCommittedTrans,
cantCommitAbortedTrans,
cantAbortAbortedTrans
};
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.