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() |
TcpDiscoveryNode |
coordinator()
Finds coordinator in the topology.
|
TcpDiscoveryNode |
coordinator(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() |
TcpDiscoveryNode |
nextNode()
Finds next node in the topology.
|
TcpDiscoveryNode |
nextNode(Collection<TcpDiscoveryNode> excluded)
Finds next node in the topology filtering excluded nodes from search.
|
long |
nextNodeOrder()
Increments topology version and gets new value.
|
TcpDiscoveryNode |
node(UUID nodeId)
Finds node by ID.
|
Collection<TcpDiscoveryNode> |
remoteNodes()
Gets remote nodes.
|
TcpDiscoveryNode |
removeNode(UUID nodeId)
Removes node from the topology.
|
void |
restoreTopology(Iterable<TcpDiscoveryNode> nodes,
long topVer)
Restores topology from parameters values.
|
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 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 TcpDiscoveryNode node(UUID nodeId)
nodeId - Node id to find.null if not found.@Nullable public 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 TcpDiscoveryNode coordinator()
@Nullable public TcpDiscoveryNode coordinator(@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 TcpDiscoveryNode nextNode()
@Nullable public TcpDiscoveryNode nextNode(@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 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 Fabric : ver. 2.4.0 Release Date : March 5 2018