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.
| Constructor and Description |
|---|
TcpDiscoveryNode()
Public default no-arg constructor for
Externalizable interface. |
TcpDiscoveryNode(UUID id,
Collection<String> addrs,
Collection<String> hostNames,
int discPort,
DiscoveryMetricsProvider metricsProvider,
IgniteProductVersion ver)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
Collection<String> |
addresses()
Gets collection of addresses this node is known by.
|
void |
aliveCheck(int aliveCheck) |
<T> T |
attribute(String name)
Gets a node attribute.
|
Map<String,Object> |
attributes()
Gets all node attributes.
|
UUID |
clientRouterNodeId() |
void |
clientRouterNodeId(UUID clientRouterNodeId) |
int |
compareTo(TcpDiscoveryNode node) |
Object |
consistentId()
Gets consistent globally unique node ID.
|
int |
decrementAliveCheck()
Decrements alive check value and returns new one.
|
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()
Tests whether or not this node is a client node.
|
boolean |
isDaemon()
Tests whether or not this node is a daemon.
|
boolean |
isLocal()
Tests whether or not this node is a local node.
|
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.
|
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 |
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, removeMeta, removeMeta, replaceMeta, writeExternalMetapublic TcpDiscoveryNode()
Externalizable interface.public TcpDiscoveryNode(UUID id, Collection<String> addrs, Collection<String> hostNames, int discPort, DiscoveryMetricsProvider metricsProvider, IgniteProductVersion ver)
id - Node Id.addrs - Addresses.hostNames - Host names.discPort - Port.metricsProvider - Metrics provider.ver - Version.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 ClusterNodepublic <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 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 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 directly related to heartbeat
frequency. For example, when used with default
TcpDiscoverySpi the update will happen every 2 seconds.
metrics in interface ClusterNodepublic void setMetrics(ClusterMetrics metrics)
metrics - Node 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.
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 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()
isClient in interface ClusterNodeTrue if this node is a client node, false otherwise.public int decrementAliveCheck()
public void aliveCheck(int aliveCheck)
aliveCheck - Alive check value.public UUID clientRouterNodeId()
public void clientRouterNodeId(UUID clientRouterNodeId)
clientRouterNodeId - Client router node ID.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. 1.0.0 Release Date : March 31 2015