未验证 提交 67cc2873 编写于 作者: 杨翊 SionYang 提交者: GitHub

Classify packets which need to be refactor or replaced in sharding-scaling-mysql (#4670)

* Classify the MySQL protocol packets that needs to be refactor or replaced for auth

* Classify the MySQL protocol packets that needs to be refactor or replaced for command

* Classify the MySQL protocol packets that needs to be refactor or replaced for response

* Classify the MySQL protocol packets that needs to be refactor or replaced for binlog

* Classify the MySQL protocol packets that needs to be refactor or replaced for binlog

* Classify the MySQL protocol packets that needs to be refactor or replaced for codec

* For checkstyle

* use new database-protocol-module
上级 dd69b044
......@@ -34,6 +34,11 @@
<artifactId>sharding-scaling-core</artifactId>
<version>${parent.version}</version>
</dependency>
<dependency>
<groupId>org.apache.shardingsphere</groupId>
<artifactId>shardingsphere-database-protocol-mysql</artifactId>
<version>${parent.version}</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
......
......@@ -225,6 +225,7 @@ public final class MySQLConnector {
}
class MySQLCommandResponseHandler extends ChannelInboundHandlerAdapter {
@Override
public void channelRead(final ChannelHandlerContext ctx, final Object msg) {
if (null != responseCallback) {
......@@ -242,6 +243,7 @@ public final class MySQLConnector {
}
class MySQLBinlogEventHandler extends ChannelInboundHandlerAdapter {
@Override
public void channelRead(final ChannelHandlerContext ctx, final Object msg) throws Exception {
if (msg instanceof AbstractBinlogEvent) {
......
......@@ -24,7 +24,10 @@ package org.apache.shardingsphere.shardingscaling.mysql.binlog.codec;
* MySQL Internals Manual / MySQL Client/Server Protocol / Connection Phase / CapabilityFlags Flags
* https://dev.mysql.com/doc/internals/en/capability-flags.html#flag-CLIENT_PROTOCOL_41
* </p>
*
* @deprecated Replace with {@link org.apache.shardingsphere.database.protocol.mysql.constant.MySQLCapabilityFlag}
*/
@Deprecated
public final class CapabilityFlags {
public static final int CLIENT_LONG_PASSWORD = 0x00000001;
......
......@@ -28,7 +28,10 @@ import java.util.BitSet;
* <p>
* https://dev.mysql.com/doc/internals/en/describing-packets.html
* </p>
*
* @deprecated Replace with {@link org.apache.shardingsphere.database.protocol.mysql.payload.MySQLPacketPayload}
*/
@Deprecated
public final class DataTypesCodec {
private static final BigInteger MAX_BIG_INTEGER_VALUE = new BigInteger("18446744073709551615");
......
......@@ -32,8 +32,11 @@ import lombok.SneakyThrows;
/**
* MySQL client authentication packet.
*
* @deprecated Replace with {@link org.apache.shardingsphere.database.protocol.mysql.packet.handshake.MySQLHandshakeResponse41Packet}
*/
@Setter
@Deprecated
public final class ClientAuthenticationPacket extends AbstractPacket {
@Setter(AccessLevel.NONE)
......
......@@ -46,9 +46,12 @@ import lombok.Setter;
* n rest of the plugin provided data (at least 12 bytes)
* 1 \0 byte, terminating the second part of a scramble
* </p>
*
* @deprecated Replace with {@link org.apache.shardingsphere.database.protocol.mysql.packet.handshake.MySQLHandshakePacket}
*/
@Setter
@Getter
@Deprecated
public final class HandshakeInitializationPacket extends AbstractPacket {
private short protocolVersion = 0x0a;
......
......@@ -32,6 +32,8 @@ import lombok.Setter;
* |timestamp|type code|server_id|event_length|end_log_pos|flags |
* |4 bytes |1 byte |4 bytes |4 bytes |4 bytes |2 bytes|
* +---------+---------+---------+------------+-----------+-------+
*
* Refactor by extends {@link org.apache.shardingsphere.database.protocol.mysql.packet.command.MySQLCommandPacket}.
* </p>
*/
@Setter
......
......@@ -19,7 +19,11 @@ package org.apache.shardingsphere.shardingscaling.mysql.binlog.packet.binlog;
/**
* Mysql column types.
*
*
* @deprecated Replaced by {@link org.apache.shardingsphere.database.protocol.mysql.constant.MySQLColumnType}
*/
@Deprecated
public final class ColumnTypes {
public static final int MYSQL_TYPE_DECIMAL = 0;
......
......@@ -30,6 +30,8 @@ import lombok.Getter;
*
* Checksum in format description event include algorithm information.
* https://dev.mysql.com/worklog/task/?id=2540#tabs-2540-4
*
* Refactor by extends {@link org.apache.shardingsphere.database.protocol.mysql.packet.command.MySQLCommandPacket}.
* </p>
*/
@Getter
......
......@@ -24,6 +24,10 @@ import lombok.Getter;
/**
* Rotate event.
*
* <p>
* Refactor by extends {@link org.apache.shardingsphere.database.protocol.mysql.packet.command.MySQLCommandPacket}.
* </p>
*/
@Getter
public final class RotateEventPacket {
......
......@@ -36,6 +36,8 @@ import java.util.List;
*
* <p>
* https://dev.mysql.com/doc/internals/en/rows-event.html
*
* Refactor by extends {@link org.apache.shardingsphere.database.protocol.mysql.packet.command.MySQLCommandPacket}.
* </p>
*/
@Getter
......
......@@ -27,6 +27,8 @@ import lombok.Getter;
*
* <p>
* https://dev.mysql.com/doc/internals/en/table-map-event.html
*
* Refactor by extends {@link org.apache.shardingsphere.database.protocol.mysql.packet.command.MySQLCommandPacket}.
* </p>
*/
@Getter
......
......@@ -27,6 +27,10 @@ import io.netty.buffer.ByteBufAllocator;
/**
* MySQL binlog dump command packet.
*
* <p>
* Refactor by extends {@link org.apache.shardingsphere.database.protocol.mysql.packet.command.MySQLCommandPacket}.
* </p>
*/
@Setter
public final class BinlogDumpCommandPacket extends AbstractCommandPacket {
......
......@@ -26,8 +26,11 @@ import java.nio.charset.StandardCharsets;
/**
* MySQL Query command packet.
*
* @deprecated Replaced with {@link org.apache.shardingsphere.database.protocol.mysql.packet.command.query.text.query.MySQLComQueryPacket}
*/
@Setter
@Deprecated
public final class QueryCommandPacket extends AbstractCommandPacket {
private String queryString;
......
......@@ -25,6 +25,10 @@ import lombok.Setter;
/**
* Register salve command packet.
*
* <p>
* Refactor by extends {@link org.apache.shardingsphere.database.protocol.mysql.packet.command.MySQLCommandPacket}.
* </p>
*/
@Setter
public final class RegisterSlaveCommandPacket extends AbstractCommandPacket {
......
......@@ -29,8 +29,11 @@ import io.netty.buffer.ByteBuf;
* MySQL Internals Manual / MySQL Client/Server Protocol / Overview / Generic Response Packets / EOF_Packet
* https://dev.mysql.com/doc/internals/en/packet-EOF_Packet.html
* </p>
*
* @deprecated Replace with {@link org.apache.shardingsphere.database.protocol.mysql.packet.generic.MySQLEofPacket}
*/
@Getter
@Deprecated
public final class EofPacket extends AbstractPacket {
private short fieldCount;
......
......@@ -29,8 +29,11 @@ import lombok.Getter;
* MySQL Internals Manual / MySQL Client/Server Protocol / Overview / Generic Response Packets / ERR_Packet
* https://dev.mysql.com/doc/internals/en/packet-ERR_Packet.html
* </p>
*
* @deprecated Replace with {@link org.apache.shardingsphere.database.protocol.mysql.packet.generic.MySQLErrPacket}
*/
@Getter
@Deprecated
public final class ErrorPacket extends AbstractPacket {
private short fieldCount;
......
......@@ -29,8 +29,11 @@ import lombok.Getter;
* MySQL Internals Manual / MySQL Client/Server Protocol / Text Protocol / COM_QUERY / COM_QUERY Response
* https://dev.mysql.com/doc/internals/en/com-query-response.html#packet-Protocol::ColumnDefinition41
* </p>
*
* @deprecated Replace with {@link org.apache.shardingsphere.database.protocol.mysql.packet.command.query.MySQLColumnDefinition41Packet}
*/
@Getter
@Deprecated
public final class FieldPacket extends AbstractPacket {
private String catalog;
......
......@@ -29,8 +29,11 @@ import lombok.Getter;
* MySQL Internals Manual / MySQL Client/Server Protocol / Overview / Generic Response Packets / OK_Packet
* https://dev.mysql.com/doc/internals/en/packet-OK_Packet.html
* </p>
*
* @deprecated Replace with {@link org.apache.shardingsphere.database.protocol.mysql.packet.generic.MySQLOKPacket}
*/
@Getter
@Deprecated
public final class OkPacket extends AbstractPacket {
private short fieldCount;
......
......@@ -27,12 +27,12 @@ import lombok.Getter;
*
* <p>
* There is no define for result set packet header.
*
* MySQL Internals Manual / MySQL Client/Server Protocol / Prepared Statements / Binary Protocol ResultSet
* https://dev.mysql.com/doc/internals/en/binary-protocol-resultset.html
* </p>
*
* @deprecated Replace with {@link org.apache.shardingsphere.database.protocol.mysql.packet.command.query.MySQLFieldCountPacket}
*/
@Getter
@Deprecated
public final class ResultSetHeaderPacket extends AbstractPacket {
private long columnCount;
......
......@@ -32,8 +32,11 @@ import java.util.List;
* MySQL Internals Manual / MySQL Client/Server Protocol / Text Protocol / COM_QUERY / COM_QUERY Response
* https://dev.mysql.com/doc/internals/en/com-query-response.html#packet-ProtocolText::ResultsetRow
* </p>
*
* @deprecated Replace with {@link org.apache.shardingsphere.database.protocol.mysql.packet.command.query.text.MySQLTextResultSetRowPacket}
*/
@Getter
@Deprecated
public final class RowDataPacket extends AbstractPacket {
private List<String> columns = new ArrayList<>();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册