public class TcpDiscoveryNodesRing extends Object
TcpDiscoverySpi| Modifier and Type | Field and Description |
|---|---|
static IgnitePredicate<TcpDiscoveryNode> |
VISIBLE_NODES
Visible nodes filter.
|
| Constructor and Description |
|---|
TcpDiscoveryNodesRing() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(TcpDiscoveryNode node)
Adds node to topology, also initializes node last update time with current
system time.
|
Collection<TcpDiscoveryNode> |
allNodes()
Gets all nodes in the topology.
|
void |
clear()
Removes all remote nodes, leaves only local node.
|
Collection<TcpDiscoveryNode> |
clientNodes() |
@Nullable TcpDiscoveryNode |
coordinator()
Finds coordinator in the topology.
|
@Nullable TcpDiscoveryNode |
coordinator(@Nullable Collection<TcpDiscoveryNode> excluded)
Finds coordinator in the topology filtering excluded nodes from the search.
|
boolean |
hasRemoteNodes()
Checks whether the topology has remote nodes in.
|
boolean |
hasRemoteServerNodes()
Checks whether the topology has remote server nodes in.
|
long |
incrementTopologyVersion()
Increments topology version and gets new value.
|
void |
localNode(TcpDiscoveryNode locNode)
Sets local node.
|
long |
maxInternalOrder() |
IgniteProductVersion |
minimumNodeVersion() |
@Nullable TcpDiscoveryNode |
nextNode()
Finds next node in the topology.
|
@Nullable TcpDiscoveryNode |
nextNode(@Nullable Collection<TcpDiscoveryNode> excluded)
Finds next node in the topology filtering excluded nodes from search.
|
long |
nextNodeOrder()
Increments topology version and gets new value.
|
@Nullable TcpDiscoveryNode |
node(UUID nodeId)
Finds node by ID.
|
@Nullable TcpDiscoveryNode |
previousNode(@Nullable Collection<TcpDiscoveryNode> excluded)
Finds previous node in the topology filtering excluded nodes from search.
|
TcpDiscoveryNode |
previousNodeOf(TcpDiscoveryNode ringNode) |
Collection<TcpDiscoveryNode> |
remoteNodes()
Gets remote nodes.
|
@Nullable TcpDiscoveryNode |
removeNode(UUID nodeId)
Removes node from the topology.
|
void |
restoreTopology(Iterable<TcpDiscoveryNode> nodes,
long topVer)
Restores topology from parameters values.
|
Collection<TcpDiscoveryNode> |
serverNodes() |
long |
topologyVersion()
Gets current topology version.
|
boolean |
topologyVersion(long topVer)
Sets new topology version.
|
String |
toString() |
Collection<TcpDiscoveryNode> |
visibleNodes()
Gets visible nodes in the topology.
|
Collection<TcpDiscoveryNode> |
visibleRemoteNodes()
Gets visible remote nodes in the topology.
|
public static final IgnitePredicate<TcpDiscoveryNode> VISIBLE_NODES
public IgniteProductVersion minimumNodeVersion()
public void localNode(TcpDiscoveryNode locNode)
locNode - Local node.public Collection<TcpDiscoveryNode> allNodes()
public Collection<TcpDiscoveryNode> visibleNodes()
public Collection<TcpDiscoveryNode> remoteNodes()
public Collection<TcpDiscoveryNode> visibleRemoteNodes()
public Collection<TcpDiscoveryNode> clientNodes()
public Collection<TcpDiscoveryNode> serverNodes()
public boolean hasRemoteNodes()
true if the topology has remote nodes in.public boolean hasRemoteServerNodes()
true if the topology has remote server nodes in.public boolean add(TcpDiscoveryNode node)
node - Node to add.true if such node was added and did not present previously in the topology.public long maxInternalOrder()
public void restoreTopology(Iterable<TcpDiscoveryNode> nodes, long topVer)
This method is called when new node receives topology from coordinator. In this case all nodes received are remote for local.
Also initializes nodes last update time with current system time.
nodes - List of remote nodes.topVer - Topology version.@Nullable public @Nullable TcpDiscoveryNode node(UUID nodeId)
nodeId - Node id to find.null if not found.@Nullable public @Nullable TcpDiscoveryNode removeNode(UUID nodeId)
nodeId - ID of the node to remove.true if node was removed.public void clear()
This should be called when SPI should be disconnected from topology and reconnected back after.
@Nullable public @Nullable TcpDiscoveryNode coordinator()
@Nullable public @Nullable TcpDiscoveryNode coordinator(@Nullable @Nullable Collection<TcpDiscoveryNode> excluded)
This may be used when handling current coordinator leave or failure.
excluded - Nodes to exclude from the search (optional).null if all nodes are excluded.@Nullable public @Nullable TcpDiscoveryNode nextNode()
@Nullable public @Nullable TcpDiscoveryNode nextNode(@Nullable @Nullable Collection<TcpDiscoveryNode> excluded)
This may be used when detecting and handling nodes failure.
excluded - Nodes to exclude from the search (optional). If provided,
cannot contain local node.null if all nodes were filtered out or
topology contains less than two nodes.@Nullable public @Nullable TcpDiscoveryNode previousNode(@Nullable @Nullable Collection<TcpDiscoveryNode> excluded)
This may be used when detecting and handling nodes failure.
excluded - Nodes to exclude from the search (optional). If provided,
cannot contain local node.null if all nodes were filtered out or
topology contains less than two nodes.public TcpDiscoveryNode previousNodeOf(TcpDiscoveryNode ringNode)
ringNode - Node for which to find a predecessor.IllegalArgumentException - If the given node was not found in the ring.public long topologyVersion()
public boolean topologyVersion(long topVer)
topVer - New topology version (should be greater than current, otherwise no-op).True if topology has been changed.public long incrementTopologyVersion()
public long nextNodeOrder()
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.11.0 Release Date : September 11 2021