use of com.hazelcast.nio.tcp.TcpIpConnection in project hazelcast by hazelcast.
the class IOBalancerStressTest method getHandlersPerSelector.
private Map<NonBlockingIOThread, Set<MigratableHandler>> getHandlersPerSelector(TcpIpConnectionManager connectionManager) {
Map<NonBlockingIOThread, Set<MigratableHandler>> handlersPerSelector = new HashMap<NonBlockingIOThread, Set<MigratableHandler>>();
for (TcpIpConnection connection : connectionManager.getActiveConnections()) {
add(handlersPerSelector, (MigratableHandler) connection.getSocketReader());
add(handlersPerSelector, (MigratableHandler) connection.getSocketWriter());
}
return handlersPerSelector;
}
use of com.hazelcast.nio.tcp.TcpIpConnection 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();
}
Aggregations