CSharp
CSharp

Reputation: 39

How does the server node restart the client node after receiving the message (Apache Ignite .Net 2.8.1)

I started one Ignite Server project and one Ignite Client project in code, and the need now is to restart the corresponding Ignite Client node when the Server receives the Client message.Has anybody done that?I look at the Ignite GitHub source.Net is not restartNodes method, but Java is therejava doc link, how can I do?Currently, the server can get IClusterNode information from the client. This my server listen message code:

        public class RestartNodeMessageListener : IMessageListener<string>
        {
            private readonly IIgnite server;
            public RestartNodeMessageListener(IIgnite server)
            {
                this.server = server;
            }
            
            public bool Invoke(Guid nodeId, string message)
            {
                var clientNodeInfo = server.GetCluster().GetNode(nodeId);
                return true;
             }
        }

Upvotes: 0

Views: 230

Answers (1)

Alexandr Shapkin
Alexandr Shapkin

Reputation: 2425

Seems like it's true, that there is no build-in #restartNodes method for the .NET side.

You can vote for the IGNITE-3881 to become implemented more quickly.

Meanwhile, it's possible to adopt the java version. Basically, the cluster#restartNodes just executes a killing Compute call on a given nodes:

ctx.grid().compute(forNodeIds(ids)).execute(IgniteKillTask.class, true);

The source code of the IgniteKillTask is quite straightforward and there should not be many difficulties traversing it into the C# version. The Java API for the G.restart and G.kill could be replaced by Ignition.Stop and Ignition.Start methods.

Upvotes: 3

Related Questions