public class TcpDiscoveryNode extends GridMetadataAwareAdapter implements ClusterNode, 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.
|
TcpDiscoveryNode |
clientReconnectNode(Map<String,Object> nodeAttrs) |
UUID |
clientRouterNodeId() |
void |
clientRouterNodeId(UUID clientRouterNodeId) |
int |
compareTo(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 |
isCacheClient()
Whether this node is cache client (see
IgniteConfiguration.isClientMode()). |
boolean |
isClient()
Tests whether or not this node is connected to cluster as a client.
|
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.
|
long |
lastExchangeTime()
Gets the last time a node exchanged a message with a remote node.
|
void |
lastExchangeTime(long lastExchangeTime)
Sets the last time a node exchanged a message with a remote node.
|
InetSocketAddress |
lastSuccessfulAddress() |
void |
lastSuccessfulAddress(InetSocketAddress lastSuccessfulAddr) |
long |
lastUpdateTime()
Gets node last update time.
|
void |
lastUpdateTime(long lastUpdateTime)
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 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)
consistentId - 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)
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.
public void setCacheMetrics(Map<Integer,CacheMetrics> cacheMetrics)
cacheMetrics - 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()
public void lastUpdateTime(long lastUpdateTime)
lastUpdateTime - Time of last metrics update.public long lastExchangeTime()
public void lastExchangeTime(long lastExchangeTime)
lastExchangeTime - Time in milliseconds.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()
Do not confuse client in terms of
discovery DiscoverySpi.isClientMode() and client in terms of cache
IgniteConfiguration.isClientMode(). Cache clients cannot carry data,
while topology clients connect to topology in a different way.
isClient in interface ClusterNodeTrue if this node is a client node, false otherwise.IgniteConfiguration.isClientMode(),
Ignition.isClientMode(),
DiscoverySpi.isClientMode()public boolean isClientAlive()
True if client alive, False otherwise.public void clientAliveTime(long aliveTime)
aliveTime - Alive time interval.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 boolean isCacheClient()
IgniteConfiguration.isClientMode()).True if client.public int compareTo(@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 Fabric : ver. 2.4.0 Release Date : March 5 2018