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