Package org.apache.ignite.spi.discovery.isolated

## Class IsolatedNode

- java.lang.Object
- - org.apache.ignite.spi.discovery.isolated.IsolatedNode

- All Implemented Interfaces:
    `BaselineNode`, `ClusterNode`, `org.apache.ignite.internal.managers.discovery.IgniteClusterNode`

      public class IsolatedNode
      extends Object
      implements org.apache.ignite.internal.managers.discovery.IgniteClusterNode

  Special isolated node.

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `IsolatedNode​(UUID id, Map<String,​Object> attrs, IgniteProductVersion ver)` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | 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` | `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.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface org.apache.ignite.cluster.ClusterNode

      `dataCenterId`

- - ### Constructor Detail

    - #### IsolatedNode

          public IsolatedNode​(UUID id,
                              Map<String,​Object> attrs,
                              IgniteProductVersion ver)

      Parameters:
        `id` - Node ID.
        `attrs` - Node attributes.
        `ver` - Node version.

  - ### Method Detail

    - #### id

          public UUID id()

      Gets globally unique node ID. A new ID is generated every time a node restarts.
      Specified by:
        `id` in interface `ClusterNode`
      Returns:
        Globally unique node ID.

    - #### consistentId

          public Object consistentId()

      Gets consistent globally unique node ID. Unlike `ClusterNode.id()` method, this method returns consistent node ID which survives node restarts.
      Specified by:
        `consistentId` in interface `BaselineNode`
      Specified by:
        `consistentId` in interface `ClusterNode`
      Returns:
        Consistent globally unique node ID.

    - #### attribute

          public <T> T attribute​(String name)

      Gets a node attribute. Attributes are assigned to nodes at startup via `IgniteConfiguration.getUserAttributes()` method.

      The system adds the following attributes automatically:

      - `{@link System#getProperties()}` - All system properties.
      - `{@link System#getenv(String)}` - All environment properties.
      - All attributes defined in `IgniteNodeAttributes`

      Note that attributes cannot be changed at runtime.

      Specified by:
        `attribute` in interface `BaselineNode`
      Specified by:
        `attribute` in interface `ClusterNode`
      Type Parameters:
        `T` - Attribute Type.
      Parameters:
        `name` - Attribute name. Note that attribute names starting with `org.apache.ignite` are reserved for internal use.
      Returns:
        Attribute value or `null`.

    - #### metrics

          public ClusterMetrics metrics()

      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 `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.

      Specified by:
        `metrics` in interface `ClusterNode`
      Returns:
        Runtime metrics snapshot for this node.

    - #### attributes

          public Map<String,​Object> attributes()

      Gets all node attributes. Attributes are assigned to nodes at startup via `IgniteConfiguration.getUserAttributes()` method.

      The system adds the following attributes automatically:

      - `{@link System#getProperties()}` - All system properties.
      - `{@link System#getenv(String)}` - All environment properties.
      - All attributes defined in `IgniteNodeAttributes`

      Note that attributes cannot be changed at runtime.

      Specified by:
        `attributes` in interface `BaselineNode`
      Specified by:
        `attributes` in interface `ClusterNode`
      Returns:
        All node attributes.

    - #### addresses

          public Collection<String> addresses()

      Gets collection of addresses this node is known by.

      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.

      Specified by:
        `addresses` in interface `ClusterNode`
      Returns:
        Collection of addresses.

    - #### hostNames

          public Collection<String> hostNames()

      Gets collection of host names this node is known by.

      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.

      Specified by:
        `hostNames` in interface `ClusterNode`
      Returns:
        Collection of host names.

    - #### order

          public long 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.

      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.

      Specified by:
        `order` in interface `ClusterNode`
      Returns:
        Node startup order.

    - #### version

          public IgniteProductVersion version()

      Gets node version.
      Specified by:
        `version` in interface `ClusterNode`
      Returns:
        Node version.

    - #### isLocal

          public boolean isLocal()

      Tests whether or not this node is a local node.
      Specified by:
        `isLocal` in interface `ClusterNode`
      Returns:
        `True` if this node is a local node, `false` otherwise.

    - #### isClient

          public boolean isClient()

      Whether this node is cache client (see `IgniteConfiguration.isClientMode()`).
      Specified by:
        `isClient` in interface `ClusterNode`
      Returns:
        `True if client`.
      See Also:
        `IgniteConfiguration.isClientMode()`

    - #### setConsistentId

          public void setConsistentId​(Serializable consistentId)

      Sets consistent globally unique node ID which survives node restarts.
      Specified by:
        `setConsistentId` in interface `org.apache.ignite.internal.managers.discovery.IgniteClusterNode`
      Parameters:
        `consistentId` - Consistent globally unique node ID.

    - #### setMetrics

          public void setMetrics​(ClusterMetrics metrics)

      Sets node metrics.
      Specified by:
        `setMetrics` in interface `org.apache.ignite.internal.managers.discovery.IgniteClusterNode`
      Parameters:
        `metrics` - Node metrics.

    - #### cacheMetrics

          public Map<Integer,​CacheMetrics> cacheMetrics()

      Gets collections of cache metrics for this node. Note that node cache metrics are constantly updated and provide up to date information about caches.

      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.

      Specified by:
        `cacheMetrics` in interface `org.apache.ignite.internal.managers.discovery.IgniteClusterNode`
      Returns:
        Runtime metrics snapshots for this node.

    - #### setCacheMetrics

          public void setCacheMetrics​(Map<Integer,​CacheMetrics> cacheMetrics)

      Sets node cache metrics.
      Specified by:
        `setCacheMetrics` in interface `org.apache.ignite.internal.managers.discovery.IgniteClusterNode`
      Parameters:
        `cacheMetrics` - Cache metrics.

    - #### setAttributes

          public void setAttributes​(Map<String,​Object> attrs)

      Parameters:
        `attrs` - Local node attributes.