ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ptupit...@apache.org
Subject [01/50] ignite git commit: IGNITE-3291 .NET: Added IClusterGroup.ForDaemons() method. This closes #1094.
Date Mon, 26 Sep 2016 12:13:15 GMT
Repository: ignite
Updated Branches:
  refs/heads/master cc57e2d62 -> d9c70a01b


IGNITE-3291 .NET: Added IClusterGroup.ForDaemons() method. This closes #1094.


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/3a66596d
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/3a66596d
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/3a66596d

Branch: refs/heads/master
Commit: 3a66596d76eae5b9265a7de74faeae812d95cccc
Parents: 990fa09
Author: ptupitsyn <ptupitsyn@gridgain.com>
Authored: Mon Sep 26 11:00:25 2016 +0300
Committer: vozerov-gridgain <vozerov@gridgain.com>
Committed: Mon Sep 26 11:00:25 2016 +0300

----------------------------------------------------------------------
 .../Compute/ComputeApiTest.cs                   | 26 ++++++++++++++++++++
 .../Apache.Ignite.Core/Cluster/IClusterGroup.cs | 14 +++++++++++
 .../Impl/Cluster/ClusterGroupImpl.cs            |  6 +++++
 .../dotnet/Apache.Ignite.Core/Impl/Ignite.cs    | 10 +++++++-
 .../Apache.Ignite.Core/Impl/IgniteProxy.cs      |  6 +++++
 5 files changed, 61 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/3a66596d/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Compute/ComputeApiTest.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Compute/ComputeApiTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Compute/ComputeApiTest.cs
index bc26e4c..7b71ad4 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Compute/ComputeApiTest.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Compute/ComputeApiTest.cs
@@ -524,6 +524,32 @@ namespace Apache.Ignite.Core.Tests.Compute
         }
 
         /// <summary>
+        /// Test for daemon nodes projection.
+        /// </summary>
+        [Test]
+        public void TestForDaemons()
+        {
+            Assert.AreEqual(0, _grid1.GetCluster().ForDaemons().GetNodes().Count);
+
+            using (var ignite = Ignition.Start(new IgniteConfiguration(TestUtils.GetTestConfiguration())
+                {
+                    SpringConfigUrl = "config\\compute\\compute-grid1.xml",
+                    GridName = "daemonGrid",
+                    IsDaemon = true
+                })
+            )
+            {
+                var prj = _grid1.GetCluster().ForDaemons();
+
+                Assert.AreEqual(1, prj.GetNodes().Count);
+                Assert.AreEqual(ignite.GetCluster().GetLocalNode().Id, prj.GetNode().Id);
+
+                Assert.IsTrue(prj.GetNode().IsDaemon);
+                Assert.IsTrue(ignite.GetCluster().GetLocalNode().IsDaemon);
+            }
+        }
+
+        /// <summary>
         /// Test for host nodes projection.
         /// </summary>
         [Test]

http://git-wip-us.apache.org/repos/asf/ignite/blob/3a66596d/modules/platforms/dotnet/Apache.Ignite.Core/Cluster/IClusterGroup.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Cluster/IClusterGroup.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Cluster/IClusterGroup.cs
index bb9adbf..31847c1 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Cluster/IClusterGroup.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Cluster/IClusterGroup.cs
@@ -142,6 +142,20 @@ namespace Apache.Ignite.Core.Cluster
         IClusterGroup ForRemotes();
 
         /// <summary>
+        /// Gets a cluster group consisting of the daemon nodes.
+        /// <para />
+        /// Daemon nodes are the usual grid nodes that participate in topology but not visible
on the main APIs, 
+        /// i.e. they are not part of any cluster group. The only way to see daemon nodes
is to use this method.
+        /// <para />
+        /// Daemon nodes are used primarily for management and monitoring functionality that
+        /// is build on Ignite and needs to participate in the topology, but also needs to
be
+        /// excluded from the "normal" topology, so that it won't participate in the task
execution
+        /// or in-memory data grid storage.
+        /// </summary>
+        /// <returns>Cluster group consisting of the daemon nodes.</returns>
+        IClusterGroup ForDaemons();
+
+        /// <summary>
         /// Gets grid projection consisting from the nodes in this projection residing on
the
         /// same host as given node.
         /// </summary>

http://git-wip-us.apache.org/repos/asf/ignite/blob/3a66596d/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Cluster/ClusterGroupImpl.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Cluster/ClusterGroupImpl.cs
b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Cluster/ClusterGroupImpl.cs
index 95497f3..dbb3cb3 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Cluster/ClusterGroupImpl.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Cluster/ClusterGroupImpl.cs
@@ -281,6 +281,12 @@ namespace Apache.Ignite.Core.Impl.Cluster
         }
 
         /** <inheritDoc /> */
+        public IClusterGroup ForDaemons()
+        {
+            return GetClusterGroup(UU.ProjectionForDaemons(Target));
+        }
+
+        /** <inheritDoc /> */
         public IClusterGroup ForHost(IClusterNode node)
         {
             IgniteArgumentCheck.NotNull(node, "node");

http://git-wip-us.apache.org/repos/asf/ignite/blob/3a66596d/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Ignite.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Ignite.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Ignite.cs
index d516056..0fac417 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Ignite.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Ignite.cs
@@ -273,6 +273,12 @@ namespace Apache.Ignite.Core.Impl
         }
 
         /** <inheritdoc /> */
+        public IClusterGroup ForDaemons()
+        {
+            return _prj.ForDaemons();
+        }
+
+        /** <inheritdoc /> */
         public IClusterGroup ForHost(IClusterNode node)
         {
             IgniteArgumentCheck.NotNull(node, "node");
@@ -482,7 +488,9 @@ namespace Apache.Ignite.Core.Impl
         /** <inheritdoc /> */
         public IClusterNode GetLocalNode()
         {
-            return _locNode ?? (_locNode = GetNodes().FirstOrDefault(x => x.IsLocal));
+            return _locNode ?? (_locNode =
+                       GetNodes().FirstOrDefault(x => x.IsLocal) ??
+                       ForDaemons().GetNodes().FirstOrDefault(x => x.IsLocal));
         }
 
         /** <inheritdoc /> */

http://git-wip-us.apache.org/repos/asf/ignite/blob/3a66596d/modules/platforms/dotnet/Apache.Ignite.Core/Impl/IgniteProxy.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/IgniteProxy.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/IgniteProxy.cs
index 949d31c..12de847 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/IgniteProxy.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/IgniteProxy.cs
@@ -161,6 +161,12 @@ namespace Apache.Ignite.Core.Impl
         }
 
         /** <inheritdoc /> */
+        public IClusterGroup ForDaemons()
+        {
+            return _ignite.GetCluster().ForDaemons();
+        }
+
+        /** <inheritdoc /> */
         public IClusterGroup ForHost(IClusterNode node)
         {
             return _ignite.GetCluster().ForHost(node);


Mime
View raw message