Search in sources :

Example 1 with NonBlockingSession

use of io.mycat.server.NonBlockingSession in project Mycat-Server by MyCATApache.

the class ShowVariables method justReturnValue.

public static void justReturnValue(ServerConnection sc, String orgin, BackendConnection jdbcConnection) {
    justReturnValue(sc, orgin);
    NonBlockingSession session = sc.getSession2();
    session.releaseConnectionIfSafe(jdbcConnection, LOGGER.isDebugEnabled(), false);
}
Also used : NonBlockingSession(io.mycat.server.NonBlockingSession)

Example 2 with NonBlockingSession

use of io.mycat.server.NonBlockingSession in project Mycat-Server by MyCATApache.

the class ShowSession method getRow.

private static RowDataPacket getRow(ServerConnection sc, String charset) {
    StringBuilder sb = new StringBuilder();
    NonBlockingSession ssesion = sc.getSession2();
    Collection<BackendConnection> backConnections = ssesion.getTargetMap().values();
    int cncount = backConnections.size();
    if (cncount == 0) {
        return null;
    }
    for (BackendConnection backCon : backConnections) {
        sb.append(backCon).append("\r\n");
    }
    RowDataPacket row = new RowDataPacket(FIELD_COUNT);
    row.add(StringUtil.encode(sc.getId() + "", charset));
    row.add(StringUtil.encode(cncount + "", charset));
    row.add(StringUtil.encode(sb.toString(), charset));
    return row;
}
Also used : BackendConnection(io.mycat.backend.BackendConnection) RowDataPacket(io.mycat.net.mysql.RowDataPacket) NonBlockingSession(io.mycat.server.NonBlockingSession)

Example 3 with NonBlockingSession

use of io.mycat.server.NonBlockingSession in project Mycat-Server by MyCATApache.

the class ShowVariables method execute.

public static void execute(ServerConnection sc, String orgin, BackendConnection jdbcConnection) {
    execute(sc, orgin);
    NonBlockingSession session = sc.getSession2();
    session.releaseConnectionIfSafe(jdbcConnection, LOGGER.isDebugEnabled(), false);
}
Also used : NonBlockingSession(io.mycat.server.NonBlockingSession)

Aggregations

NonBlockingSession (io.mycat.server.NonBlockingSession)3 BackendConnection (io.mycat.backend.BackendConnection)1 RowDataPacket (io.mycat.net.mysql.RowDataPacket)1