use of io.mycat.util.NameableExecutor in project Mycat-Server by MyCATApache.
the class ShowThreadPool method getExecutors.
private static List<NameableExecutor> getExecutors() {
List<NameableExecutor> list = new LinkedList<NameableExecutor>();
MycatServer server = MycatServer.getInstance();
list.add(server.getTimerExecutor());
// list.add(server.getAioExecutor());
list.add(server.getBusinessExecutor());
// }
return list;
}
use of io.mycat.util.NameableExecutor in project Mycat-Server by MyCATApache.
the class ShowThreadPool method execute.
public static void execute(ManagerConnection c) {
ByteBuffer buffer = c.allocate();
// write header
buffer = header.write(buffer, c, true);
// write fields
for (FieldPacket field : fields) {
buffer = field.write(buffer, c, true);
}
// write eof
buffer = eof.write(buffer, c, true);
// write rows
byte packetId = eof.packetId;
List<NameableExecutor> executors = getExecutors();
for (NameableExecutor exec : executors) {
if (exec != null) {
RowDataPacket row = getRow(exec, c.getCharset());
row.packetId = ++packetId;
buffer = row.write(buffer, c, true);
}
}
// write last eof
EOFPacket lastEof = new EOFPacket();
lastEof.packetId = ++packetId;
buffer = lastEof.write(buffer, c, true);
// write buffer
c.write(buffer);
}
Aggregations