Class CommunicationTcpUtils
- java.lang.Object
-
- org.apache.ignite.spi.communication.tcp.internal.CommunicationTcpUtils
-
public class CommunicationTcpUtils extends Object
Common communication spi logic.
-
-
Field Summary
Fields Modifier and Type Field Description static IgniteRunnableNOOPNo-op runnable.
-
Constructor Summary
Constructors Constructor Description CommunicationTcpUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidfailNode(ClusterNode nodeToFail, IgniteSpiContext spiCtx, Throwable err, IgniteLogger log)Forcibly fails client node.static IgniteSpiOperationTimeoutExceptionhandshakeTimeoutException()Returns handshake exception with specific message.static booleanisRecoverableException(Throwable errs)static Collection<InetSocketAddress>nodeAddresses(ClusterNode node, boolean filterReachableAddrs, AttributeNames attrs, Supplier<ClusterNode> localNode)static booleanusePairedConnections(ClusterNode node, String attributeName)static voidwriteMessageType(OutputStream os, short type)Write message type to output stream.
-
-
-
Field Detail
-
NOOP
public static final IgniteRunnable NOOP
No-op runnable.
-
-
Method Detail
-
usePairedConnections
public static boolean usePairedConnections(ClusterNode node, String attributeName)
- Parameters:
node- Node.- Returns:
Trueif can use in/out connection pair for communication.
-
writeMessageType
public static void writeMessageType(OutputStream os, short type) throws IOException
Write message type to output stream.- Parameters:
os- Output stream.type- Message type.- Throws:
IOException- On error.
-
nodeAddresses
public static Collection<InetSocketAddress> nodeAddresses(ClusterNode node, boolean filterReachableAddrs, AttributeNames attrs, Supplier<ClusterNode> localNode) throws IgniteCheckedException
- Parameters:
node- Node.filterReachableAddrs- Filter addresses flag.- Returns:
- Node addresses.
- Throws:
IgniteCheckedException- If node does not have addresses.
-
handshakeTimeoutException
public static IgniteSpiOperationTimeoutException handshakeTimeoutException()
Returns handshake exception with specific message.
-
isRecoverableException
public static boolean isRecoverableException(Throwable errs)
- Parameters:
errs- Error.- Returns:
Trueif error was caused by some connection IO error or IgniteCheckedException due to timeout.
-
failNode
public static void failNode(ClusterNode nodeToFail, IgniteSpiContext spiCtx, Throwable err, IgniteLogger log)
Forcibly fails client node. Is used in a single situation if a client node is visible to discovery but is not reachable via comm protocol.- Parameters:
nodeToFail- Client node to forcible fail.spiCtx- Context to request node failing.err- Error to fail client with.log- Logger to print message about failed node to.
-
-