Search in sources :

Example 1 with NonBlockingSocketReader

use of com.hazelcast.internal.networking.nonblocking.NonBlockingSocketReader in project hazelcast by hazelcast.

the class IOBalancerStressTest method debug.

public String debug(TcpIpConnectionManager connectionManager) {
    NonBlockingIOThreadingModel threadingModel = (NonBlockingIOThreadingModel) connectionManager.getIoThreadingModel();
    StringBuffer sb = new StringBuffer();
    sb.append("in selectors\n");
    for (NonBlockingIOThread in : threadingModel.getInputThreads()) {
        sb.append(in + ": " + in.getEventCount() + "\n");
        for (TcpIpConnection connection : connectionManager.getActiveConnections()) {
            NonBlockingSocketReader socketReader = (NonBlockingSocketReader) connection.getSocketReader();
            if (socketReader.getOwner() == in) {
                sb.append("\t" + socketReader + " eventCount:" + socketReader.getEventCount() + "\n");
            }
        }
    }
    sb.append("out selectors\n");
    for (NonBlockingIOThread in : threadingModel.getOutputThreads()) {
        sb.append(in + ": " + in.getEventCount() + "\n");
        for (TcpIpConnection connection : connectionManager.getActiveConnections()) {
            NonBlockingSocketWriter socketWriter = (NonBlockingSocketWriter) connection.getSocketWriter();
            if (socketWriter.getOwner() == in) {
                sb.append("\t" + socketWriter + " eventCount:" + socketWriter.getEventCount() + "\n");
            }
        }
    }
    return sb.toString();
}
Also used : NonBlockingIOThread(com.hazelcast.internal.networking.nonblocking.NonBlockingIOThread) TcpIpConnection(com.hazelcast.nio.tcp.TcpIpConnection) NonBlockingSocketReader(com.hazelcast.internal.networking.nonblocking.NonBlockingSocketReader) NonBlockingSocketWriter(com.hazelcast.internal.networking.nonblocking.NonBlockingSocketWriter) NonBlockingIOThreadingModel(com.hazelcast.internal.networking.nonblocking.NonBlockingIOThreadingModel)

Aggregations

NonBlockingIOThread (com.hazelcast.internal.networking.nonblocking.NonBlockingIOThread)1 NonBlockingIOThreadingModel (com.hazelcast.internal.networking.nonblocking.NonBlockingIOThreadingModel)1 NonBlockingSocketReader (com.hazelcast.internal.networking.nonblocking.NonBlockingSocketReader)1 NonBlockingSocketWriter (com.hazelcast.internal.networking.nonblocking.NonBlockingSocketWriter)1 TcpIpConnection (com.hazelcast.nio.tcp.TcpIpConnection)1