Search in sources :

Example 1 with TcpDiscoveryNodeFailedMessage

use of org.apache.ignite.spi.discovery.tcp.messages.TcpDiscoveryNodeFailedMessage 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);
    }
}
Also used : TcpDiscoveryNodeFailedMessage(org.apache.ignite.spi.discovery.tcp.messages.TcpDiscoveryNodeFailedMessage) TcpDiscoveryNode(org.apache.ignite.spi.discovery.tcp.internal.TcpDiscoveryNode)

Example 2 with TcpDiscoveryNodeFailedMessage

use of org.apache.ignite.spi.discovery.tcp.messages.TcpDiscoveryNodeFailedMessage 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);
    }
}
Also used : TcpDiscoveryNodeFailedMessage(org.apache.ignite.spi.discovery.tcp.messages.TcpDiscoveryNodeFailedMessage) TcpDiscoveryNode(org.apache.ignite.spi.discovery.tcp.internal.TcpDiscoveryNode)

Example 3 with TcpDiscoveryNodeFailedMessage

use of org.apache.ignite.spi.discovery.tcp.messages.TcpDiscoveryNodeFailedMessage in project ignite by apache.

the class ServerImpl method forceNextNodeFailure.

/**
     * <strong>FOR TEST ONLY!!!</strong>
     * <p>
     * Simulates situation when next node is still alive but is bypassed
     * since it has been excluded from the ring, possibly, due to short time
     * network problems.
     * <p>
     * This method is intended for test purposes only.
     */
void forceNextNodeFailure() {
    U.warn(log, "Next node will be forcibly failed (if any).");
    TcpDiscoveryNode next;
    synchronized (mux) {
        next = ring.nextNode(failedNodes.keySet());
    }
    if (next != null)
        msgWorker.addMessage(new TcpDiscoveryNodeFailedMessage(getLocalNodeId(), next.id(), next.internalOrder()));
}
Also used : TcpDiscoveryNodeFailedMessage(org.apache.ignite.spi.discovery.tcp.messages.TcpDiscoveryNodeFailedMessage) TcpDiscoveryNode(org.apache.ignite.spi.discovery.tcp.internal.TcpDiscoveryNode)

Aggregations

TcpDiscoveryNode (org.apache.ignite.spi.discovery.tcp.internal.TcpDiscoveryNode)3 TcpDiscoveryNodeFailedMessage (org.apache.ignite.spi.discovery.tcp.messages.TcpDiscoveryNodeFailedMessage)3