protected void replaceChildPage ( LLIndexPage indexPage , long key , long value , AbstractIndexPage subChild ) { int start = binarySearch ( 0 , nEntries , key , value ) ; if ( start < 0 ) { start = - ( start + 1 ) ; } for ( int i = start ; i <= nEntries ; i ++ ) { if ( subPages [ i ] == indexPage ) { markPageDirtyAndClone ( ) ; //remove page from FSM. ind . file . reportFreePage ( subPageIds [ i ] ) ; subPageIds [ i ] = subChild . pageId ( ) ; subPages [ i ] = subChild ; if ( i > 0 ) { keys [ i - 1 ] = subChild . getMinKey ( ) ; if ( ! ind . isUnique ( ) ) { values [ i - 1 ] = subChild . getMinKeyValue ( ) ; } } subChild . setParent ( this ) ; return ; } } // System.out.println("this:" + parent); // this.printLocal(); // System.out.println("sub-page:"); // indexPage.printLocal(); throw DBLogger . newFatalInternal ( "Sub-page not found." ) ; }
Replacing sub - pages occurs when the sub - page shrinks down to a single sub - sub - page in which case we pull up the sub - sub - page to the local page replacing the sub - page .