Search in sources :

Example 1 with CommandPacket

use of io.shardingjdbc.proxy.transport.mysql.packet.command.CommandPacket in project sharding-jdbc by shardingjdbc.

the class MySQLFrontendHandler method executeCommand.

@Override
protected void executeCommand(final ChannelHandlerContext context, final ByteBuf message) {
    MySQLPacketPayload mysqlPacketPayload = new MySQLPacketPayload(message);
    int sequenceId = mysqlPacketPayload.readInt1();
    CommandPacket commandPacket = CommandPacketFactory.getCommandPacket(sequenceId, mysqlPacketPayload);
    for (DatabaseProtocolPacket each : commandPacket.execute()) {
        context.write(each);
    }
    context.flush();
}
Also used : MySQLPacketPayload(io.shardingjdbc.proxy.transport.mysql.packet.MySQLPacketPayload) DatabaseProtocolPacket(io.shardingjdbc.proxy.transport.common.packet.DatabaseProtocolPacket) CommandPacket(io.shardingjdbc.proxy.transport.mysql.packet.command.CommandPacket)

Aggregations

DatabaseProtocolPacket (io.shardingjdbc.proxy.transport.common.packet.DatabaseProtocolPacket)1 MySQLPacketPayload (io.shardingjdbc.proxy.transport.mysql.packet.MySQLPacketPayload)1 CommandPacket (io.shardingjdbc.proxy.transport.mysql.packet.command.CommandPacket)1