use of com.hazelcast.internal.server.tcp.TcpServerConnection in project hazelcast by hazelcast.
the class IOBalancerStressTest method debug.
private StringBuilder debug(HazelcastInstance hz) {
TcpServer networkingService = (TcpServer) getNode(hz).getServer();
NioNetworking networking = (NioNetworking) networkingService.getNetworking();
ServerConnectionManager cm = getNode(hz).getServer().getConnectionManager(EndpointQualifier.MEMBER);
StringBuilder sb = new StringBuilder();
sb.append("in owners\n");
for (NioThread in : networking.getInputThreads()) {
sb.append(in).append(": ").append(in.getEventCount()).append("\n");
for (ServerConnection connection : cm.getConnections()) {
TcpServerConnection tcpConnection = (TcpServerConnection) connection;
NioInboundPipeline inboundPipeline = ((NioChannel) tcpConnection.getChannel()).inboundPipeline();
if (inboundPipeline.owner() == in) {
sb.append("\t").append(inboundPipeline).append(" load: ").append(inboundPipeline.load()).append("\n");
}
}
}
sb.append("out owners\n");
for (NioThread in : networking.getOutputThreads()) {
sb.append(in).append(": ").append(in.getEventCount()).append("\n");
for (ServerConnection connection : cm.getConnections()) {
TcpServerConnection tcpConnection = (TcpServerConnection) connection;
NioOutboundPipeline outboundPipeline = ((NioChannel) tcpConnection.getChannel()).outboundPipeline();
if (outboundPipeline.owner() == in) {
sb.append("\t").append(outboundPipeline).append(" load:").append(outboundPipeline.load()).append("\n");
}
}
}
return sb;
}
use of com.hazelcast.internal.server.tcp.TcpServerConnection in project hazelcast by hazelcast.
the class OverloadedConnectionsPlugin method run.
@Override
public void run(DiagnosticsLogWriter writer) {
writer.startSection("OverloadedConnections");
Collection<ServerConnection> connections = nodeEngine.getNode().getServer().getConnections();
for (ServerConnection connection : connections) {
clear();
scan(writer, (TcpServerConnection) connection, false);
clear();
scan(writer, (TcpServerConnection) connection, true);
}
writer.endSection();
}
use of com.hazelcast.internal.server.tcp.TcpServerConnection in project hazelcast by hazelcast.
the class TextChannelInitializer method initChannel.
@Override
public void initChannel(Channel channel) {
ServerConnection connection = (TcpServerConnection) channel.attributeMap().get(ServerConnection.class);
SingleProtocolEncoder encoder = new SingleProtocolEncoder(new TextEncoder(connection));
InboundHandler decoder = rest ? new RestApiTextDecoder(connection, (TextEncoder) encoder.getFirstOutboundHandler(), true) : new MemcacheTextDecoder(connection, (TextEncoder) encoder.getFirstOutboundHandler(), true);
TextHandshakeDecoder handshaker = new TextHandshakeDecoder(rest ? ProtocolType.REST : ProtocolType.MEMCACHE, decoder, encoder);
channel.outboundPipeline().addLast(encoder);
channel.inboundPipeline().addLast(handshaker);
}
Aggregations