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;
}
Aggregations