Search in sources :

Example 6 with IgniteRpcClient

use of org.apache.ignite.raft.jraft.rpc.impl.IgniteRpcClient 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

IgniteRpcClient (org.apache.ignite.raft.jraft.rpc.impl.IgniteRpcClient)6 ClusterService (org.apache.ignite.network.ClusterService)5 NetworkAddress (org.apache.ignite.network.NetworkAddress)4 StaticNodeFinder (org.apache.ignite.network.StaticNodeFinder)4 TestScaleCubeClusterServiceFactory (org.apache.ignite.network.scalecube.TestScaleCubeClusterServiceFactory)4 Configuration (org.apache.ignite.raft.jraft.conf.Configuration)4 PeerId (org.apache.ignite.raft.jraft.entity.PeerId)4 RaftGroupService (org.apache.ignite.raft.jraft.RaftGroupService)3 ExecutorService (java.util.concurrent.ExecutorService)2 NodeManager (org.apache.ignite.raft.jraft.NodeManager)2 NodeOptions (org.apache.ignite.raft.jraft.option.NodeOptions)2 TestIgniteRpcServer (org.apache.ignite.raft.jraft.rpc.TestIgniteRpcServer)2 File (java.io.File)1 IOException (java.io.IOException)1 Path (java.nio.file.Path)1 LinkedHashSet (java.util.LinkedHashSet)1 IgniteInternalException (org.apache.ignite.lang.IgniteInternalException)1 JRaftUtils.addressFromEndpoint (org.apache.ignite.raft.jraft.JRaftUtils.addressFromEndpoint)1 Node (org.apache.ignite.raft.jraft.Node)1 CliOptions (org.apache.ignite.raft.jraft.option.CliOptions)1