Esempio n. 1
0
        public void TestThinClientForServers()
        {
            var cluster = _igniteClient.GetCluster();

            var servers = cluster.ForServers().GetNodes();

            Assert.AreEqual(2, servers.Count);
            Assert.IsTrue(servers.All(x => !x.IsClient));
        }
        /// <summary>
        /// Asserts correct exception for cluster operations.
        /// </summary>
        public static void TestClusterOperationsThrowCorrectExceptionOnVersionsOlderThan150(IIgniteClient client,
                                                                                            string version)
        {
            var cluster = client.GetCluster();

            AssertNotSupportedOperation(() => cluster.IsActive(), version, "ClusterIsActive");
            AssertNotSupportedOperation(() => cluster.SetActive(true), version, "ClusterChangeState");
            AssertNotSupportedOperation(() => cluster.IsWalEnabled("c"), version, "ClusterGetWalState");
            AssertNotSupportedOperation(() => cluster.EnableWal("c"), version, "ClusterChangeWalState");
            AssertNotSupportedOperation(() => cluster.DisableWal("c"), version, "ClusterChangeWalState");
        }
Esempio n. 3
0
        public static void ClientCluster()
        {
            var cfg = new IgniteClientConfiguration();
            //tag::client-cluster[]
            IIgniteClient  client  = Ignition.StartClient(cfg);
            IClientCluster cluster = client.GetCluster();

            cluster.SetActive(true);
            cluster.EnableWal("my-cache");
            //end::client-cluster[]
        }
Esempio n. 4
0
        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[]
        }