Interface IClusterNode
Interface representing a single cluster node. Use GetAttribute<T>(String) or GetMetrics() to get static and dynamic information about remote nodes. You can get a list of all nodes in grid by calling GetNodes() on IIgnite instance.
You can use Ignite node attributes to provide static information about a node. This information is initialized once within grid, during node startup, and remains the same throughout the lifetime of a node.
All members are thread-safe and may be used concurrently from multiple threads.
Namespace: Apache.Ignite.Core.Cluster
Assembly: Apache.Ignite.Core.dll
Syntax
public interface IClusterNode : IBaselineNode
Properties
Addresses
Collection of addresses this node is known by.
Declaration
ICollection<string> Addresses { get; }
Property Value
Type | Description |
---|---|
ICollection<System.String> | Collection of addresses. |
HostNames
Collection of host names this node is known by.
Declaration
ICollection<string> HostNames { get; }
Property Value
Type | Description |
---|---|
ICollection<System.String> | Collection of host names. |
Id
Globally unique node ID. A new ID is generated every time a node restarts.
Declaration
Guid Id { get; }
Property Value
Type | Description |
---|---|
Guid |
IsClient
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.
Declaration
bool IsClient { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
IsDaemon
Tests whether or not this node is a daemon.
Daemon nodes are the usual Ignite nodes that participate in topology but not visible on the main APIs, i.e. they are not part of any projections.
Daemon nodes are used primarily for management and monitoring functionality that is build on Ignite and needs to participate in the topology but should be excluded from "normal" topology so that it won't participate in task execution or in-memory database.
Application code should never use daemon nodes.
Declaration
bool IsDaemon { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
IsLocal
Tests whether or not this node is a local node.
Declaration
bool IsLocal { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Order
Node order within grid topology. Discovery SPIs that support node ordering will assign a proper order to each node and will guarantee that discovery event notifications for new nodes will come in proper order. All other SPIs not supporting ordering may choose to return node startup time here.
Declaration
long Order { get; }
Property Value
Type | Description |
---|---|
System.Int64 |
Version
Gets an Ignite node version.
Declaration
IgniteProductVersion Version { get; }
Property Value
Type | Description |
---|---|
IgniteProductVersion |
Methods
GetAttribute<T>(String)
Gets node's attribute. Attributes are assigned to nodes at startup.
Note that attributes cannot be changed at runtime.
Declaration
T GetAttribute<T>(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Attribute name. |
Returns
Type | Description |
---|---|
T | Attribute value. |
Type Parameters
Name | Description |
---|---|
T |
GetAttributes()
Gets all node attributes. Attributes are assigned to nodes at startup.
Note that attributes cannot be changed at runtime.
Declaration
IDictionary<string, object> GetAttributes()
Returns
Type | Description |
---|---|
IDictionary<System.String, System.Object> | All node attributes. |
GetMetrics()
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 CurrentCpuLoad.
Node metrics are updated with some delay which is directly related to heartbeat
frequency. For example, when used with default GridTcpDiscoverySpi
the
update will happen every 2
seconds.
Declaration
IClusterMetrics GetMetrics()
Returns
Type | Description |
---|---|
IClusterMetrics | Runtime metrics snapshot for this node. |
TryGetAttribute<T>(String, out T)
Try getting node's attribute. Attributes are assigned to nodes at startup.
Note that attributes cannot be changed at runtime.
Declaration
bool TryGetAttribute<T>(string name, out T attr)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Attribute name. |
T | attr | Attribute value. |
Returns
Type | Description |
---|---|
System.Boolean |
|
Type Parameters
Name | Description |
---|---|
T |