Search in sources :

Example 1 with MetaPageInfo

use of org.apache.ignite.internal.cache.query.index.sorted.MetaPageInfo in project ignite by apache.

the class DefragIndexFactory method createIndexSegment.

/**
 * {@inheritDoc}
 */
@Override
protected InlineIndexTree createIndexSegment(GridCacheContext<?, ?> cctx, SortedIndexDefinition def, RootPage rootPage, IoStatisticsHolder stats, InlineRecommender recommender, int segmentNum) throws Exception {
    InlineIndexTree tree = new InlineIndexTree(def, cctx.group(), def.treeName(), offheap, offheap.reuseListForIndex(def.treeName()), newCachePageMemory, // Use old row handler to have access to inline index key types.
    pageIoResolver(), rootPage.pageId().pageId(), rootPage.isAllocated(), oldIdx.inlineSize(), cctx.config().getSqlIndexMaxInlineSize(), def.keyTypeSettings(), null, stats, rowHndFactory, null);
    final MetaPageInfo oldInfo = oldIdx.segment(segmentNum).metaInfo();
    // Set IO wrappers for the new tree.
    BPlusInnerIO<IndexRow> innerIO = (BPlusInnerIO<IndexRow>) wrap(tree.latestInnerIO(), tree.rowHandler());
    BPlusLeafIO<IndexRow> leafIo = (BPlusLeafIO<IndexRow>) wrap(tree.latestLeafIO(), tree.rowHandler());
    tree.setIos(new IOVersions<>(innerIO), new IOVersions<>(leafIo));
    tree.copyMetaInfo(oldInfo);
    tree.enableSequentialWriteMode();
    return tree;
}
Also used : IndexRow(org.apache.ignite.internal.cache.query.index.sorted.IndexRow) InlineIndexTree(org.apache.ignite.internal.cache.query.index.sorted.inline.InlineIndexTree) BPlusInnerIO(org.apache.ignite.internal.processors.cache.persistence.tree.io.BPlusInnerIO) BPlusLeafIO(org.apache.ignite.internal.processors.cache.persistence.tree.io.BPlusLeafIO) MetaPageInfo(org.apache.ignite.internal.cache.query.index.sorted.MetaPageInfo)

Aggregations

IndexRow (org.apache.ignite.internal.cache.query.index.sorted.IndexRow)1 MetaPageInfo (org.apache.ignite.internal.cache.query.index.sorted.MetaPageInfo)1 InlineIndexTree (org.apache.ignite.internal.cache.query.index.sorted.inline.InlineIndexTree)1 BPlusInnerIO (org.apache.ignite.internal.processors.cache.persistence.tree.io.BPlusInnerIO)1 BPlusLeafIO (org.apache.ignite.internal.processors.cache.persistence.tree.io.BPlusLeafIO)1