Return-Path: X-Original-To: apmail-ignite-commits-archive@minotaur.apache.org Delivered-To: apmail-ignite-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id DFCDC10D0C for ; Tue, 20 Oct 2015 12:55:46 +0000 (UTC) Received: (qmail 30180 invoked by uid 500); 20 Oct 2015 12:55:46 -0000 Delivered-To: apmail-ignite-commits-archive@ignite.apache.org Received: (qmail 30146 invoked by uid 500); 20 Oct 2015 12:55:46 -0000 Mailing-List: contact commits-help@ignite.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ignite.apache.org Delivered-To: mailing list commits@ignite.apache.org Received: (qmail 30137 invoked by uid 99); 20 Oct 2015 12:55:46 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 20 Oct 2015 12:55:46 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 95D78DFBD6; Tue, 20 Oct 2015 12:55:46 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: vozerov@apache.org To: commits@ignite.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: ignite git commit: IGNITE-1480: Added "IsClient" flag to IClusterNode interface. Date: Tue, 20 Oct 2015 12:55:46 +0000 (UTC) Repository: ignite Updated Branches: refs/heads/ignite-1282 91eeab7ac -> 9879bed80 IGNITE-1480: Added "IsClient" flag to IClusterNode interface. Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/9879bed8 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/9879bed8 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/9879bed8 Branch: refs/heads/ignite-1282 Commit: 9879bed8026d2ac181d146e537de4ae407951fb5 Parents: 91eeab7 Author: Pavel Tupitsyn Authored: Tue Oct 20 15:54:41 2015 +0300 Committer: thatcoach Committed: Tue Oct 20 15:54:41 2015 +0300 ---------------------------------------------------------------------- .../platform/PlatformContextImpl.java | 1 + .../IgniteStartStopTest.cs | 6 ++- .../Apache.Ignite.Core/Cluster/IClusterNode.cs | 11 +++++ .../Impl/Cluster/ClusterNodeImpl.cs | 45 +++++++++----------- 4 files changed, 37 insertions(+), 26 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/9879bed8/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/PlatformContextImpl.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/PlatformContextImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/PlatformContextImpl.java index 3895506..0999f6a 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/PlatformContextImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/PlatformContextImpl.java @@ -221,6 +221,7 @@ public class PlatformContextImpl implements PlatformContext { w.writeLong(node.order()); w.writeBoolean(node.isLocal()); w.writeBoolean(node.isDaemon()); + w.writeBoolean(node.isClient()); writeClusterMetrics(w, node.metrics()); out.synchronize(); http://git-wip-us.apache.org/repos/asf/ignite/blob/9879bed8/modules/platforms/dotnet/Apache.Ignite.Core.Tests/IgniteStartStopTest.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/IgniteStartStopTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/IgniteStartStopTest.cs index d16063f..d302046 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/IgniteStartStopTest.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/IgniteStartStopTest.cs @@ -311,12 +311,16 @@ namespace Apache.Ignite.Core.Tests try { - using (Ignition.Start(servCfg)) // start server-mode ignite first + using (var serv = Ignition.Start(servCfg)) // start server-mode ignite first { + Assert.IsFalse(serv.GetCluster().GetLocalNode().IsClient); + Ignition.ClientMode = true; using (var grid = Ignition.Start(clientCfg)) { + Assert.IsTrue(grid.GetCluster().GetLocalNode().IsClient); + UseIgnite(grid); } } http://git-wip-us.apache.org/repos/asf/ignite/blob/9879bed8/modules/platforms/dotnet/Apache.Ignite.Core/Cluster/IClusterNode.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Cluster/IClusterNode.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Cluster/IClusterNode.cs index 8287821..ccb0e03 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Cluster/IClusterNode.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Cluster/IClusterNode.cs @@ -109,6 +109,17 @@ namespace Apache.Ignite.Core.Cluster bool IsDaemon { get; } /// + /// Gets a value indicating whether or not this node is connected to cluster as a client. + /// + /// Do not confuse client in terms of discovery and client in terms of cache. + /// Cache clients cannot carry data, while topology clients connect to the topology in a different way. + /// + /// + /// true if this node is a client node, false otherwise.. + /// + bool IsClient { get; } + + /// /// Gets metrics snapshot for this node. Note that node metrics are constantly updated /// and provide up to date information about nodes. For example, you can get /// an idea about CPU load on remote node via . http://git-wip-us.apache.org/repos/asf/ignite/blob/9879bed8/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Cluster/ClusterNodeImpl.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Cluster/ClusterNodeImpl.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Cluster/ClusterNodeImpl.cs index 1b6358a..1913cef 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Cluster/ClusterNodeImpl.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Cluster/ClusterNodeImpl.cs @@ -46,10 +46,13 @@ namespace Apache.Ignite.Core.Impl.Cluster private readonly long _order; /** Local flag. */ - private readonly bool _local; + private readonly bool _isLocal; /** Daemon flag. */ - private readonly bool _daemon; + private readonly bool _isDaemon; + + /** Client flag. */ + private readonly bool _isClient; /** Metrics. */ private volatile ClusterMetricsImpl _metrics; @@ -73,8 +76,9 @@ namespace Apache.Ignite.Core.Impl.Cluster _addrs = reader.ReadGenericCollection().AsReadOnly(); _hosts = reader.ReadGenericCollection().AsReadOnly(); _order = reader.ReadLong(); - _local = reader.ReadBoolean(); - _daemon = reader.ReadBoolean(); + _isLocal = reader.ReadBoolean(); + _isDaemon = reader.ReadBoolean(); + _isClient = reader.ReadBoolean(); _metrics = reader.ReadBoolean() ? new ClusterMetricsImpl(reader) : null; } @@ -120,46 +124,31 @@ namespace Apache.Ignite.Core.Impl.Cluster /** */ public ICollection Addresses { - get - { - return _addrs; - } + get { return _addrs; } } /** */ public ICollection HostNames { - get - { - return _hosts; - } + get { return _hosts; } } /** */ public long Order { - get - { - return _order; - } + get { return _order; } } /** */ public bool IsLocal { - get - { - return _local; - } + get { return _isLocal; } } /** */ public bool IsDaemon { - get - { - return _daemon; - } + get { return _isDaemon; } } /** */ @@ -189,7 +178,13 @@ namespace Apache.Ignite.Core.Impl.Cluster return oldMetrics; } - + + /** */ + public bool IsClient + { + get { return _isClient; } + } + /** */ public override string ToString() {