Search in sources :

Example 1 with PageMemoryNoStoreImpl

use of org.apache.ignite.internal.pagemem.impl.PageMemoryNoStoreImpl in project ignite by apache.

the class MetadataStorageSelfTest method memory.

/**
     * @param clean Clean flag. If {@code true}, will clean previous memory state and allocate
     *      new empty page memory.
     * @return Page memory instance.
     */
protected PageMemory memory(boolean clean) throws Exception {
    DirectMemoryProvider provider = new MappedFileMemoryProvider(log(), allocationPath);
    MemoryPolicyConfiguration plcCfg = new MemoryPolicyConfiguration().setMaxSize(30 * 1024 * 1024).setInitialSize(30 * 1024 * 1024);
    return new PageMemoryNoStoreImpl(log, provider, null, PAGE_SIZE, plcCfg, new MemoryMetricsImpl(plcCfg), true);
}
Also used : MappedFileMemoryProvider(org.apache.ignite.internal.mem.file.MappedFileMemoryProvider) PageMemoryNoStoreImpl(org.apache.ignite.internal.pagemem.impl.PageMemoryNoStoreImpl) DirectMemoryProvider(org.apache.ignite.internal.mem.DirectMemoryProvider) MemoryPolicyConfiguration(org.apache.ignite.configuration.MemoryPolicyConfiguration) MemoryMetricsImpl(org.apache.ignite.internal.processors.cache.database.MemoryMetricsImpl)

Example 2 with PageMemoryNoStoreImpl

use of org.apache.ignite.internal.pagemem.impl.PageMemoryNoStoreImpl in project ignite by apache.

the class CacheFreeListImplSelfTest method createPageMemory.

/**
 * @return Page memory.
 */
protected PageMemory createPageMemory(int pageSize, DataRegionConfiguration plcCfg) throws Exception {
    PageMemory pageMem = new PageMemoryNoStoreImpl(log, new UnsafeMemoryProvider(log), null, pageSize, plcCfg, new DataRegionMetricsImpl(plcCfg), true);
    pageMem.start();
    return pageMem;
}
Also used : PageMemoryNoStoreImpl(org.apache.ignite.internal.pagemem.impl.PageMemoryNoStoreImpl) PageMemory(org.apache.ignite.internal.pagemem.PageMemory) DataRegionMetricsImpl(org.apache.ignite.internal.processors.cache.persistence.DataRegionMetricsImpl) UnsafeMemoryProvider(org.apache.ignite.internal.mem.unsafe.UnsafeMemoryProvider)

Example 3 with PageMemoryNoStoreImpl

use of org.apache.ignite.internal.pagemem.impl.PageMemoryNoStoreImpl in project ignite by apache.

the class BPlusTreeBenchmark method createPageMemory.

/**
 * @return Page memory.
 */
private PageMemory createPageMemory() {
    DataRegionConfiguration dataRegionConfiguration = new DataRegionConfiguration().setMaxSize(1024 * MB);
    DataRegionMetricsImpl dataRegionMetrics = mock(DataRegionMetricsImpl.class);
    PageMetrics pageMetrics = mock(PageMetrics.class);
    LongAdderMetric noOpMetric = new LongAdderMetric("foobar", null);
    when(dataRegionMetrics.cacheGrpPageMetrics(anyInt())).thenReturn(pageMetrics);
    when(pageMetrics.totalPages()).thenReturn(noOpMetric);
    when(pageMetrics.indexPages()).thenReturn(noOpMetric);
    PageMemory pageMem = new PageMemoryNoStoreImpl(new JavaLogger(), new UnsafeMemoryProvider(new JavaLogger()), null, PAGE_SIZE, dataRegionConfiguration, dataRegionMetrics, false);
    pageMem.start();
    return pageMem;
}
Also used : DataRegionConfiguration(org.apache.ignite.configuration.DataRegionConfiguration) PageMemoryNoStoreImpl(org.apache.ignite.internal.pagemem.impl.PageMemoryNoStoreImpl) PageMemory(org.apache.ignite.internal.pagemem.PageMemory) PageMetrics(org.apache.ignite.internal.processors.cache.persistence.pagemem.PageMetrics) LongAdderMetric(org.apache.ignite.internal.processors.metric.impl.LongAdderMetric) DataRegionMetricsImpl(org.apache.ignite.internal.processors.cache.persistence.DataRegionMetricsImpl) JavaLogger(org.apache.ignite.logger.java.JavaLogger) UnsafeMemoryProvider(org.apache.ignite.internal.mem.unsafe.UnsafeMemoryProvider)

Example 4 with PageMemoryNoStoreImpl

use of org.apache.ignite.internal.pagemem.impl.PageMemoryNoStoreImpl in project ignite by apache.

the class CacheDataRowAdapter method initFromDataPage.

/**
 * @param io Data page IO.
 * @param pageAddr Data page address.
 * @param itemId Row item Id.
 * @param grp Cache group.
 * @param sharedCtx Cache shared context.
 * @param pageMem Page memory.
 * @param rowData Required row data.
 * @param skipVer Whether version read should be skipped.
 * @throws IgniteCheckedException If failed.
 */
public final void initFromDataPage(DataPageIO io, long pageAddr, int itemId, @Nullable CacheGroupContext grp, GridCacheSharedContext<?, ?> sharedCtx, PageMemory pageMem, RowData rowData, boolean skipVer) throws IgniteCheckedException {
    // Group is null if try evict page, with persistence evictions should be disabled.
    assert grp != null || pageMem instanceof PageMemoryNoStoreImpl;
    CacheObjectContext coctx = grp != null ? grp.cacheObjectContext() : null;
    boolean readCacheId = grp == null || grp.storeCacheIdInDataPage();
    int grpId = grp != null ? grp.groupId() : 0;
    IoStatisticsHolder statHolder = grp != null ? grp.statisticsHolderData() : IoStatisticsHolderNoOp.INSTANCE;
    IncompleteObject<?> incomplete = readIncomplete(null, sharedCtx, coctx, pageMem.pageSize(), pageMem.realPageSize(grpId), pageAddr, itemId, io, rowData, readCacheId, skipVer);
    if (incomplete != null) {
        // Initialize the remaining part of the large row from other pages.
        long nextLink = incomplete.getNextLink();
        if (nextLink != 0L) {
            doInitFromLink(nextLink, sharedCtx, coctx, pageMem, grpId, statHolder, readCacheId, rowData, incomplete, skipVer);
        }
    }
}
Also used : PageMemoryNoStoreImpl(org.apache.ignite.internal.pagemem.impl.PageMemoryNoStoreImpl) IoStatisticsHolder(org.apache.ignite.internal.metric.IoStatisticsHolder) CacheObjectContext(org.apache.ignite.internal.processors.cache.CacheObjectContext)

Example 5 with PageMemoryNoStoreImpl

use of org.apache.ignite.internal.pagemem.impl.PageMemoryNoStoreImpl in project ignite by apache.

the class IgniteCacheDatabaseSharedManager method createPageMemory.

/**
 * Creates PageMemory with given size and memory provider.
 *
 * @param memProvider Memory provider.
 * @param memCfg Memory configuartion.
 * @param memPlcCfg data region configuration.
 * @param memMetrics DataRegionMetrics to collect memory usage metrics.
 * @param pmPageMgr Page manager.
 * @return PageMemory instance.
 */
protected PageMemory createPageMemory(DirectMemoryProvider memProvider, DataStorageConfiguration memCfg, DataRegionConfiguration memPlcCfg, DataRegionMetricsImpl memMetrics, boolean trackable, PageReadWriteManager pmPageMgr) {
    memMetrics.persistenceEnabled(false);
    PageMemory pageMem = new PageMemoryNoStoreImpl(cctx, wrapMetricsMemoryProvider(memProvider, memMetrics), memCfg.getPageSize(), memPlcCfg, memMetrics);
    memMetrics.pageMemory(pageMem);
    return pageMem;
}
Also used : PageMemoryNoStoreImpl(org.apache.ignite.internal.pagemem.impl.PageMemoryNoStoreImpl) PageMemory(org.apache.ignite.internal.pagemem.PageMemory)

Aggregations

PageMemoryNoStoreImpl (org.apache.ignite.internal.pagemem.impl.PageMemoryNoStoreImpl)24 PageMemory (org.apache.ignite.internal.pagemem.PageMemory)19 UnsafeMemoryProvider (org.apache.ignite.internal.mem.unsafe.UnsafeMemoryProvider)17 DataRegionMetricsImpl (org.apache.ignite.internal.processors.cache.persistence.DataRegionMetricsImpl)17 DataRegionConfiguration (org.apache.ignite.configuration.DataRegionConfiguration)15 GridTestKernalContext (org.apache.ignite.testframework.junits.GridTestKernalContext)11 IndexKeyTypeSettings (org.apache.ignite.internal.cache.query.index.sorted.IndexKeyTypeSettings)6 InlineIndexKeyType (org.apache.ignite.internal.cache.query.index.sorted.inline.InlineIndexKeyType)6 StringInlineIndexKeyType (org.apache.ignite.internal.cache.query.index.sorted.inline.types.StringInlineIndexKeyType)6 Test (org.junit.Test)5 AbstractIndexingCommonTest (org.apache.ignite.internal.processors.cache.index.AbstractIndexingCommonTest)4 DirectMemoryProvider (org.apache.ignite.internal.mem.DirectMemoryProvider)3 CacheObjectContext (org.apache.ignite.internal.processors.cache.CacheObjectContext)3 Value (org.h2.value.Value)3 JavaObjectIndexKey (org.apache.ignite.internal.cache.query.index.sorted.keys.JavaObjectIndexKey)2 MappedFileMemoryProvider (org.apache.ignite.internal.mem.file.MappedFileMemoryProvider)2 IoStatisticsHolder (org.apache.ignite.internal.metric.IoStatisticsHolder)2 MemoryMetricsImpl (org.apache.ignite.internal.processors.cache.database.MemoryMetricsImpl)2 ByteBuffer (java.nio.ByteBuffer)1 Comparator (java.util.Comparator)1