DIRECTORY DBCommon, DBIndex; DBIndexMod: CEDAR DEFINITIONS = BEGIN OPEN DBIndex; ReplaceKey: PROC [p: Page, key: IndexKey, at: CARDINAL]; MoveEntriesToLeftLeaf: PROC [from, to: Page, nentries: CARDINAL]; MoveEntriesToRightLeaf: PROC [from, to: Page, nentries: CARDINAL]; MoveEntriesToRightLeafAfter: PROC [from, to: Page, nentries: CARDINAL]; InsertTheFirstLeafEntry: PROC [page: Page, key: IndexKey, value: LONG CARDINAL]; InsertTwoEntriesToEmptyPage: PROC [page: Page, first: LONG CARDINAL, key: IndexKey, second: LONG CARDINAL]; MoveEntriesToRightInternal: PROC [from, to: Page, key: IndexKey, nentries: CARDINAL]; MoveEntriesToLeftInternal: PROC [from, to: Page, key: IndexKey, nentries: CARDINAL]; SplitEntriesToRightPage: PROC [from, to: Page, at: CARDINAL] RETURNS [IndexKey]; MoveRightAndInsert: PROC [from: Page, to: Page, after: CARDINAL, at: CARDINAL, key: IndexKey, value: LONG CARDINAL] RETURNS [CARDINAL]; SlideLeafAt: PROC [p: Page, index: CARDINAL, key: IndexKey, value: LONG CARDINAL]; RemoveFromInternal: PROC [page: Page, deleting: CARDINAL] RETURNS [State]; RemoveFromLeaf: PUBLIC PROC [page: Page, deleting: CARDINAL] RETURNS [State]; SetLinks: PROC [left, new: Page]; RemoveLinks: PROC [page: Page]; END. Changed by Willie-Sue on February 15, 1985 úFile: DBIndexMod.mesa Copyright c 1985 by Xerox Corporation. All rights reserved. Willie-Sue, February 15, 1985 3:42:13 pm PST Contents: All DBIndex package database modifications go through this interface Created from: pieces of former DBIndexFilePage, DBIndexOp, DBIndex, and DBIndexInternal Implementation: DBIndexModImpl.mesa Created by Cattell on September 21, 1982 8:28 pm Last edited by Cattell: September 21, 1982 8:28 pm Replaces the key in leaf at "at" by "key" in leaf page Both from & to are internal pages. from is to the right of to. Move entries [0-nentries) in from page to to page. Both from & to are internal pages. from is to the left of to. Move entries [size-nentries..size) in from page to to page. Just like MoveEntriesToRightLeaf, except entries moved from "from" are placed after entries of "to" Insert the first entry in an empty leaf page "page" is empty and an internal node. Inserts two entries "first" and "second" with the separator "key" "from" is to the left of "to" "key" is the dividing key between from and to "nentries" are moved (returns if 0) "from" is to the right of "to" key is the dividing key between from and to "nentries" are moved (0 => no-op) Both from & to are internal page. "From" is to the left of "to", and "to" is empty. Move entries [at..size) in "from" to "to" Inserts between from[at] and from[at+1]. Since from will overflow, we move from[after+1..fromEnd] to the page to, and insert Returns the index where insertion occurred Shifts part of entries in p including and after the index and inserts It is guaranted that there won't be any overflow. Takes out the deleting-th entry and compresses Takes out the deleting-th entry and compresses SplitPage: PROC [ p: Page, loc: CARDINAL, insertSize: INTEGER] RETURNS [ splitLoc: CARDINAL, splitKey: IndexKey, overflow: Page]; Inserts "new" between "left" and its right sibling Remove leaf page's left and right links. MUST call before destroying page. made Cedar, added tioga formatting Ê.˜šœ™Jšœ Ïmœ1™