Search in sources :

Example 1 with BPlusMetaIO

use of org.apache.ignite.internal.processors.cache.persistence.tree.io.BPlusMetaIO in project ignite by apache.

the class IndexProcessor method inlineSize.

/**
 * @param page Root page.
 * @param grpId Cache group id.
 * @param pageMemory Page memory.
 * @return Inline size.
 * @throws IgniteCheckedException If something went wrong.
 */
private int inlineSize(RootPage page, int grpId, PageMemory pageMemory) throws IgniteCheckedException {
    long metaPageId = page.pageId().pageId();
    final long metaPage = pageMemory.acquirePage(grpId, metaPageId);
    try {
        // Meta can't be removed.
        long pageAddr = pageMemory.readLock(grpId, metaPageId, metaPage);
        assert pageAddr != 0 : "Failed to read lock meta page [metaPageId=" + U.hexLong(metaPageId) + ']';
        try {
            BPlusMetaIO io = BPlusMetaIO.VERSIONS.forPage(pageAddr);
            return io.getInlineSize(pageAddr);
        } finally {
            pageMemory.readUnlock(grpId, metaPageId, metaPage);
        }
    } finally {
        pageMemory.releasePage(grpId, metaPageId, metaPage);
    }
}
Also used : BPlusMetaIO(org.apache.ignite.internal.processors.cache.persistence.tree.io.BPlusMetaIO)

Example 2 with BPlusMetaIO

use of org.apache.ignite.internal.processors.cache.persistence.tree.io.BPlusMetaIO in project ignite by apache.

the class MetaPageAddRootRecord method applyDelta.

/**
 * {@inheritDoc}
 */
@Override
public void applyDelta(PageMemory pageMem, long pageAddr) throws IgniteCheckedException {
    BPlusMetaIO io = BPlusMetaIO.VERSIONS.forPage(pageAddr);
    io.addRoot(pageAddr, rootId, pageMem.realPageSize(groupId()));
}
Also used : BPlusMetaIO(org.apache.ignite.internal.processors.cache.persistence.tree.io.BPlusMetaIO)

Example 3 with BPlusMetaIO

use of org.apache.ignite.internal.processors.cache.persistence.tree.io.BPlusMetaIO in project ignite by apache.

the class MetaPageInitRootInlineRecord method applyDelta.

/**
 * {@inheritDoc}
 */
@Override
public void applyDelta(PageMemory pageMem, long pageAddr) throws IgniteCheckedException {
    BPlusMetaIO io = BPlusMetaIO.VERSIONS.forPage(pageAddr);
    io.initRoot(pageAddr, rootId, pageMem.realPageSize(groupId()));
    io.setInlineSize(pageAddr, inlineSize);
}
Also used : BPlusMetaIO(org.apache.ignite.internal.processors.cache.persistence.tree.io.BPlusMetaIO)

Example 4 with BPlusMetaIO

use of org.apache.ignite.internal.processors.cache.persistence.tree.io.BPlusMetaIO in project ignite by apache.

the class MetaPageInitRootInlineFlagsCreatedVersionRecord method applyDelta.

/**
 * {@inheritDoc}
 */
@Override
public void applyDelta(PageMemory pageMem, long pageAddr) throws IgniteCheckedException {
    super.applyDelta(pageMem, pageAddr);
    BPlusMetaIO io = BPlusMetaIO.VERSIONS.forPage(pageAddr);
    io.initFlagsAndVersion(pageAddr, flags, createdVer);
}
Also used : BPlusMetaIO(org.apache.ignite.internal.processors.cache.persistence.tree.io.BPlusMetaIO)

Example 5 with BPlusMetaIO

use of org.apache.ignite.internal.processors.cache.persistence.tree.io.BPlusMetaIO in project ignite by apache.

the class MetaPageInitRootRecord method applyDelta.

/**
 * {@inheritDoc}
 */
@Override
public void applyDelta(PageMemory pageMem, long pageAddr) throws IgniteCheckedException {
    BPlusMetaIO io = BPlusMetaIO.VERSIONS.forPage(pageAddr);
    io.initRoot(pageAddr, rootId, pageMem.realPageSize(groupId()));
    io.setInlineSize(pageAddr, 0);
}
Also used : BPlusMetaIO(org.apache.ignite.internal.processors.cache.persistence.tree.io.BPlusMetaIO)

Aggregations

BPlusMetaIO (org.apache.ignite.internal.processors.cache.persistence.tree.io.BPlusMetaIO)11 ArrayList (java.util.ArrayList)3 AtomicLong (java.util.concurrent.atomic.AtomicLong)3 File (java.io.File)2 FileOutputStream (java.io.FileOutputStream)2 IOException (java.io.IOException)2 OutputStream (java.io.OutputStream)2 PrintStream (java.io.PrintStream)2 Integer.parseInt (java.lang.Integer.parseInt)2 String.format (java.lang.String.format)2 ByteBuffer (java.nio.ByteBuffer)2 FileChannel (java.nio.channels.FileChannel)2 Arrays (java.util.Arrays)2 Arrays.asList (java.util.Arrays.asList)2 Collections (java.util.Collections)2 Collections.singletonList (java.util.Collections.singletonList)2 HashMap (java.util.HashMap)2 HashSet (java.util.HashSet)2 LinkedHashMap (java.util.LinkedHashMap)2 LinkedList (java.util.LinkedList)2