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);
}
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;
}
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);
}
Aggregations