public void TestClientForAttribute() { IClientClusterGroup clientPrj = _igniteClient.GetCluster().ForAttribute("my_attr", "value1"); Assert.AreEqual(1, clientPrj.GetNodes().Count); var nodeId = _grid1.GetCluster().ForAttribute("my_attr", "value1").GetNodes().Single().Id; Assert.AreEqual(nodeId, clientPrj.GetNode().Id); }
/// <summary> /// Initializes a new instance of <see cref="ComputeClient"/>. /// </summary> internal ComputeClient( IgniteClient ignite, ComputeClientFlags flags, TimeSpan?timeout, IClientClusterGroup clusterGroup) { _ignite = ignite; _flags = flags; _timeout = timeout ?? TimeSpan.Zero; _clusterGroup = clusterGroup; }
public static void ClientClusterGroups() { var cfg = new IgniteClientConfiguration(); //tag::client-cluster-groups[] IIgniteClient client = Ignition.StartClient(cfg); IClientClusterGroup serversInDc1 = client.GetCluster().ForServers().ForAttribute("dc", "dc1"); foreach (IClientClusterNode node in serversInDc1.GetNodes()) { Console.WriteLine($"Node ID: {node.Id}"); } //end::client-cluster-groups[] }
/// <summary> /// Initializes a new instance of <see cref="ServicesClient"/> class. /// </summary> public ServicesClient( IgniteClient ignite, IClientClusterGroup clusterGroup = null, bool keepBinary = false, bool serverKeepBinary = false, TimeSpan timeout = default(TimeSpan)) { Debug.Assert(ignite != null); _ignite = ignite; _clusterGroup = clusterGroup; _keepBinary = keepBinary; _serverKeepBinary = serverKeepBinary; _timeout = timeout; }