Search in sources :

Example 1 with PageMemoryNoStoreImpl

use of org.apache.ignite.internal.pagememory.impl.PageMemoryNoStoreImpl 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);
}
Also used : PageMemory(org.apache.ignite.internal.pagememory.PageMemory) TestPageIoRegistry(org.apache.ignite.internal.pagememory.TestPageIoRegistry) Assertions.assertNotEquals(org.junit.jupiter.api.Assertions.assertNotEquals) Assertions.assertNull(org.junit.jupiter.api.Assertions.assertNull) PageMemoryDataRegionChange(org.apache.ignite.configuration.schemas.store.PageMemoryDataRegionChange) PageMemoryDataRegionConfigurationSchema(org.apache.ignite.configuration.schemas.store.PageMemoryDataRegionConfigurationSchema) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) MINUTES(java.util.concurrent.TimeUnit.MINUTES) HashMap(java.util.HashMap) Random(java.util.Random) FLAG_AUX(org.apache.ignite.internal.pagememory.PageIdAllocator.FLAG_AUX) ArrayList(java.util.ArrayList) InjectConfiguration(org.apache.ignite.internal.configuration.testframework.InjectConfiguration) IoStatisticsHolderNoOp(org.apache.ignite.internal.pagememory.metric.IoStatisticsHolderNoOp) PageLockListenerNoOp(org.apache.ignite.internal.pagememory.util.PageLockListenerNoOp) IgniteTestUtils.runMultiThreadedAsync(org.apache.ignite.internal.testframework.IgniteTestUtils.runMultiThreadedAsync) UnsafeMemoryAllocatorConfigurationSchema(org.apache.ignite.configuration.schemas.store.UnsafeMemoryAllocatorConfigurationSchema) ExtendWith(org.junit.jupiter.api.extension.ExtendWith) ConfigurationExtension(org.apache.ignite.internal.configuration.testframework.ConfigurationExtension) PageMemoryNoStoreImpl(org.apache.ignite.internal.pagememory.impl.PageMemoryNoStoreImpl) Map(java.util.Map) ThreadLocalRandom(java.util.concurrent.ThreadLocalRandom) Assertions.assertEquals(org.junit.jupiter.api.Assertions.assertEquals) MethodSource(org.junit.jupiter.params.provider.MethodSource) UnsafeMemoryProvider(org.apache.ignite.internal.pagememory.mem.unsafe.UnsafeMemoryProvider) Iterator(java.util.Iterator) PageIdUtils.partitionId(org.apache.ignite.internal.pagememory.util.PageIdUtils.partitionId) DataRegionConfiguration(org.apache.ignite.configuration.schemas.store.DataRegionConfiguration) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) Arguments(org.junit.jupiter.params.provider.Arguments) BaseIgniteAbstractTest(org.apache.ignite.internal.testframework.BaseIgniteAbstractTest) ConfigurationTestUtils.fixConfiguration(org.apache.ignite.internal.configuration.ConfigurationTestUtils.fixConfiguration) TimeUnit(java.util.concurrent.TimeUnit) Nullable(org.jetbrains.annotations.Nullable) List(java.util.List) IgniteInternalCheckedException(org.apache.ignite.lang.IgniteInternalCheckedException) AfterEach(org.junit.jupiter.api.AfterEach) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) Stream(java.util.stream.Stream) PageEvictionTrackerNoOp(org.apache.ignite.internal.pagememory.evict.PageEvictionTrackerNoOp) FLAG_DATA(org.apache.ignite.internal.pagememory.PageIdAllocator.FLAG_DATA) MiB(org.apache.ignite.internal.util.Constants.MiB) PageMemoryDataRegionConfiguration(org.apache.ignite.configuration.schemas.store.PageMemoryDataRegionConfiguration) IoStatisticsHolder(org.apache.ignite.internal.pagememory.metric.IoStatisticsHolder) PageMemoryNoStoreImpl(org.apache.ignite.internal.pagememory.impl.PageMemoryNoStoreImpl) TestPageIoRegistry(org.apache.ignite.internal.pagememory.TestPageIoRegistry) PageMemoryDataRegionChange(org.apache.ignite.configuration.schemas.store.PageMemoryDataRegionChange) UnsafeMemoryProvider(org.apache.ignite.internal.pagememory.mem.unsafe.UnsafeMemoryProvider)

Example 2 with PageMemoryNoStoreImpl

use of org.apache.ignite.internal.pagememory.impl.PageMemoryNoStoreImpl 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);
}
Also used : Collections.shuffle(java.util.Collections.shuffle) BeforeEach(org.junit.jupiter.api.BeforeEach) Arrays(java.util.Arrays) TestPageIoRegistry(org.apache.ignite.internal.pagememory.TestPageIoRegistry) REMOVE(org.apache.ignite.internal.pagememory.tree.IgniteTree.OperationType.REMOVE) PageMemoryDataRegionChange(org.apache.ignite.configuration.schemas.store.PageMemoryDataRegionChange) IgniteUtils.hexLong(org.apache.ignite.internal.util.IgniteUtils.hexLong) Random(java.util.Random) IgniteStringBuilder(org.apache.ignite.lang.IgniteStringBuilder) TreeRowClosure(org.apache.ignite.internal.pagememory.tree.BplusTree.TreeRowClosure) BplusIo(org.apache.ignite.internal.pagememory.tree.io.BplusIo) IgniteLogger(org.apache.ignite.lang.IgniteLogger) IgniteTestUtils.runMultiThreadedAsync(org.apache.ignite.internal.testframework.IgniteTestUtils.runMultiThreadedAsync) DataStructure(org.apache.ignite.internal.pagememory.datastructure.DataStructure) InvokeClosure(org.apache.ignite.internal.pagememory.tree.IgniteTree.InvokeClosure) Collections.singleton(java.util.Collections.singleton) PageIdUtils.effectivePageId(org.apache.ignite.internal.pagememory.util.PageIdUtils.effectivePageId) Assertions.assertFalse(org.junit.jupiter.api.Assertions.assertFalse) UnsafeMemoryAllocatorConfigurationSchema(org.apache.ignite.configuration.schemas.store.UnsafeMemoryAllocatorConfigurationSchema) ExtendWith(org.junit.jupiter.api.extension.ExtendWith) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) PageMemoryNoStoreImpl(org.apache.ignite.internal.pagememory.impl.PageMemoryNoStoreImpl) Map(java.util.Map) BplusLeafIo(org.apache.ignite.internal.pagememory.tree.io.BplusLeafIo) UnsafeMemoryProvider(org.apache.ignite.internal.pagememory.mem.unsafe.UnsafeMemoryProvider) CyclicBarrier(java.util.concurrent.CyclicBarrier) DataRegionConfiguration(org.apache.ignite.configuration.schemas.store.DataRegionConfiguration) Predicate(java.util.function.Predicate) BplusMetaIo(org.apache.ignite.internal.pagememory.tree.io.BplusMetaIo) Collection(java.util.Collection) OperationType(org.apache.ignite.internal.pagememory.tree.IgniteTree.OperationType) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) Set(java.util.Set) BlockingQueue(java.util.concurrent.BlockingQueue) Collections.emptyIterator(java.util.Collections.emptyIterator) MILLISECONDS(java.util.concurrent.TimeUnit.MILLISECONDS) BplusInnerIo(org.apache.ignite.internal.pagememory.tree.io.BplusInnerIo) ConfigurationTestUtils.fixConfiguration(org.apache.ignite.internal.configuration.ConfigurationTestUtils.fixConfiguration) Test(org.junit.jupiter.api.Test) ArrayBlockingQueue(java.util.concurrent.ArrayBlockingQueue) Nullable(org.jetbrains.annotations.Nullable) INDEX_PARTITION(org.apache.ignite.internal.pagememory.PageIdAllocator.INDEX_PARTITION) List(java.util.List) IgniteInternalCheckedException(org.apache.ignite.lang.IgniteInternalCheckedException) PUT(org.apache.ignite.internal.pagememory.tree.IgniteTree.OperationType.PUT) ReuseList(org.apache.ignite.internal.pagememory.reuse.ReuseList) Assertions.assertTrue(org.junit.jupiter.api.Assertions.assertTrue) PageIo.getPageId(org.apache.ignite.internal.pagememory.io.PageIo.getPageId) Queue(java.util.Queue) ConcurrentLinkedQueue(java.util.concurrent.ConcurrentLinkedQueue) AtomicLongArray(java.util.concurrent.atomic.AtomicLongArray) Assertions.fail(org.junit.jupiter.api.Assertions.fail) NOOP(org.apache.ignite.internal.pagememory.tree.IgniteTree.OperationType.NOOP) Assertions.assertNotNull(org.junit.jupiter.api.Assertions.assertNotNull) PageMemory(org.apache.ignite.internal.pagememory.PageMemory) IgniteRandom(org.apache.ignite.internal.util.IgniteRandom) PageUtils.getLong(org.apache.ignite.internal.pagememory.util.PageUtils.getLong) Assertions.assertNull(org.junit.jupiter.api.Assertions.assertNull) PageMemoryDataRegionConfigurationSchema(org.apache.ignite.configuration.schemas.store.PageMemoryDataRegionConfigurationSchema) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) HashMap(java.util.HashMap) CompletableFuture(java.util.concurrent.CompletableFuture) AtomicReference(java.util.concurrent.atomic.AtomicReference) FullPageId(org.apache.ignite.internal.pagememory.FullPageId) DataStructure.rnd(org.apache.ignite.internal.pagememory.datastructure.DataStructure.rnd) TreeSet(java.util.TreeSet) FLAG_AUX(org.apache.ignite.internal.pagememory.PageIdAllocator.FLAG_AUX) ArrayList(java.util.ArrayList) ConcurrentMap(java.util.concurrent.ConcurrentMap) InjectConfiguration(org.apache.ignite.internal.configuration.testframework.InjectConfiguration) PageLockListenerNoOp(org.apache.ignite.internal.pagememory.util.PageLockListenerNoOp) ConfigurationExtension(org.apache.ignite.internal.configuration.testframework.ConfigurationExtension) ThreadLocalRandom(java.util.concurrent.ThreadLocalRandom) Assertions.assertEquals(org.junit.jupiter.api.Assertions.assertEquals) Iterator(java.util.Iterator) IgniteStripedLock(org.apache.ignite.internal.util.IgniteStripedLock) BrokenBarrierException(java.util.concurrent.BrokenBarrierException) BaseIgniteAbstractTest(org.apache.ignite.internal.testframework.BaseIgniteAbstractTest) IgniteTestUtils.runMultiThreaded(org.apache.ignite.internal.testframework.IgniteTestUtils.runMultiThreaded) Assertions.assertSame(org.junit.jupiter.api.Assertions.assertSame) TimeUnit(java.util.concurrent.TimeUnit) AtomicLong(java.util.concurrent.atomic.AtomicLong) Lock(java.util.concurrent.locks.Lock) AfterEach(org.junit.jupiter.api.AfterEach) TreeMap(java.util.TreeMap) TestTree.threadId(org.apache.ignite.internal.pagememory.tree.ItBplusTreeSelfTest.TestTree.threadId) PageUtils.putLong(org.apache.ignite.internal.pagememory.util.PageUtils.putLong) GiB(org.apache.ignite.internal.util.Constants.GiB) IoVersions(org.apache.ignite.internal.pagememory.io.IoVersions) IgniteCursor(org.apache.ignite.internal.util.IgniteCursor) PageMemoryDataRegionConfiguration(org.apache.ignite.configuration.schemas.store.PageMemoryDataRegionConfiguration) PageLockListener(org.apache.ignite.internal.pagememory.util.PageLockListener) PageMemoryNoStoreImpl(org.apache.ignite.internal.pagememory.impl.PageMemoryNoStoreImpl) TestPageIoRegistry(org.apache.ignite.internal.pagememory.TestPageIoRegistry) PageMemoryDataRegionChange(org.apache.ignite.configuration.schemas.store.PageMemoryDataRegionChange) UnsafeMemoryProvider(org.apache.ignite.internal.pagememory.mem.unsafe.UnsafeMemoryProvider)

Example 3 with PageMemoryNoStoreImpl

use of org.apache.ignite.internal.pagememory.impl.PageMemoryNoStoreImpl in project ignite-3 by apache.

the class ItBplusTreeReplaceRemoveRaceTest method createPageMemory.

protected PageMemory createPageMemory() throws Exception {
    dataRegionCfg.change(c -> c.convert(PageMemoryDataRegionChange.class).changePageSize(512).changeInitSize(1024 * MiB).changeMaxSize(1024 * MiB)).get(1, TimeUnit.SECONDS);
    TestPageIoRegistry ioRegistry = new TestPageIoRegistry();
    ioRegistry.loadFromServiceLoader();
    return new PageMemoryNoStoreImpl(new UnsafeMemoryProvider(null), (PageMemoryDataRegionConfiguration) fixConfiguration(dataRegionCfg), ioRegistry);
}
Also used : PageMemory(org.apache.ignite.internal.pagememory.PageMemory) BeforeEach(org.junit.jupiter.api.BeforeEach) TestPageIoRegistry(org.apache.ignite.internal.pagememory.TestPageIoRegistry) PageMemoryDataRegionChange(org.apache.ignite.configuration.schemas.store.PageMemoryDataRegionChange) PageMemoryDataRegionConfigurationSchema(org.apache.ignite.configuration.schemas.store.PageMemoryDataRegionConfigurationSchema) IgniteTestUtils.runAsync(org.apache.ignite.internal.testframework.IgniteTestUtils.runAsync) CompletableFuture(java.util.concurrent.CompletableFuture) FullPageId(org.apache.ignite.internal.pagememory.FullPageId) BplusIo(org.apache.ignite.internal.pagememory.tree.io.BplusIo) FLAG_AUX(org.apache.ignite.internal.pagememory.PageIdAllocator.FLAG_AUX) InjectConfiguration(org.apache.ignite.internal.configuration.testframework.InjectConfiguration) PageLockListenerNoOp(org.apache.ignite.internal.pagememory.util.PageLockListenerNoOp) UnsafeMemoryAllocatorConfigurationSchema(org.apache.ignite.configuration.schemas.store.UnsafeMemoryAllocatorConfigurationSchema) ExtendWith(org.junit.jupiter.api.extension.ExtendWith) ConfigurationExtension(org.apache.ignite.internal.configuration.testframework.ConfigurationExtension) PageMemoryNoStoreImpl(org.apache.ignite.internal.pagememory.impl.PageMemoryNoStoreImpl) BplusLeafIo(org.apache.ignite.internal.pagememory.tree.io.BplusLeafIo) PageUtils.putInt(org.apache.ignite.internal.pagememory.util.PageUtils.putInt) Assertions.assertEquals(org.junit.jupiter.api.Assertions.assertEquals) UnsafeMemoryProvider(org.apache.ignite.internal.pagememory.mem.unsafe.UnsafeMemoryProvider) CyclicBarrier(java.util.concurrent.CyclicBarrier) Externalizable(java.io.Externalizable) DataRegionConfiguration(org.apache.ignite.configuration.schemas.store.DataRegionConfiguration) BplusMetaIo(org.apache.ignite.internal.pagememory.tree.io.BplusMetaIo) BplusInnerIo(org.apache.ignite.internal.pagememory.tree.io.BplusInnerIo) BaseIgniteAbstractTest(org.apache.ignite.internal.testframework.BaseIgniteAbstractTest) PageUtils(org.apache.ignite.internal.pagememory.util.PageUtils) IgniteBiTuple(org.apache.ignite.lang.IgniteBiTuple) ConfigurationTestUtils.fixConfiguration(org.apache.ignite.internal.configuration.ConfigurationTestUtils.fixConfiguration) TimeUnit(java.util.concurrent.TimeUnit) Test(org.junit.jupiter.api.Test) AtomicLong(java.util.concurrent.atomic.AtomicLong) Nullable(org.jetbrains.annotations.Nullable) INDEX_PARTITION(org.apache.ignite.internal.pagememory.PageIdAllocator.INDEX_PARTITION) IgniteInternalCheckedException(org.apache.ignite.lang.IgniteInternalCheckedException) AfterEach(org.junit.jupiter.api.AfterEach) IoVersions(org.apache.ignite.internal.pagememory.io.IoVersions) MiB(org.apache.ignite.internal.util.Constants.MiB) PageMemoryDataRegionConfiguration(org.apache.ignite.configuration.schemas.store.PageMemoryDataRegionConfiguration) PageMemoryNoStoreImpl(org.apache.ignite.internal.pagememory.impl.PageMemoryNoStoreImpl) TestPageIoRegistry(org.apache.ignite.internal.pagememory.TestPageIoRegistry) PageMemoryDataRegionChange(org.apache.ignite.configuration.schemas.store.PageMemoryDataRegionChange) UnsafeMemoryProvider(org.apache.ignite.internal.pagememory.mem.unsafe.UnsafeMemoryProvider)

Aggregations

TimeUnit (java.util.concurrent.TimeUnit)3 DataRegionConfiguration (org.apache.ignite.configuration.schemas.store.DataRegionConfiguration)3 PageMemoryDataRegionChange (org.apache.ignite.configuration.schemas.store.PageMemoryDataRegionChange)3 PageMemoryDataRegionConfiguration (org.apache.ignite.configuration.schemas.store.PageMemoryDataRegionConfiguration)3 PageMemoryDataRegionConfigurationSchema (org.apache.ignite.configuration.schemas.store.PageMemoryDataRegionConfigurationSchema)3 UnsafeMemoryAllocatorConfigurationSchema (org.apache.ignite.configuration.schemas.store.UnsafeMemoryAllocatorConfigurationSchema)3 ConfigurationTestUtils.fixConfiguration (org.apache.ignite.internal.configuration.ConfigurationTestUtils.fixConfiguration)3 ConfigurationExtension (org.apache.ignite.internal.configuration.testframework.ConfigurationExtension)3 InjectConfiguration (org.apache.ignite.internal.configuration.testframework.InjectConfiguration)3 FLAG_AUX (org.apache.ignite.internal.pagememory.PageIdAllocator.FLAG_AUX)3 PageMemory (org.apache.ignite.internal.pagememory.PageMemory)3 TestPageIoRegistry (org.apache.ignite.internal.pagememory.TestPageIoRegistry)3 PageMemoryNoStoreImpl (org.apache.ignite.internal.pagememory.impl.PageMemoryNoStoreImpl)3 UnsafeMemoryProvider (org.apache.ignite.internal.pagememory.mem.unsafe.UnsafeMemoryProvider)3 PageLockListenerNoOp (org.apache.ignite.internal.pagememory.util.PageLockListenerNoOp)3 BaseIgniteAbstractTest (org.apache.ignite.internal.testframework.BaseIgniteAbstractTest)3 IgniteInternalCheckedException (org.apache.ignite.lang.IgniteInternalCheckedException)3 Nullable (org.jetbrains.annotations.Nullable)3 AfterEach (org.junit.jupiter.api.AfterEach)3 Assertions.assertEquals (org.junit.jupiter.api.Assertions.assertEquals)3