Search in sources :

Example 41 with ClusterService

use of org.apache.ignite.network.ClusterService in project ignite-3 by apache.

the class IgniteRpcTest method createServer.

/**
 * {@inheritDoc}
 */
@Override
public RpcServer<?> createServer(Endpoint endpoint) {
    ClusterService service = ClusterServiceTestUtils.clusterService(testInfo, endpoint.getPort(), new StaticNodeFinder(Collections.emptyList()), new TestScaleCubeClusterServiceFactory());
    NodeOptions nodeOptions = new NodeOptions();
    requestExecutor = JRaftUtils.createRequestExecutor(nodeOptions);
    var server = new TestIgniteRpcServer(service, new NodeManager(), nodeOptions, requestExecutor) {

        @Override
        public void shutdown() {
            super.shutdown();
            service.stop();
        }
    };
    service.start();
    return server;
}
Also used : NodeManager(org.apache.ignite.raft.jraft.NodeManager) ClusterService(org.apache.ignite.network.ClusterService) TestScaleCubeClusterServiceFactory(org.apache.ignite.network.scalecube.TestScaleCubeClusterServiceFactory) StaticNodeFinder(org.apache.ignite.network.StaticNodeFinder) NodeOptions(org.apache.ignite.raft.jraft.option.NodeOptions)

Example 42 with ClusterService

use of org.apache.ignite.network.ClusterService in project ignite-3 by apache.

the class IgniteRpcTest method createClient0.

/**
 * {@inheritDoc}
 */
@Override
public RpcClient createClient0() {
    int i = cntr.incrementAndGet();
    ClusterService service = ClusterServiceTestUtils.clusterService(testInfo, endpoint.getPort() - i, new StaticNodeFinder(List.of(addressFromEndpoint(endpoint))), new TestScaleCubeClusterServiceFactory());
    IgniteRpcClient client = new IgniteRpcClient(service) {

        @Override
        public void shutdown() {
            super.shutdown();
            service.stop();
        }
    };
    service.start();
    waitForTopology(client, 1 + i, 5_000);
    return client;
}
Also used : ClusterService(org.apache.ignite.network.ClusterService) TestScaleCubeClusterServiceFactory(org.apache.ignite.network.scalecube.TestScaleCubeClusterServiceFactory) StaticNodeFinder(org.apache.ignite.network.StaticNodeFinder) IgniteRpcClient(org.apache.ignite.raft.jraft.rpc.impl.IgniteRpcClient) JRaftUtils.addressFromEndpoint(org.apache.ignite.raft.jraft.JRaftUtils.addressFromEndpoint) Endpoint(org.apache.ignite.raft.jraft.util.Endpoint)

Aggregations

ClusterService (org.apache.ignite.network.ClusterService)42 NetworkAddress (org.apache.ignite.network.NetworkAddress)18 StaticNodeFinder (org.apache.ignite.network.StaticNodeFinder)12 Test (org.junit.jupiter.api.Test)12 ConcurrentHashMapPartitionStorage (org.apache.ignite.internal.storage.basic.ConcurrentHashMapPartitionStorage)11 VersionedRowStore (org.apache.ignite.internal.table.distributed.storage.VersionedRowStore)11 HeapLockManager (org.apache.ignite.internal.tx.impl.HeapLockManager)11 TxManagerImpl (org.apache.ignite.internal.tx.impl.TxManagerImpl)11 List (java.util.List)10 TestScaleCubeClusterServiceFactory (org.apache.ignite.network.scalecube.TestScaleCubeClusterServiceFactory)10 ClusterNode (org.apache.ignite.network.ClusterNode)9 MessagingService (org.apache.ignite.network.MessagingService)9 BeforeEach (org.junit.jupiter.api.BeforeEach)8 DummyInternalTableImpl (org.apache.ignite.internal.table.impl.DummyInternalTableImpl)7 DummySchemaManagerImpl (org.apache.ignite.internal.table.impl.DummySchemaManagerImpl)7 TxManager (org.apache.ignite.internal.tx.TxManager)7 RaftGroupService (org.apache.ignite.raft.client.service.RaftGroupService)7 AfterEach (org.junit.jupiter.api.AfterEach)7 JraftServerImpl (org.apache.ignite.internal.raft.server.impl.JraftServerImpl)6 Peer (org.apache.ignite.raft.client.Peer)6