<> <> <> <> <> <> <> DIRECTORY YggEnvironment USING[PageCount, PageRun], YggInternal USING[Document, LogRecordID, TransHandle]; YggLogMap: CEDAR DEFINITIONS = BEGIN <> <> Error: ERROR [error: CallingErrorType]; CallingErrorType: TYPE = {alreadySet, exceedsFileSize}; FileDescription: TYPE = RECORD [ registered: BOOLEAN, -- registered in the YggLogMap. <> exists: BOOLEAN, -- file exists from this transaction's viewpoint; i.e., either it was created by this trans, or its creation has been committed and it has not been deleted by this trans. created: BOOLEAN, -- file was created by this transaction. deleted: BOOLEAN, -- file was deleted by this transaction. sizeChanged: BOOLEAN]; -- file's size was changed by this transaction. DescribeFile: PROCEDURE [file: YggInternal.Document, trans: YggInternal.TransHandle] RETURNS [fileDesc: FileDescription]; <> RegisterCreate: PROCEDURE [file: YggInternal.Document, trans: YggInternal.TransHandle]; <> <> RegisterDelete: PROCEDURE [file: YggInternal.Document, trans: YggInternal.TransHandle]; <> <> SetUncommittedSize: PROCEDURE [file: YggInternal.Document, trans: YggInternal.TransHandle, size: YggEnvironment.PageCount]; <> <> GetUncommittedSize: PROCEDURE [file: YggInternal.Document, trans: YggInternal.TransHandle] RETURNS [size: YggEnvironment.PageCount]; <> <> SetCommittedSize: PROCEDURE [file: YggInternal.Document, size: YggEnvironment.PageCount]; <> <> GetCommittedSize: PROCEDURE [file: YggInternal.Document] RETURNS [size: YggEnvironment.PageCount]; <> <> SetCommittedHighWaterMark: PROCEDURE [file: YggInternal.Document, highWaterMark: YggEnvironment.PageCount]; <> <> GetCommittedHighWaterMark: PROCEDURE [file: YggInternal.Document] RETURNS [highWaterMark: YggEnvironment.PageCount]; <> <> <> RegisterPages: PROCEDURE [file: YggInternal.Document, trans: YggInternal.TransHandle, pageRun: YggEnvironment.PageRun, logRecordID: YggInternal.LogRecordID]; <> < for transaction trans, identified in the log by logRecordID. The log record contains exactly this pageRun. If writes are already registered for any of those pages by the same transaction, the old writes are forgotten. If writes are already registered for a different transaction, a fatal error is raised.>> UnregisterPages: PROCEDURE [file: YggInternal.Document, pageRun: YggEnvironment.PageRun]; <> < does not exactly match a checked out entry in the YggLogMap, a fatal error is raised.>> MappedPageRun: TYPE = RECORD [ pageRun: YggEnvironment.PageRun, -- the interval which the caller is interested in. details: SELECT location: Location FROM base => NULL, log => [logRecordID: YggInternal.LogRecordID, -- loc of pageRun in the log. logMapPageRun: YggEnvironment.PageRun, -- describes YggLogMap entry, which is a subinterval of the pageRun in the log. checkedOut: BOOLEAN], -- the YggLogMap entry has been checked out to this caller. ENDCASE]; Location: TYPE = {base, log}; CheckOutOption: TYPE = {none, checkOut}; <> LocatePages: PROCEDURE [file: YggInternal.Document, trans: YggInternal.TransHandle, pageRun: YggEnvironment.PageRun, checkOut: CheckOutOption _ checkOut] RETURNS [mappedPageRun: MappedPageRun]; <> <> LocateAnyPagesForTrans: PROCEDURE [file: YggInternal.Document, trans: YggInternal.TransHandle] RETURNS [found: BOOLEAN, logRecordID: YggInternal.LogRecordID, logMapPageRun: YggEnvironment.PageRun]; <> <> UnregisterTrans: PROCEDURE [file: YggInternal.Document, trans: YggInternal.TransHandle]; <> <> END. <> <> <<>>