h2/src/main/org/h2/mvstore/MVStore.java
/**
     * Remove a page.
     *
     * @param map the map the page belongs to
     * @param pos the position of the page
     */
Remove a page.
@param map the map the page belongs to
@param pos the position of the page
Remove a page . @param map the map the page belongs to @param pos the position of the page
void removePage(MVMap<?, ?> map, long pos) {
        if (pos == 0) {
            unsavedPageCount = Math.max(0, unsavedPageCount - 1);
            return;
        }
        if (cache != null) {
            cache.remove(pos);
        }
        Chunk c = getChunk(pos);
        long version = currentVersion;
        if (map == meta && currentStoreVersion >= 0) {
            if (Thread.currentThread() == currentStoreThread) {
                version = currentStoreVersion;
            }
        }
        registerFreePage(version, c.id, DataUtils.getPageMaxLength(pos), 1);
    }
void removePage ( MVMap < ? , ? > map , long pos ) { if ( pos == 0 ) { unsavedPageCount = Math . max ( 0 , unsavedPageCount - 1 ) ; return ; } if ( cache != null ) { cache . remove ( pos ) ; } Chunk c = getChunk ( pos ) ; long version = currentVersion ; if ( map == meta && currentStoreVersion >= 0 ) { if ( Thread . currentThread ( ) == currentStoreThread ) { version = currentStoreVersion ; } } registerFreePage ( version , c . id , DataUtils . getPageMaxLength ( pos ) , 1 ) ; }
Remove a page.
Remove a page .
// we need to keep temporary pages, // to support reading old versions and rollback // the value could be smaller than 0 because // in some cases a page is allocated without a store // This could result in a cache miss if the operation is rolled back, // but we don't optimize for rollback. // We could also keep the page in the cache, as somebody could read it. // if the meta map is modified while storing, // then this freed page needs to be registered // with the stored chunk, so that the old chunk // can be re-used