DIRECTORY DBCommon USING[CacheHandle, DBPage, NullDBPage, TID], DBIndex USING[RealIndexHandle], DBStoragePage USING[VecPage], DBStorage USING[SystemTupleID, FieldHandle, FirstLast, TupleHandle], Rope USING[ROPE]; DBStorageConcrete: CEDAR DEFINITIONS = BEGIN FieldObject: TYPE = MACHINE DEPENDENT RECORD[ fieldType: FieldType _ NULL, offset: CARDINAL _ NULL, nWords: CARDINAL _ NULL, typeDependent: SELECT OVERLAID * FROM regular => [fill1: LONG CARDINAL _ NULL], group => [groupID: DBCommon.TID], ENDCASE ];--FieldObject FieldType: TYPE = MACHINE DEPENDENT {OneWord(1), TwoWord, NWord, VarWord, VarByte, Group, (LAST[CARDINAL])}; GroupScanHandle: TYPE = REF GroupScanObject; GroupScanObject: TYPE = RECORD[ tidFieldHandle: DBStorage.FieldHandle, headOfGroup: DBStorage.TupleHandle, prevInScan: DBStorage.TupleHandle _ NIL, nextInScan: DBStorage.TupleHandle _ NIL, link: GroupScanHandle _ NIL ];--GroupScanObject IndexScanHandle: TYPE = REF IndexScanObject; IndexScanObject: TYPE = RECORD [ front, back: IndexScanHandle, tree: DBIndex.RealIndexHandle, this: DBCommon.DBPage, index: CARDINAL, free: BOOLEAN, direction: {next, prev, finished} _ next, -- this is set when doing a scan using NextScanKey and PrevScanKey start: DBStorage.FirstLast, lowerBound, upperBound: Rope.ROPE, includeLowerBound, includeUpperBound: BOOLEAN, lowerBoundInfinity, upperBoundInfinity: BOOLEAN ];--IndexScanObject SystemTuplesetObject: TYPE = RECORD[ tuplesetID: DBStorage.SystemTupleID, wordsForTupleFields: CARDINAL ];--SystemTuplesetObject TuplesetScanHandle: TYPE = REF TuplesetScanObject; TuplesetScanObject: TYPE = RECORD[ position: ScanPosition _ invalid, page: DBCommon.DBPage _ DBCommon.NullDBPage, slotIndex: CARDINAL _ 0, pagePtr: LONG POINTER TO DBStoragePage.VecPage _ NIL, pageHint: DBCommon.CacheHandle _ NIL, tupleset: DBStorage.TupleHandle, localTuplesetID: CARDINAL _ 1, link: TuplesetScanHandle _ NIL ];--TuplesetScanObject ScanPosition: TYPE = {middle, beforeFirst, afterLast, invalid}; END.--DBStorageConcrete CHANGE LOG Created by Cattell on 7-Jun-81 8:59:10 DBStorageConcreteField.mesa 1039 27-Feb-81 15:56:05 DBStorageConcreteGroupScan.mesa 1323 11-Dec-80 14:19:03 DBStorageConcreteSystemTS.mesa 662 24-Jun-80 11:16:51 DBStorageConcreteTuplesetScan.mesa 2667 27-Feb-81 14:21:24 Changed by MBrown on 17-Jun-81 11:17:59 Changed by Cattell on 7-Jul-81 10:13:51 Changed by Willie-Sue on February 15, 1985 ΖFile DBStorageConcrete.mesa Copyright c 1985 by Xerox Corporation. All rights reserved. Last edited by Cattell on 7-Jul-81 10:13:24 MBrown on December 2, 1982 2:54 pm Willie-Sue, February 15, 1985 11:07:08 am PST Donahue, May 23, 1986 9:40:13 am PDT This interface defines the concrete representations of opaque types in DBStorage.. Concrete version of DBStorage.FieldObject. All variants are 5 words long. field handle for Group field being scanned. NIL => invalid handle. tuple on the "one" side of the group if prevInScan = NIL, then scan is before start of "many" side. After an insertion (WriteTID), the inserted tuple is here. if nextInScan = NIL, then scan is after end of "many" side used to form singly-linked list of active group scans scan is either between two tuples on a page (middle), before the first page (beforeFirst), or after the last page (afterLast). if scanPosition = middle, this is current page of scan. This page contains at least one tuple from the tupleset represented by tuplesetID (below). if scanPosition = middle, this means that cursor is between slots slotIndex and slotIndex + 1 of page. I.e, NextScanTupleset goes to slotIndex + 1, Prev goes to slotIndex. if scanPosition = middle, this is pointer to cached version of page, locked for reading. if scanPosition = middle, this is locked cache ref to page (guarantees validity of pagePtr). tupleset whose tuples are to be returned by the scan. if scanPosition = middle, this is index (in [1..MaxTuplesetPerPage]) of tupleset's TSDict entry on this page. pointer for singly-linked list of all active tupleset scans. Moved all type definitions here from: Scan handles become REFs. Added IndexScan stuff. made Cedar, added tioga formatting ΚΛ˜šœ™Jšœ Οmœ1™<—Jšœ™Jšœ™šœ"™"J™-Icode™$—J˜šΟk ˜ Jšœ žœ"žœ˜5Jšœžœ˜Jšœžœ ˜Jšœ žœ5˜DJšœžœžœ˜J˜—šœžœž œž˜,JšœR™RJ˜J˜š œ žœžœž œžœ˜-JšœJ™JJšœžœ˜Jšœžœžœ˜Jšœžœžœ˜šœžœžœž˜%Jšœžœžœžœ˜)Jšœžœ˜#—Jšž˜JšœΟc ˜—J˜šœ žœžœž ˜#Jšœ7žœžœ˜HJ˜J˜—Jšœžœžœ˜,šœžœžœ˜˜&JšœC™C—˜#Jšœ$™$—šœ$žœ˜(JšœQ™QJšœ'™'—šœ$žœ˜(Jšœ:™:—šœž˜Jšœ5™5—JšœŸ˜—J˜J˜Jšœžœžœ˜,J˜šœžœžœ˜ J˜J˜J˜Jšœžœ˜Jšœžœ˜Jšœ+ŸB˜mJ˜Jšœžœ˜"Jšœ&žœ˜.Jšœ(ž˜/JšœŸ˜—J˜šœžœžœ˜$J˜$Jšœž˜JšœŸ˜—J˜Jšœžœžœ˜2šœžœžœ˜"˜!JšœZ™ZJšœ#™#—˜,JšœX™XJšœ:™:—šœ žœ˜JšœO™OJšœ\™\—š œ žœžœžœžœ˜5JšœX™X—šœ!žœ˜%Jšœ\™\—˜ Jšœ5™5—šœžœ˜JšœY™YJšœ™—šœž˜Jšœ<™<—JšœŸ˜—J˜Jšœžœ-˜?J˜J˜—JšžœŸ˜J˜J˜Jšžœž˜ J˜J˜'šœ%™%J˜7J˜;J˜:J˜>J˜—J˜'Jšœ™J˜J˜(Jšœ™J˜J˜*J™"—…— !