h2/src/main/org/h2/mvstore/MVMap.java
/**
     * Split the root page if necessary.
     *
     * @param p the page
     * @param writeVersion the write version
     * @return the new sibling
     */
Split the root page if necessary.
@param p the page
@param writeVersion the write version
@return the new sibling
Split the root page if necessary . @param p the page @param writeVersion the write version @return the new sibling
protected Page splitRootIfNeeded(Page p, long writeVersion) {
        if (p.getMemory() <= store.getPageSplitSize() || p.getKeyCount() <= 1) {
            return p;
        }
        int at = p.getKeyCount() / 2;
        long totalCount = p.getTotalCount();
        Object k = p.getKey(at);
        Page split = p.split(at);
        Object[] keys = { k };
        long[] children = { p.getPos(), split.getPos() };
        Page[] childrenPages = { p, split };
        long[] counts = { p.getTotalCount(), split.getTotalCount() };
        p = Page.create(this, writeVersion,
                1, keys, null,
                2, children, childrenPages, counts,
                totalCount, 0, 0);
        return p;
    }
protected Page splitRootIfNeeded ( Page p , long writeVersion ) { if ( p . getMemory ( ) <= store . getPageSplitSize ( ) || p . getKeyCount ( ) <= 1 ) { return p ; } int at = p . getKeyCount ( ) / 2 ; long totalCount = p . getTotalCount ( ) ; Object k = p . getKey ( at ) ; Page split = p . split ( at ) ; Object [ ] keys = { k } ; long [ ] children = { p . getPos ( ) , split . getPos ( ) } ; Page [ ] childrenPages = { p , split } ; long [ ] counts = { p . getTotalCount ( ) , split . getTotalCount ( ) } ; p = Page . create ( this , writeVersion , 1 , keys , null , 2 , children , childrenPages , counts , totalCount , 0 , 0 ) ; return p ; }
Split the root page if necessary.
Split the root page if necessary .