public class IsolatedNode extends Object implements org.apache.ignite.internal.managers.discovery.IgniteClusterNode
Constructor and Description |
---|
IsolatedNode(UUID id,
Map<String,Object> attrs,
IgniteProductVersion ver) |
Modifier and Type | Method and Description |
---|---|
Collection<String> |
addresses()
Gets collection of addresses this node is known by.
|
<T> T |
attribute(String name)
Gets a node attribute.
|
Map<String,Object> |
attributes()
Gets all node attributes.
|
Map<Integer,CacheMetrics> |
cacheMetrics()
Gets collections of cache metrics for this node.
|
Object |
consistentId()
Gets consistent globally unique node ID.
|
Collection<String> |
hostNames()
Gets collection of host names this node is known by.
|
UUID |
id()
Gets globally unique node ID.
|
boolean |
isClient()
Whether this node is cache client (see
IgniteConfiguration.isClientMode() ). |
boolean |
isDaemon()
Tests whether or not this node is a daemon.
|
boolean |
isLocal()
Tests whether or not this node is a local node.
|
ClusterMetrics |
metrics()
Gets metrics snapshot for this node.
|
long |
order()
Node order within grid topology.
|
void |
setAttributes(Map<String,Object> attrs) |
void |
setCacheMetrics(Map<Integer,CacheMetrics> cacheMetrics)
Sets node cache metrics.
|
void |
setConsistentId(Serializable consistentId)
Sets consistent globally unique node ID which survives node restarts.
|
void |
setMetrics(ClusterMetrics metrics)
Sets node metrics.
|
IgniteProductVersion |
version()
Gets node version.
|
public IsolatedNode(UUID id, Map<String,Object> attrs, IgniteProductVersion ver)
id
- Node ID.attrs
- Node attributes.ver
- Node version.public UUID id()
id
in interface ClusterNode
public Object consistentId()
ClusterNode.id()
method,
this method returns consistent node ID which survives node restarts.consistentId
in interface BaselineNode
consistentId
in interface ClusterNode
public <T> T attribute(String name)
IgniteConfiguration.getUserAttributes()
method.
The system adds the following attributes automatically:
{@link System#getProperties()}
- All system properties.{@link System#getenv(String)}
- All environment properties.IgniteNodeAttributes
Note that attributes cannot be changed at runtime.
attribute
in interface BaselineNode
attribute
in interface ClusterNode
T
- Attribute Type.name
- Attribute name. Note that attribute names starting with
org.apache.ignite
are reserved for internal use.null
if such an attribute does not exist.public ClusterMetrics metrics()
ClusterMetrics.getCurrentCpuLoad()
method and use it during ComputeTask.map(List, Object)
or during collision
resolution.
Node metrics are updated with some delay which is controlled by
IgniteConfiguration.getMetricsUpdateFrequency()
parameter.
By default the update will happen every 2
seconds.
metrics
in interface ClusterNode
public Map<String,Object> attributes()
IgniteConfiguration.getUserAttributes()
method.
The system adds the following attributes automatically:
{@link System#getProperties()}
- All system properties.{@link System#getenv(String)}
- All environment properties.IgniteNodeAttributes
Note that attributes cannot be changed at runtime.
attributes
in interface BaselineNode
attributes
in interface ClusterNode
public Collection<String> addresses()
If IgniteConfiguration.getLocalHost()
value isn't null
node will try to use that
address for all communications and returned collection will contain only that address.
If it is null
then local wildcard address will be used, and Ignite
will make the best effort to supply all addresses of that node in returned collection.
addresses
in interface ClusterNode
public Collection<String> hostNames()
If IgniteConfiguration.getLocalHost()
value isn't null
node will try to use
the host name of that resolved address for all communications and
returned collection will contain only that host name.
If that host name can not be resolved then ip address returned by method ClusterNode.addresses()
is used.
If IgniteConfiguration.getLocalHost()
value is null
then local wildcard address will be used,
and this method returns host names of all addresses of that node.
Note: the loopback address will be omitted in results.
hostNames
in interface ClusterNode
public long order()
NOTE: in cases when discovery SPI doesn't support ordering Ignite cannot guarantee that orders on all nodes will be unique or chronologically correct. If such guarantee is required - make sure use discovery SPI that provides ordering.
order
in interface ClusterNode
public IgniteProductVersion version()
version
in interface ClusterNode
public boolean isLocal()
isLocal
in interface ClusterNode
True
if this node is a local node, false
otherwise.public boolean isDaemon()
Daemon nodes are the usual cluster nodes that participate in topology but are 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 ClusterGroup.forDaemons()
method.
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 the "normal" topology, so that they won't participate in the task execution or data grid operations.
Application code should never use daemon nodes.
isDaemon
in interface ClusterNode
True
if this node is a daemon, false
otherwise.public boolean isClient()
IgniteConfiguration.isClientMode()
).isClient
in interface ClusterNode
True if client
.IgniteConfiguration.isClientMode()
public void setConsistentId(Serializable consistentId)
setConsistentId
in interface org.apache.ignite.internal.managers.discovery.IgniteClusterNode
consistentId
- Consistent globally unique node ID.public void setMetrics(ClusterMetrics metrics)
setMetrics
in interface org.apache.ignite.internal.managers.discovery.IgniteClusterNode
metrics
- Node metrics.public Map<Integer,CacheMetrics> cacheMetrics()
Cache metrics are updated with some delay which is directly related to metrics update
frequency. For example, by default the update will happen every 2
seconds.
cacheMetrics
in interface org.apache.ignite.internal.managers.discovery.IgniteClusterNode
public void setCacheMetrics(Map<Integer,CacheMetrics> cacheMetrics)
setCacheMetrics
in interface org.apache.ignite.internal.managers.discovery.IgniteClusterNode
cacheMetrics
- Cache metrics.
GridGain In-Memory Computing Platform : ver. 8.9.14 Release Date : November 5 2024