use of org.apache.ignite.spi.communication.tcp.internal.ConnectionKey in project ignite by apache.
the class TcpCommunicationSpi method dumpNodeStatistics.
/**
* @param nodeId Target node ID.
* @return Future.
*/
public IgniteInternalFuture<String> dumpNodeStatistics(final UUID nodeId) {
StringBuilder sb = new StringBuilder("Communication SPI statistics [rmtNode=").append(nodeId).append(']').append(U.nl());
dumpInfo(sb, nodeId);
GridNioServer<Message> nioSrvr = nioSrvWrapper.nio();
if (nioSrvr != null) {
sb.append("NIO sessions statistics:");
IgnitePredicate<GridNioSession> p = (IgnitePredicate<GridNioSession>) ses -> {
ConnectionKey connId = ses.meta(CONN_IDX_META);
return connId != null && nodeId.equals(connId.nodeId());
};
return nioSrvr.dumpStats(sb.toString(), p);
} else {
sb.append(U.nl()).append("GridNioServer is null.");
return new GridFinishedFuture<>(sb.toString());
}
}
use of org.apache.ignite.spi.communication.tcp.internal.ConnectionKey in project ignite by apache.
the class TcpCommunicationSpi method dumpInfo.
/**
* @param sb Message builder.
* @param dstNodeId Target node ID.
*/
private void dumpInfo(StringBuilder sb, UUID dstNodeId) {
sb.append("Communication SPI recovery descriptors: ").append(U.nl());
for (Map.Entry<ConnectionKey, GridNioRecoveryDescriptor> entry : nioSrvWrapper.recoveryDescs().entrySet()) {
GridNioRecoveryDescriptor desc = entry.getValue();
if (dstNodeId != null && !dstNodeId.equals(entry.getKey().nodeId()))
continue;
sb.append(" [key=").append(entry.getKey()).append(", msgsSent=").append(desc.sent()).append(", msgsAckedByRmt=").append(desc.acked()).append(", msgsRcvd=").append(desc.received()).append(", lastAcked=").append(desc.lastAcknowledged()).append(", reserveCnt=").append(desc.reserveCount()).append(", descIdHash=").append(System.identityHashCode(desc)).append(']').append(U.nl());
}
for (Map.Entry<ConnectionKey, GridNioRecoveryDescriptor> entry : nioSrvWrapper.outRecDescs().entrySet()) {
GridNioRecoveryDescriptor desc = entry.getValue();
if (dstNodeId != null && !dstNodeId.equals(entry.getKey().nodeId()))
continue;
sb.append(" [key=").append(entry.getKey()).append(", msgsSent=").append(desc.sent()).append(", msgsAckedByRmt=").append(desc.acked()).append(", reserveCnt=").append(desc.reserveCount()).append(", connected=").append(desc.connected()).append(", reserved=").append(desc.reserved()).append(", descIdHash=").append(System.identityHashCode(desc)).append(']').append(U.nl());
}
for (Map.Entry<ConnectionKey, GridNioRecoveryDescriptor> entry : nioSrvWrapper.inRecDescs().entrySet()) {
GridNioRecoveryDescriptor desc = entry.getValue();
if (dstNodeId != null && !dstNodeId.equals(entry.getKey().nodeId()))
continue;
sb.append(" [key=").append(entry.getKey()).append(", msgsRcvd=").append(desc.received()).append(", lastAcked=").append(desc.lastAcknowledged()).append(", reserveCnt=").append(desc.reserveCount()).append(", connected=").append(desc.connected()).append(", reserved=").append(desc.reserved()).append(", handshakeIdx=").append(desc.handshakeIndex()).append(", descIdHash=").append(System.identityHashCode(desc)).append(']').append(U.nl());
}
sb.append("Communication SPI clients: ").append(U.nl());
for (Map.Entry<UUID, GridCommunicationClient[]> entry : clientPool.entrySet()) {
UUID clientNodeId = entry.getKey();
if (dstNodeId != null && !dstNodeId.equals(clientNodeId))
continue;
GridCommunicationClient[] clients0 = entry.getValue();
for (GridCommunicationClient client : clients0) {
if (client != null) {
sb.append(" [node=").append(clientNodeId).append(", client=").append(client).append(']').append(U.nl());
}
}
}
}
Aggregations