use of org.apache.ignite.configuration.schemas.store.PageMemoryDataRegionConfiguration in project ignite-3 by apache.
the class PageMemoryNoLoadSelfTest method memory.
/**
* Creates new page memory instance.
*
* @return Page memory implementation.
* @throws Exception If failed.
*/
protected PageMemory memory() throws Exception {
dataRegionCfg.change(cfg -> cfg.convert(PageMemoryDataRegionChange.class).changePageSize(PAGE_SIZE).changeInitSize(MAX_MEMORY_SIZE).changeMaxSize(MAX_MEMORY_SIZE)).get(1, SECONDS);
DirectMemoryProvider provider = new UnsafeMemoryProvider(null);
PageIoRegistry ioRegistry = new PageIoRegistry();
ioRegistry.loadFromServiceLoader();
return new PageMemoryNoStoreImpl(provider, (PageMemoryDataRegionConfiguration) fixConfiguration(dataRegionCfg), ioRegistry);
}
use of org.apache.ignite.configuration.schemas.store.PageMemoryDataRegionConfiguration in project ignite-3 by apache.
the class AbstractFreeListTest method createPageMemory.
private PageMemory createPageMemory(int pageSize) throws Exception {
dataRegionCfg.change(c -> c.convert(PageMemoryDataRegionChange.class).changePageSize(pageSize).changeInitSize(MAX_SIZE).changeMaxSize(MAX_SIZE)).get(1, TimeUnit.SECONDS);
TestPageIoRegistry ioRegistry = new TestPageIoRegistry();
ioRegistry.loadFromServiceLoader();
ioRegistry.load(TestDataPageIo.VERSIONS);
return new PageMemoryNoStoreImpl(new UnsafeMemoryProvider(null), (PageMemoryDataRegionConfiguration) fixConfiguration(dataRegionCfg), ioRegistry);
}
use of org.apache.ignite.configuration.schemas.store.PageMemoryDataRegionConfiguration in project ignite-3 by apache.
the class PageMemoryImplNoLoadTest method memory.
/**
* {@inheritDoc}
*/
@Override
protected PageMemory memory() throws Exception {
dataRegionCfg.change(cfg -> cfg.convert(PageMemoryDataRegionChange.class).changePageSize(PAGE_SIZE).changeInitSize(MAX_MEMORY_SIZE).changeMaxSize(MAX_MEMORY_SIZE)).get(1, SECONDS);
PageIoRegistry ioRegistry = new PageIoRegistry();
ioRegistry.loadFromServiceLoader();
return new PageMemoryImpl(new UnsafeMemoryProvider(null), (PageMemoryDataRegionConfiguration) fixConfiguration(dataRegionCfg), ioRegistry, LongStream.range(0, 10).map(i -> 5 * MiB).toArray(), new TestPageReadWriteManager(), (page, fullPageId, pageMemoryEx) -> {
});
}
use of org.apache.ignite.configuration.schemas.store.PageMemoryDataRegionConfiguration in project ignite-3 by apache.
the class ItBplusTreeSelfTest method createPageMemory.
/**
* Returns page memory.
*
* @throws Exception If failed.
*/
protected PageMemory createPageMemory() throws Exception {
dataRegionCfg.change(c -> c.convert(PageMemoryDataRegionChange.class).changePageSize(PAGE_SIZE).changeInitSize(MAX_MEMORY_SIZE).changeMaxSize(MAX_MEMORY_SIZE)).get(1, TimeUnit.SECONDS);
TestPageIoRegistry ioRegistry = new TestPageIoRegistry();
ioRegistry.loadFromServiceLoader();
return new PageMemoryNoStoreImpl(new UnsafeMemoryProvider(null), (PageMemoryDataRegionConfiguration) fixConfiguration(dataRegionCfg), ioRegistry);
}
use of org.apache.ignite.configuration.schemas.store.PageMemoryDataRegionConfiguration in project ignite-3 by apache.
the class ItBplusTreePageMemoryImplTest method createPageMemory.
/**
* {@inheritDoc}
*/
@Override
protected PageMemory createPageMemory() throws Exception {
dataRegionCfg.change(c -> c.convert(PageMemoryDataRegionChange.class).changePageSize(PAGE_SIZE).changeInitSize(MAX_MEMORY_SIZE).changeMaxSize(MAX_MEMORY_SIZE)).get(1, TimeUnit.SECONDS);
long[] sizes = LongStream.range(0, CPUS + 1).map(i -> MAX_MEMORY_SIZE / CPUS).toArray();
sizes[CPUS] = 10 * MiB;
TestPageIoRegistry ioRegistry = new TestPageIoRegistry();
ioRegistry.loadFromServiceLoader();
return new PageMemoryImpl(new UnsafeMemoryProvider(null), (PageMemoryDataRegionConfiguration) fixConfiguration(dataRegionCfg), ioRegistry, sizes, new TestPageReadWriteManager(), (page, fullPageId, pageMemoryEx) -> {
});
}
Aggregations