public class TcpDiscoveryNode extends GridMetadataAwareAdapter implements IgniteClusterNode, Comparable<TcpDiscoveryNode>, Externalizable
TcpDiscoverySpi.
This class is not intended for public use and has been made public due to certain limitations of Java technology.
GridMetadataAwareAdapter.EntryKey| Constructor and Description |
|---|
TcpDiscoveryNode()
Public default no-arg constructor for
Externalizable interface. |
TcpDiscoveryNode(ClusterNode node)
IMPORTANT!
|
TcpDiscoveryNode(UUID id,
Collection<String> addrs,
Collection<String> hostNames,
int discPort,
DiscoveryMetricsProvider metricsProvider,
IgniteProductVersion ver,
Serializable consistentId)
Constructor.
|
| 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.
|
void |
clientAliveTime(long aliveTime)
Set client alive time.
|
boolean |
clientAliveTimeSet() |
TcpDiscoveryNode |
clientReconnectNode(Map<String,Object> nodeAttrs) |
UUID |
clientRouterNodeId() |
void |
clientRouterNodeId(UUID clientRouterNodeId) |
int |
compareTo(@Nullable TcpDiscoveryNode node) |
Object |
consistentId()
Gets consistent globally unique node ID.
|
int |
discoveryPort() |
boolean |
equals(Object o) |
Map<String,Object> |
getAttributes()
Gets node attributes without filtering.
|
int |
hashCode() |
Collection<String> |
hostNames()
Gets collection of host names this node is known by.
|
UUID |
id()
Gets globally unique node ID.
|
long |
internalOrder() |
void |
internalOrder(long intOrder) |
boolean |
isClient()
Whether this node is cache client (see
IgniteConfiguration.isClientMode()). |
boolean |
isClientAlive()
Test alive check time value.
|
boolean |
isDaemon()
Tests whether or not this node is a daemon.
|
boolean |
isLocal()
Tests whether or not this node is a local node.
|
void |
lastExchangeTime(long lastExchangeTime,
long lastExchangeTimeNanos)
Sets the last time a node exchanged a message with a remote node.
|
long |
lastExchangeTimeNanos()
Gets the last time a node exchanged a message with a remote node.
|
@Nullable InetSocketAddress |
lastSuccessfulAddress() |
void |
lastSuccessfulAddress(InetSocketAddress lastSuccessfulAddr) |
long |
lastUpdateTime()
Gets node last update time.
|
long |
lastUpdateTimeNanos()
Gets node last update time.
|
void |
lastUpdateTimeNanos(long lastUpdateTimeNanos)
Sets node last update.
|
void |
local(boolean loc) |
ClusterMetrics |
metrics()
Gets metrics snapshot for this node.
|
void |
onClientDisconnected(UUID newId) |
long |
order()
Node order within grid topology.
|
void |
order(long order) |
void |
readExternal(ObjectInput in) |
void |
setAttributes(Map<String,Object> attrs)
Sets node attributes.
|
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.
|
Collection<InetSocketAddress> |
socketAddresses() |
String |
toString() |
IgniteProductVersion |
version()
Gets node version.
|
void |
version(IgniteProductVersion ver) |
boolean |
visible()
Gets visible flag.
|
void |
visible(boolean visible)
Sets visible flag.
|
void |
writeExternal(ObjectOutput out) |
addMeta, addMetaIfAbsent, addMetaIfAbsent, allMeta, clone, copyMeta, copyMeta, hasMeta, hasMeta, meta, putMetaIfAbsent, readExternalMeta, removeAllMeta, removeMeta, removeMeta, replaceMeta, writeExternalMetapublic TcpDiscoveryNode()
Externalizable interface.public TcpDiscoveryNode(UUID id, Collection<String> addrs, Collection<String> hostNames, int discPort, DiscoveryMetricsProvider metricsProvider, IgniteProductVersion ver, Serializable consistentId)
id - Node Id.addrs - Addresses.hostNames - Host names.discPort - Port.metricsProvider - Metrics provider.ver - Version.consistentId - Node consistent ID.public TcpDiscoveryNode(ClusterNode node)
node - to copy data from@Nullable public @Nullable InetSocketAddress lastSuccessfulAddress()
public void lastSuccessfulAddress(InetSocketAddress lastSuccessfulAddr)
lastSuccessfulAddr - Last successfully connected address.public UUID id()
id in interface ClusterNodepublic Object consistentId()
ClusterNode.id() method,
this method returns consistent node ID which survives node restarts.consistentId in interface BaselineNodeconsistentId in interface ClusterNodepublic void setConsistentId(Serializable consistentId)
setConsistentId in interface IgniteClusterNodeconsistentId - Consistent globally unique node ID.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.IgniteNodeAttributesNote that attributes cannot be changed at runtime.
attribute in interface BaselineNodeattribute in interface ClusterNodeT - Attribute Type.name - Attribute name. Note that attribute names starting with
org.apache.ignite are reserved for internal use.null.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.IgniteNodeAttributesNote that attributes cannot be changed at runtime.
attributes in interface BaselineNodeattributes in interface ClusterNodepublic void setAttributes(Map<String,Object> attrs)
attrs - Node attributes.public Map<String,Object> getAttributes()
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 ClusterNodepublic void setMetrics(ClusterMetrics metrics)
setMetrics in interface IgniteClusterNodemetrics - 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 IgniteClusterNodepublic void setCacheMetrics(Map<Integer,CacheMetrics> cacheMetrics)
setCacheMetrics in interface IgniteClusterNodecacheMetrics - Cache metrics.public long internalOrder()
public void internalOrder(long intOrder)
intOrder - Internal order of the node.public long order()
ClusterNodeNOTE: 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 ClusterNodepublic void order(long order)
order - Order of the node.public IgniteProductVersion version()
version in interface ClusterNodepublic void version(IgniteProductVersion ver)
ver - Version.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 ClusterNodepublic boolean isLocal()
isLocal in interface ClusterNodeTrue if this node is a local node, false otherwise.public void local(boolean loc)
loc - Grid local node flag.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 ClusterNodeTrue if this node is a daemon, false otherwise.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 ClusterNodepublic int discoveryPort()
public Collection<InetSocketAddress> socketAddresses()
public long lastUpdateTime()
nanoTime internal JVM time format into a regular timestamp.
This might lead to errors if there was GC between measuring of current timestamp and current nano time,
but generally it might be ignored.System.currentTimeMillis(),
System.nanoTime()public long lastUpdateTimeNanos()
System.nanoTime().public void lastUpdateTimeNanos(long lastUpdateTimeNanos)
lastUpdateTimeNanos - Time of last metrics update.public long lastExchangeTimeNanos()
System.nanoTime().public void lastExchangeTime(long lastExchangeTime,
long lastExchangeTimeNanos)
lastExchangeTime - Time in milliseconds.lastExchangeTimeNanos - Time in nanoseconds.public boolean visible()
true if node is in visible state.public void visible(boolean visible)
visible - true if node is in visible state.public boolean isClient()
IgniteConfiguration.isClientMode()).isClient in interface ClusterNodeTrue if client.IgniteConfiguration.isClientMode()public boolean isClientAlive()
True if client alive, False otherwise.public void clientAliveTime(long aliveTime)
aliveTime - Alive time interval.public boolean clientAliveTimeSet()
true if client alive check time initialized.public UUID clientRouterNodeId()
public void clientRouterNodeId(UUID clientRouterNodeId)
clientRouterNodeId - Client router node ID.public void onClientDisconnected(UUID newId)
newId - New node ID.public TcpDiscoveryNode clientReconnectNode(Map<String,Object> nodeAttrs)
nodeAttrs - Current node attributes.public int compareTo(@Nullable
@Nullable TcpDiscoveryNode node)
compareTo in interface Comparable<TcpDiscoveryNode>public void writeExternal(ObjectOutput out) throws IOException
writeExternal in interface ExternalizableIOExceptionpublic void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal in interface ExternalizableIOExceptionClassNotFoundException
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.9.0 Release Date : October 15 2020