Search in sources :

Example 6 with DummyInternalTableImpl

use of org.apache.ignite.internal.table.impl.DummyInternalTableImpl in project ignite-3 by apache.

the class SchemaValidationTest method createTable.

/**
 * Creates a table for tests.
 *
 * @return The test table.
 */
private InternalTable createTable() {
    clusterService = Mockito.mock(ClusterService.class, RETURNS_DEEP_STUBS);
    Mockito.when(clusterService.topologyService().localMember().address()).thenReturn(DummyInternalTableImpl.ADDR);
    TxManagerImpl txManager = new TxManagerImpl(clusterService, new HeapLockManager());
    MessagingService messagingService = MessagingServiceTestUtils.mockMessagingService(txManager);
    Mockito.when(clusterService.messagingService()).thenReturn(messagingService);
    return new DummyInternalTableImpl(new VersionedRowStore(new ConcurrentHashMapPartitionStorage(), txManager), txManager);
}
Also used : VersionedRowStore(org.apache.ignite.internal.table.distributed.storage.VersionedRowStore) HeapLockManager(org.apache.ignite.internal.tx.impl.HeapLockManager) ClusterService(org.apache.ignite.network.ClusterService) TxManagerImpl(org.apache.ignite.internal.tx.impl.TxManagerImpl) ConcurrentHashMapPartitionStorage(org.apache.ignite.internal.storage.basic.ConcurrentHashMapPartitionStorage) DummyInternalTableImpl(org.apache.ignite.internal.table.impl.DummyInternalTableImpl) MessagingService(org.apache.ignite.network.MessagingService)

Example 7 with DummyInternalTableImpl

use of org.apache.ignite.internal.table.impl.DummyInternalTableImpl in project ignite-3 by apache.

the class TxLocalTest method before.

/**
 * Initialize the test state.
 */
@Override
@BeforeEach
public void before() {
    ClusterService clusterService = Mockito.mock(ClusterService.class, RETURNS_DEEP_STUBS);
    Mockito.when(clusterService.topologyService().localMember().address()).thenReturn(DummyInternalTableImpl.ADDR);
    lockManager = new HeapLockManager();
    txManager = new TxManagerImpl(clusterService, lockManager);
    MessagingService messagingService = MessagingServiceTestUtils.mockMessagingService(txManager);
    Mockito.when(clusterService.messagingService()).thenReturn(messagingService);
    igniteTransactions = new IgniteTransactionsImpl(txManager);
    InternalTable table = new DummyInternalTableImpl(new VersionedRowStore(new ConcurrentHashMapPartitionStorage(), txManager), txManager);
    accounts = new TableImpl(table, new DummySchemaManagerImpl(ACCOUNTS_SCHEMA));
    InternalTable table2 = new DummyInternalTableImpl(new VersionedRowStore(new ConcurrentHashMapPartitionStorage(), txManager), txManager);
    customers = new TableImpl(table2, new DummySchemaManagerImpl(CUSTOMERS_SCHEMA));
}
Also used : VersionedRowStore(org.apache.ignite.internal.table.distributed.storage.VersionedRowStore) HeapLockManager(org.apache.ignite.internal.tx.impl.HeapLockManager) ClusterService(org.apache.ignite.network.ClusterService) IgniteTransactionsImpl(org.apache.ignite.internal.tx.impl.IgniteTransactionsImpl) TxManagerImpl(org.apache.ignite.internal.tx.impl.TxManagerImpl) ConcurrentHashMapPartitionStorage(org.apache.ignite.internal.storage.basic.ConcurrentHashMapPartitionStorage) DummyInternalTableImpl(org.apache.ignite.internal.table.impl.DummyInternalTableImpl) DummyInternalTableImpl(org.apache.ignite.internal.table.impl.DummyInternalTableImpl) DummySchemaManagerImpl(org.apache.ignite.internal.table.impl.DummySchemaManagerImpl) MessagingService(org.apache.ignite.network.MessagingService) BeforeEach(org.junit.jupiter.api.BeforeEach)

Aggregations

ConcurrentHashMapPartitionStorage (org.apache.ignite.internal.storage.basic.ConcurrentHashMapPartitionStorage)7 VersionedRowStore (org.apache.ignite.internal.table.distributed.storage.VersionedRowStore)7 DummyInternalTableImpl (org.apache.ignite.internal.table.impl.DummyInternalTableImpl)7 HeapLockManager (org.apache.ignite.internal.tx.impl.HeapLockManager)7 TxManagerImpl (org.apache.ignite.internal.tx.impl.TxManagerImpl)7 ClusterService (org.apache.ignite.network.ClusterService)7 MessagingService (org.apache.ignite.network.MessagingService)7 DummySchemaManagerImpl (org.apache.ignite.internal.table.impl.DummySchemaManagerImpl)6 TxManager (org.apache.ignite.internal.tx.TxManager)5 NotNull (org.jetbrains.annotations.NotNull)4 LockManager (org.apache.ignite.internal.tx.LockManager)3 Arrays (java.util.Arrays)2 Collections (java.util.Collections)2 List (java.util.List)2 Random (java.util.Random)2 Set (java.util.Set)2 Collectors (java.util.stream.Collectors)2 Column (org.apache.ignite.internal.schema.Column)2 NativeTypeSpec (org.apache.ignite.internal.schema.NativeTypeSpec)2 NativeTypes (org.apache.ignite.internal.schema.NativeTypes)2