use of org.apache.ignite.spi.discovery.tcp.internal.TcpDiscoveryNode in project ignite by apache.
the class ClientImpl method allVisibleNodes.
/**
* @return All nodes.
*/
private NavigableSet<ClusterNode> allVisibleNodes() {
NavigableSet<ClusterNode> allNodes = new TreeSet<>();
for (TcpDiscoveryNode node : rmtNodes.values()) {
if (node.visible())
allNodes.add(node);
}
allNodes.add(locNode);
return allNodes;
}
use of org.apache.ignite.spi.discovery.tcp.internal.TcpDiscoveryNode in project ignite by apache.
the class ClientImpl method failNode.
/** {@inheritDoc} */
@Override
public void failNode(UUID nodeId, @Nullable String warning) {
TcpDiscoveryNode node = rmtNodes.get(nodeId);
if (node != null) {
TcpDiscoveryNodeFailedMessage msg = new TcpDiscoveryNodeFailedMessage(getLocalNodeId(), node.id(), node.internalOrder());
msg.warning(warning);
msg.force(true);
msgWorker.addMessage(msg);
}
}
use of org.apache.ignite.spi.discovery.tcp.internal.TcpDiscoveryNode in project ignite by apache.
the class ServerImpl method failNode.
/** {@inheritDoc} */
@Override
public void failNode(UUID nodeId, @Nullable String warning) {
TcpDiscoveryNode node = ring.node(nodeId);
if (node != null) {
TcpDiscoveryNodeFailedMessage msg = new TcpDiscoveryNodeFailedMessage(getLocalNodeId(), node.id(), node.internalOrder());
msg.warning(warning);
msg.force(true);
msgWorker.addMessage(msg);
}
}
use of org.apache.ignite.spi.discovery.tcp.internal.TcpDiscoveryNode in project ignite by apache.
the class ServerImpl method getNode.
/** {@inheritDoc} */
@Nullable
@Override
public ClusterNode getNode(UUID nodeId) {
assert nodeId != null;
UUID locNodeId0 = getLocalNodeId();
if (locNodeId0 != null && locNodeId0.equals(nodeId))
// Return local node directly.
return locNode;
TcpDiscoveryNode node = ring.node(nodeId);
if (node != null && !node.visible())
return null;
return node;
}
use of org.apache.ignite.spi.discovery.tcp.internal.TcpDiscoveryNode in project ignite by apache.
the class ServerImpl method printStatistics.
/**
* Prints SPI statistics.
*/
private void printStatistics() {
if (log.isInfoEnabled() && spi.statsPrintFreq > 0) {
int failedNodesSize;
int leavingNodesSize;
int joiningNodesSize;
int pendingCustomMsgsSize;
synchronized (mux) {
failedNodesSize = failedNodes.size();
leavingNodesSize = leavingNodes.size();
joiningNodesSize = joiningNodes.size();
pendingCustomMsgsSize = pendingCustomMsgs.size();
}
Runtime runtime = Runtime.getRuntime();
TcpDiscoveryNode coord = resolveCoordinator();
log.info("Discovery SPI statistics [statistics=" + spi.stats + ", spiState=" + spiStateCopy() + ", coord=" + coord + ", next=" + (msgWorker != null ? msgWorker.next : "N/A") + ", intOrder=" + (locNode != null ? locNode.internalOrder() : "N/A") + ", topSize=" + ring.allNodes().size() + ", leavingNodesSize=" + leavingNodesSize + ", failedNodesSize=" + failedNodesSize + ", joiningNodesSize=" + joiningNodesSize + ", pendingCustomMsgs=" + pendingCustomMsgsSize + ", msgWorker.queue.size=" + (msgWorker != null ? msgWorker.queueSize() : "N/A") + ", clients=" + ring.clientNodes().size() + ", clientWorkers=" + clientMsgWorkers.size() + ", lastUpdate=" + (locNode != null ? U.format(locNode.lastUpdateTime()) : "N/A") + ", heapFree=" + runtime.freeMemory() / (1024 * 1024) + "M, heapTotal=" + runtime.maxMemory() / (1024 * 1024) + "M]");
}
}
Aggregations