org.apache.ignite.internal.managers.discovery

## Class DiscoCache

- java.lang.Object
- - org.apache.ignite.internal.managers.discovery.DiscoCache

    public class DiscoCache
    extends Object

### Method Summary

All Methods Instance Methods Concrete Methods
`boolean` `alive(UUID nodeId)`
`@Nullable Collection<ClusterNode>` `aliveBaselineNodes()` Returns a collection of live baseline nodes.
`Collection<ClusterNode>` `aliveServerNodes()` Gets collection of server nodes with at least one cache configured.
`List<ClusterNode>` `allNodes()`
`boolean` `baselineNode(ClusterNode node)`
`boolean` `baselineNode(UUID nodeId)`
`@Nullable List<? extends BaselineNode>` `baselineNodes()` Returns a collection of baseline nodes.
`List<ClusterNode>` `cacheGroupAffinityNodes(int grpId)`
`List<ClusterNode>` `cacheNodes(Integer cacheId)` Gets all nodes that have cache with given ID.
`List<ClusterNode>` `cacheNodes(@Nullable String cacheName)` Gets all nodes that have cache with given name.
`<T> boolean` `checkAttribute(String name, T expVal)` Returns `True` if all nodes has the given attribute and its value equals to `expVal`.
`Map<UUID,Short>` `consistentIdMap()`
`DiscoCache` `copy(AffinityTopologyVersion ver, @Nullable DiscoveryDataClusterState state)`
`List<ClusterNode>` `daemonNodes()`
`ClusterNode` `localNode()`
`IgniteProductVersion` `minimumNodeVersion()`
`IgniteProductVersion` `minimumServerNodeVersion()`
`@Nullable ClusterNode` `node(UUID id)`
`Map<Short,UUID>` `nodeIdMap()`
`@Nullable ClusterNode` `oldestAliveServerNode()`
`@Nullable ClusterNode` `oldestServerNode()`
`Collection<ClusterNode>` `remoteAliveNodesWithCaches()` Gets all alive remote nodes that have at least one cache configured.
`List<ClusterNode>` `remoteNodes()`
`@Nullable ClusterNode` `serverNodeByOrder(long order)`
`List<ClusterNode>` `serverNodes()`
`DiscoveryDataClusterState` `state()`
`String` `toString()`
`void` `updateAlives(ClusterNode rmvd)` Removes left node from alives lists.
`void` `updateAlives(GridDiscoveryManager discovery)` Removes left nodes from cached alives lists.
`AffinityTopologyVersion` `version()`

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

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

### Method Detail

#### version

    public AffinityTopologyVersion version()

Returns:
  Topology version.

#### minimumNodeVersion

    public IgniteProductVersion minimumNodeVersion()

Returns:
  Minimum node version.

#### minimumServerNodeVersion

    public IgniteProductVersion minimumServerNodeVersion()

Returns:
  Minimum server node version.

#### state

    public DiscoveryDataClusterState state()

Returns:
  Current cluster state.

#### localNode

    public ClusterNode localNode()

Returns:
  Local node.

#### remoteNodes

    public List<ClusterNode> remoteNodes()

Returns:
  Remote nodes.

#### baselineNodes

    @Nullable
    public @Nullable List<? extends BaselineNode> baselineNodes()

Returns a collection of baseline nodes.

Returns:
  A collection of baseline nodes or `null` if baseline topology was not set.

#### baselineNode

    public boolean baselineNode(UUID nodeId)

Parameters:
  `nodeId` - Node ID to check.
Returns:
  `True` if baseline is not set or the node is in the baseline topology.

#### allNodes

    public List<ClusterNode> allNodes()

Returns:
  All nodes.

#### serverNodes

    public List<ClusterNode> serverNodes()

Returns:
  Server nodes.

#### daemonNodes

    public List<ClusterNode> daemonNodes()

Returns:
  Daemon nodes.

#### consistentIdMap

    public Map<UUID,Short> consistentIdMap()

Returns:
  Consistent id map UUID -> Short (compacted consistent id).

#### nodeIdMap

    public Map<Short,UUID> nodeIdMap()

Returns:
  Consistent id map Short (compacted consistent id) -> UUID.

#### remoteAliveNodesWithCaches

    public Collection<ClusterNode> remoteAliveNodesWithCaches()

Gets all alive remote nodes that have at least one cache configured.

Returns:
  Collection of nodes.

#### aliveServerNodes

    public Collection<ClusterNode> aliveServerNodes()

Gets collection of server nodes with at least one cache configured.

Returns:
  Collection of nodes.

#### aliveBaselineNodes

    @Nullable
    public @Nullable Collection<ClusterNode> aliveBaselineNodes()

Returns a collection of live baseline nodes.

Returns:
  A view of baseline nodes that are currently present in the cluster or `null` if baseline topology was not set.

#### baselineNode

    public boolean baselineNode(ClusterNode node)

Parameters:
  `node` - Node to check.
Returns:
  `True` if the node is in baseline or if baseline is not set.

#### oldestAliveServerNode

    @Nullable
    public @Nullable ClusterNode oldestAliveServerNode()

Returns:
  Oldest alive server node.

#### oldestServerNode

    @Nullable
    public @Nullable ClusterNode oldestServerNode()

Returns:
  Oldest server node.

#### alive

    public boolean alive(UUID nodeId)

Parameters:
  `nodeId` - Node ID.
Returns:
  `True` if node is in alives list.

#### cacheNodes

    public List<ClusterNode> cacheNodes(@Nullable
                                        @Nullable String cacheName)

Gets all nodes that have cache with given name.

Parameters:
  `cacheName` - Cache name.
Returns:
  Collection of nodes.

#### cacheNodes

    public List<ClusterNode> cacheNodes(Integer cacheId)

Gets all nodes that have cache with given ID.

Parameters:
  `cacheId` - Cache ID.
Returns:
  Collection of nodes.

#### cacheGroupAffinityNodes

    public List<ClusterNode> cacheGroupAffinityNodes(int grpId)

Parameters:
  `grpId` - Cache group ID.
Returns:
  All nodes that participate in affinity calculation.

#### node

    @Nullable
    public @Nullable ClusterNode node(UUID id)

Parameters:
  `id` - Node ID.
Returns:
  Node.

#### updateAlives

    public void updateAlives(ClusterNode rmvd)

Removes left node from alives lists.

Parameters:
  `rmvd` - Removed node.

#### updateAlives

    public void updateAlives(GridDiscoveryManager discovery)

Removes left nodes from cached alives lists.

Parameters:
  `discovery` - Discovery manager.

#### serverNodeByOrder

    @Nullable
    public @Nullable ClusterNode serverNodeByOrder(long order)

Parameters:
  `order` - Order.
Returns:
  Server node instance.

#### checkAttribute

    public <T> boolean checkAttribute(String name,
                                      T expVal)

Returns `True` if all nodes has the given attribute and its value equals to `expVal`.

Type Parameters:
  `T` - Attribute Type.
Parameters:
  `name` - Attribute name.
  `expVal` - Expected value.
Returns:
  `True` if all the given nodes has the given attribute and its value equals to `expVal`.

#### copy

    public DiscoCache copy(AffinityTopologyVersion ver,
                           @Nullable
                           @Nullable DiscoveryDataClusterState state)

Parameters:
  `ver` - Topology version.
  `state` - Not `null` state if need override state, otherwise current state is used.
Returns:
  Copy of discovery cache with new version.

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`

${current.year} Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Database and Caching Platform | : ver. 2.14.0
Release Date | : September 29 2022