DIRECTORY DBCache USING[CacheHandle], DB, DBStorage, Rope; DBTuplesConcrete: CEDAR DEFINITIONS = BEGIN ROPE: TYPE = Rope.ROPE; TupleHandle, TupleSet, Index, IndexFactor: TYPE = REF TupleObject; Domain, Relation, Attribute, DataType: TYPE = Entity; Relship: TYPE = REF RelshipObject; Entity: TYPE = REF EntityObject; EntityObject: TYPE = TupleObject; RelshipObject: TYPE = TupleObject; SystemATuple: TYPE = REF attribute TupleObject; SystemTSTuple: TYPE = REF tupleSet TupleObject; SystemSTuple: TYPE = REF surrogate TupleObject; TupleObject: TYPE = RECORD[ tid: LONG CARDINAL, pred: TupleHandle _ NIL, succ: TupleHandle _ NIL, otherInfo: SELECT type: DBStorage.TupleObjectType FROM stored => [ -- tid > DBStorage.MaxSystemTuplesetID cacheHint: DBCache.CacheHandle ], -- hint in finding the cache page for the tid tupleSet => [ -- tid IN [TupleSetTSID..IndexFactorTSID] vTuple: DBStorage.SystemTuplesetHandle_ NIL, -- corresponding system tupleset vName: ROPE_ NIL, -- name of this tupleset entity vIsDomain: BOOL, -- TRUE if tuple set is domain, FALSE if is relation vAttributes: LIST OF Attribute_ NIL, -- if relation, list of its attributes; if domain, list of vR1to1: BOOLEAN_ TRUE], -- whether 1-to-1 if relation; unused if domain attribute => [ -- tid IN [FirstAttributeID .. MaxSystemTupleID] vHandle: DBStorage.FieldHandle_ NIL, -- handle for this attribute vType: DataType, -- type of this attribute vName: ROPE_ NIL, -- name of this attribute vRelation: Relation_ NIL], -- relation this attribute belongs to entity => [ -- used only for IntType, StringType, etc. vName: ROPE_ NIL, -- name of the entity vParent: Domain_ NIL], -- domain entity belongs to (always ValueTypeDomain) surrogate => [ vRelation: Relation_ NIL, -- relation this surrogate relship belongs to vEntity: Entity_ NIL, -- entity this relship corresponds to in target domain vTargetAttribute: Attribute_ NIL], -- the target (first) attribute of vRelation ENDCASE ]; RelshipSet: TYPE = REF RelshipSetObject; RelshipSetObject: TYPE = RECORD[ scan: SELECT type: * FROM tupleSet => [ -- scan all relships in the tupleset, serially testing each serialCheck: AttributeValueList, -- if non-NIL, serially check that tuples satisfy this scanHandle: DBStorage.TuplesetScanHandle, -- this scan gives the tuples to consider surrogate: Relation_ NIL], -- if non-NIL, above gives entities, must convert to surrogate index => [ -- scan all relships in an index, serially testing each serialCheck: AttributeValueList, -- if non-NIL, serially check that tuples satisfy this scanHandle: DBStorage.IndexScanHandle, -- this scan gives the tuples to consider surrogate: Relation_ NIL], -- if non-NIL, above gives entities, must convert to surrogate group => [ -- scan all relships referencing a particular entity serialCheck: AttributeValueList, -- if non-NIL, serially check that tuples satisfy this scanHandle: DBStorage.GroupScanHandle, -- this scan gives the tuples to consider surrogate: Relation_ NIL], -- if non-NIL, above gives entities, must convert to surrogate justOne => [ -- just return hereItIs for first NextRelship call [hereItIs set to NIL after that] hereItIs: Relship], empty => -- NextRelship always returns NIL on one of these NULL, segment => [ -- scan multiple segments, concatenating the RelationSubset results remainingSegments: LIST OF ATOM, -- remaining segments to search previousSegments: LIST OF ATOM, -- segments already searched relation: Relation, -- relation we are scanning (passed by client) constraint: AttributeValueList, -- the constraint passed by client start: FirstLast, -- passed by client currentRelshipSet: RelshipSet], -- the RelshipSet in the current segment ENDCASE ]; EntitySet: TYPE = REF EntitySetObject; EntitySetObject: TYPE = RECORD[ SELECT scan: * FROM index => [ -- scan of a domain index by name scanHandle: DBStorage.IndexScanHandle], tupleSet => [ -- scan of entire domain, no constraint scanHandle: DBStorage.TuplesetScanHandle], empty => -- NextEntity always returns NIL on one of these NULL, nested => [ -- scan multiple domains, concatenating the DomainSubset results remainingDomains: LIST OF Domain, -- (sub-)domains still to scan previousDomains: LIST OF Domain, -- domains already scanned lowName, highName: ROPE, -- passed by client start: FirstLast, -- passed by client currentEntitySet: EntitySet], -- current set; go on to next domain when done segment => [ -- scan multiple segments, concatenating the DomainSubset results remainingSegments: LIST OF ATOM, -- remaining segments to search previousSegments: LIST OF ATOM, -- segments already scanned domain: Domain, -- domain we are scanning (passed by client) lowName, highName: ROPE, -- passed by client start: FirstLast, -- passed by client searchSubDomains: BOOL_ FALSE, -- passed by client (not currently used) currentEntitySet: EntitySet], -- the EntitySet in the current segment ENDCASE ]; FirstLast: TYPE = DB.FirstLast; AttributeValueList: TYPE = DB.AttributeValueList; AttributeList: TYPE = DB.AttributeList; END. Edited by: Cattell on 23-Nov-81 13:12:33: added nameElement EntitySet variant. Cattell on 29-Dec-81 14:16:20: removed it again, don't need it; added empty variant, made all variants lower case names. Cattell on 29-Dec-81 16:32:50: what Eric was calling a system EntitySetObject was really a group EntitySetObject, i changed it to use an entity position. Took out DBTuples dependency. Cattell on July 16, 1982 3:11 pm: Removed RefSet, MatchSet, RefSetObject, MatchSetObject. Added empty variant of RelshipSet. Cattell on October 22, 1982 12:28 pm: Changes for new properties, indexes, and system entities. Reduced size of largest variant of TupleHandle. Cattell on November 4, 1982 9:29 am: More revisions. Didn't need to reduce size of largest variant of TupleHandle, since allocation machinery only allocates for size needed. Put vAttributes into tupleSet variant. Added surrogate field to tupleset, index, and group variants of RelshipSets. Added augment variant to RelshipSets and EntitySets for future use; may have to change later. Willie-Sue on February 15, 1985: made Cedar, added tioga formatting bFile: DBTuplesConcrete.mesa Copyright c 1985 by Xerox Corporation. All rights reserved. Contents: Concrete definitions of DBStorage and DBView types. File created by Rick Cattell, 7-Jun-81 Last edited by: Cattell on: August 2, 1983 1:44 pm MBrown on: 9-Jun-81 15:33:33 Eric Bier on: 17-Aug-81 14:20:59 Willie-Sue on February 15, 1985 11:22:21 am PST Links in doubly-linked list of all in-use TupleObjects "fake" surrogate attributes that are attributes of this domain and not client-visible A SYSTEM tuple is of one of three types: tupleset tuples (there are 4 of these currently), attribute tuples (about a dozen of these), and entity tuples (about 4 of these). These tuples are used in definition and access of dictionary tuples. A SURROGATE tuple is a tuple in a surrogate relation. A surrogate relation is one whose first, "target", attribute is an entity-valued with Key uniqueness; such a relation's relships are not stored as tuples, but rather the 2nd through Nth attributes are stored as attributes of tuples representing entities in the "target" domain, i.e. the domain the target attribute references. A DICTIONARY tuple is a real tuple stored in the database, and is of one of the 4 types corresponding to the 4 tupleset system tuples (which one can be determined by SL.ReadTupleSet). They describe the user's tuplesets, attributes, and indexes, and can be be read but not modified by the user (except through the system routines: AddField, etc.). A DATA tuple is any other kind of tuple, namely the ones in which data are stored. GetF[data tuple, attribute dictionary tuple] would get a field, for example. ÊИšœ™Jšœ Ïmœ1™<—Jšœ=™=Jšœ'™'šœ™Jšœ#™#Jšœ™Jšœ ™ Jšœ/™/J˜—šÏk ˜ Jšœžœ˜Jšžœ˜J˜ J˜J˜—Jšœžœž œ˜%J˜Jšž˜J˜Jšžœžœžœ˜J˜Jšœ+žœžœ ˜BJ˜Jšœ'žœ ˜5Jšœ žœžœ˜"J˜Jšœžœžœ˜ Jšœžœ˜!Jšœžœ˜"J˜Jšœžœžœ˜/Jšœžœžœ˜/Jšœžœžœ˜/J˜šœ žœžœ˜Jšœžœžœ˜Jšœžœ˜šœžœ˜Jšœ6™6—šœ žœ!ž˜6šœ Ïc'˜4Jšœ"Ÿ-˜O—šœŸ*˜9Jšœ(žœŸ ˜MJšœžœžœŸ˜1Jšœ žœŸ4˜Ešœ žœžœ žœŸ:˜_JšœW™W—JšœžœžœŸ/˜G—šœŸ0˜?Jšœ žœŸ˜AJšœŸ˜*JšœžœžœŸ˜+JšœžœŸ%˜@—šœ Ÿ*˜6JšœžœžœŸ˜'JšœžœŸ4˜K—˜JšœžœŸ-˜GJšœžœŸ6˜LJšœžœŸ,˜O—Jšž˜—J˜J˜JšœN™NJšœQ™QJšœO™OJ˜JšœR™RJšœP™PJšœL™LJšœS™SJšœ8™8J˜JšœW™WJšœM™MJšœT™TJšœP™PJšœ™J˜JšœR™RJšœL™LJ˜—Jšœ žœžœ˜(šœžœžœ˜ šœžœ ž˜šœŸ;˜IJšœ"Ÿ6˜XJšœ+Ÿ*˜UJšœžœŸ>˜Z—šœ Ÿ7˜BJšœ"Ÿ6˜XJšœ(Ÿ)˜QJšœžœŸ>˜Z—šœ Ÿ4˜?Jšœ"Ÿ6˜XJšœ(Ÿ)˜QJšœžœŸ>˜Z—šœ ŸS˜`J˜—šœ Ÿ1˜;Jšžœ˜—šœ ŸC˜PJšœžœžœžœŸ˜AJšœžœžœžœŸ˜=JšœŸ.˜CJšœ Ÿ"˜BJšœŸ˜%Jšœ!Ÿ(˜I—Jšž˜—J˜J˜—Jšœ žœžœ˜&šœžœžœ˜šžœ ž˜šœ Ÿ!˜,J˜'—šœŸ'˜5J˜*—šœ Ÿ0˜9Jšžœ ˜—šœ Ÿ@˜LJšœžœžœ Ÿ˜AJšœžœžœ Ÿ˜