Search in sources :

Example 1 with DirectMemoryProvider

use of org.apache.ignite.internal.pagememory.mem.DirectMemoryProvider 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);
}
Also used : Assertions.fail(org.junit.jupiter.api.Assertions.fail) Assertions.assertNotNull(org.junit.jupiter.api.Assertions.assertNotNull) PageMemory(org.apache.ignite.internal.pagememory.PageMemory) DirectMemoryProvider(org.apache.ignite.internal.pagememory.mem.DirectMemoryProvider) PageIoRegistry(org.apache.ignite.internal.pagememory.io.PageIoRegistry) PageMemoryDataRegionChange(org.apache.ignite.configuration.schemas.store.PageMemoryDataRegionChange) PageMemoryDataRegionConfigurationSchema(org.apache.ignite.configuration.schemas.store.PageMemoryDataRegionConfigurationSchema) FullPageId(org.apache.ignite.internal.pagememory.FullPageId) PageIdAllocator(org.apache.ignite.internal.pagememory.PageIdAllocator) ArrayList(java.util.ArrayList) InjectConfiguration(org.apache.ignite.internal.configuration.testframework.InjectConfiguration) TestPageIo(org.apache.ignite.internal.pagememory.TestPageIoModule.TestPageIo) HashSet(java.util.HashSet) IgniteOutOfMemoryException(org.apache.ignite.internal.pagememory.mem.IgniteOutOfMemoryException) Assertions.assertFalse(org.junit.jupiter.api.Assertions.assertFalse) UnsafeMemoryAllocatorConfigurationSchema(org.apache.ignite.configuration.schemas.store.UnsafeMemoryAllocatorConfigurationSchema) ExtendWith(org.junit.jupiter.api.extension.ExtendWith) ConfigurationExtension(org.apache.ignite.internal.configuration.testframework.ConfigurationExtension) Assertions.assertEquals(org.junit.jupiter.api.Assertions.assertEquals) UnsafeMemoryProvider(org.apache.ignite.internal.pagememory.mem.unsafe.UnsafeMemoryProvider) DataRegionConfiguration(org.apache.ignite.configuration.schemas.store.DataRegionConfiguration) Collection(java.util.Collection) PageIo(org.apache.ignite.internal.pagememory.io.PageIo) Assertions.assertNotSame(org.junit.jupiter.api.Assertions.assertNotSame) BaseIgniteAbstractTest(org.apache.ignite.internal.testframework.BaseIgniteAbstractTest) PageUtils(org.apache.ignite.internal.pagememory.util.PageUtils) ConfigurationTestUtils.fixConfiguration(org.apache.ignite.internal.configuration.ConfigurationTestUtils.fixConfiguration) Test(org.junit.jupiter.api.Test) List(java.util.List) IgniteInternalCheckedException(org.apache.ignite.lang.IgniteInternalCheckedException) PageIdUtils(org.apache.ignite.internal.pagememory.util.PageIdUtils) PageMemoryDataRegionConfiguration(org.apache.ignite.configuration.schemas.store.PageMemoryDataRegionConfiguration) SECONDS(java.util.concurrent.TimeUnit.SECONDS) DirectMemoryProvider(org.apache.ignite.internal.pagememory.mem.DirectMemoryProvider) PageMemoryDataRegionChange(org.apache.ignite.configuration.schemas.store.PageMemoryDataRegionChange) UnsafeMemoryProvider(org.apache.ignite.internal.pagememory.mem.unsafe.UnsafeMemoryProvider) PageIoRegistry(org.apache.ignite.internal.pagememory.io.PageIoRegistry)

Aggregations

ArrayList (java.util.ArrayList)1 Collection (java.util.Collection)1 HashSet (java.util.HashSet)1 List (java.util.List)1 SECONDS (java.util.concurrent.TimeUnit.SECONDS)1 DataRegionConfiguration (org.apache.ignite.configuration.schemas.store.DataRegionConfiguration)1 PageMemoryDataRegionChange (org.apache.ignite.configuration.schemas.store.PageMemoryDataRegionChange)1 PageMemoryDataRegionConfiguration (org.apache.ignite.configuration.schemas.store.PageMemoryDataRegionConfiguration)1 PageMemoryDataRegionConfigurationSchema (org.apache.ignite.configuration.schemas.store.PageMemoryDataRegionConfigurationSchema)1 UnsafeMemoryAllocatorConfigurationSchema (org.apache.ignite.configuration.schemas.store.UnsafeMemoryAllocatorConfigurationSchema)1 ConfigurationTestUtils.fixConfiguration (org.apache.ignite.internal.configuration.ConfigurationTestUtils.fixConfiguration)1 ConfigurationExtension (org.apache.ignite.internal.configuration.testframework.ConfigurationExtension)1 InjectConfiguration (org.apache.ignite.internal.configuration.testframework.InjectConfiguration)1 FullPageId (org.apache.ignite.internal.pagememory.FullPageId)1 PageIdAllocator (org.apache.ignite.internal.pagememory.PageIdAllocator)1 PageMemory (org.apache.ignite.internal.pagememory.PageMemory)1 TestPageIo (org.apache.ignite.internal.pagememory.TestPageIoModule.TestPageIo)1 PageIo (org.apache.ignite.internal.pagememory.io.PageIo)1 PageIoRegistry (org.apache.ignite.internal.pagememory.io.PageIoRegistry)1 DirectMemoryProvider (org.apache.ignite.internal.pagememory.mem.DirectMemoryProvider)1