Search in sources :

Example 1 with NIOConnection

use of com.alibaba.cobar.net.NIOConnection in project cobar by alibaba.

the class KillConnection method response.

public static void response(String stmt, int offset, ManagerConnection mc) {
    int count = 0;
    List<FrontendConnection> list = getList(stmt, offset, mc);
    if (list != null)
        for (NIOConnection c : list) {
            StringBuilder s = new StringBuilder();
            logger.warn(s.append(c).append("killed by manager").toString());
            c.close();
            count++;
        }
    OkPacket packet = new OkPacket();
    packet.packetId = 1;
    packet.affectedRows = count;
    packet.serverStatus = 2;
    packet.write(mc);
}
Also used : FrontendConnection(com.alibaba.cobar.net.FrontendConnection) OkPacket(com.alibaba.cobar.net.mysql.OkPacket) NIOConnection(com.alibaba.cobar.net.NIOConnection)

Aggregations

FrontendConnection (com.alibaba.cobar.net.FrontendConnection)1 NIOConnection (com.alibaba.cobar.net.NIOConnection)1 OkPacket (com.alibaba.cobar.net.mysql.OkPacket)1