/** * Update the B-tree header after a B-tree modification. This will make the latest modification * visible.<br/> * We update the following fields : * <ul> * <li>the revision</li> * <li>the number of elements</li> * <li>the B-tree root page offset</li> * </ul> * <br/> * As a result, a new version of the BtreHeader will be created, which will replace the previous * B-tree header * @param btree TheB-tree to update * @param btreeHeaderOffset The offset of the modified btree header * @return The offset of the new B-tree Header * @throws IOException If we weren't able to write the file on disk * @throws EndOfFileExceededException If we tried to write after the end of the file */ /* no qualifier */<K, V> long updateBtreeHeader( BTree<K, V> btree, long btreeHeaderOffset ) throws EndOfFileExceededException, IOException { return updateBtreeHeader( btree, btreeHeaderOffset, false ); }
/** * Update the B-tree header after a B-tree modification. This will make the latest modification * visible.<br/> * We update the following fields : * <ul> * <li>the revision</li> * <li>the number of elements</li> * <li>the reference to the current B-tree revisions</li> * <li>the reference to the old B-tree revisions</li> * </ul> * <br/> * As a result, we new version of the BtreHeader will be created * @param btree The B-tree to update * @param btreeHeaderOffset The offset of the modified btree header * @return The offset of the new B-tree Header if it has changed (ie, when the onPlace flag is set to true) * @throws IOException * @throws EndOfFileExceededException */ /* no qualifier */<K, V> void updateBtreeHeaderOnPlace( BTree<K, V> btree, long btreeHeaderOffset ) throws EndOfFileExceededException, IOException { updateBtreeHeader( btree, btreeHeaderOffset, true ); }
rm.updateBtreeHeader( btree, ( ( AbstractPage<K, V> ) rootPage ).getOffset() );