Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
apache
Shardingsphere
提交
0439c61d
Shardingsphere
项目概览
apache
/
Shardingsphere
通知
56
Star
3
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Shardingsphere
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
0439c61d
编写于
3月 15, 2018
作者:
T
terrymanu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
rename abstract xxx on proxy model
上级
f3a85c5c
变更
21
隐藏空白更改
内联
并排
Showing
21 changed file
with
60 addition
and
59 deletion
+60
-59
sharding-proxy/src/main/java/io/shardingjdbc/proxy/codec/MySQLPacketCodec.java
...in/java/io/shardingjdbc/proxy/codec/MySQLPacketCodec.java
+7
-7
sharding-proxy/src/main/java/io/shardingjdbc/proxy/constant/ColumnType.java
.../main/java/io/shardingjdbc/proxy/constant/ColumnType.java
+1
-0
sharding-proxy/src/main/java/io/shardingjdbc/proxy/handler/ServerHandler.java
...ain/java/io/shardingjdbc/proxy/handler/ServerHandler.java
+6
-6
sharding-proxy/src/main/java/io/shardingjdbc/proxy/packet/MySQLPacket.java
...c/main/java/io/shardingjdbc/proxy/packet/MySQLPacket.java
+1
-1
sharding-proxy/src/main/java/io/shardingjdbc/proxy/packet/MySQLReceivedPacket.java
...ava/io/shardingjdbc/proxy/packet/MySQLReceivedPacket.java
+2
-2
sharding-proxy/src/main/java/io/shardingjdbc/proxy/packet/MySQLSentPacket.java
...in/java/io/shardingjdbc/proxy/packet/MySQLSentPacket.java
+1
-1
sharding-proxy/src/main/java/io/shardingjdbc/proxy/packet/command/ColumnDefinition41Packet.java
...ngjdbc/proxy/packet/command/ColumnDefinition41Packet.java
+2
-2
sharding-proxy/src/main/java/io/shardingjdbc/proxy/packet/command/ComFieldListPacket.java
...shardingjdbc/proxy/packet/command/ComFieldListPacket.java
+4
-4
sharding-proxy/src/main/java/io/shardingjdbc/proxy/packet/command/ComInitDbPacket.java
...io/shardingjdbc/proxy/packet/command/ComInitDbPacket.java
+5
-5
sharding-proxy/src/main/java/io/shardingjdbc/proxy/packet/command/ComQueryPacket.java
.../io/shardingjdbc/proxy/packet/command/ComQueryPacket.java
+4
-4
sharding-proxy/src/main/java/io/shardingjdbc/proxy/packet/command/ComQuitPacket.java
...a/io/shardingjdbc/proxy/packet/command/ComQuitPacket.java
+4
-4
sharding-proxy/src/main/java/io/shardingjdbc/proxy/packet/command/CommandPacket.java
...a/io/shardingjdbc/proxy/packet/command/CommandPacket.java
+4
-4
sharding-proxy/src/main/java/io/shardingjdbc/proxy/packet/command/CommandPacketFactory.java
...ardingjdbc/proxy/packet/command/CommandPacketFactory.java
+1
-1
sharding-proxy/src/main/java/io/shardingjdbc/proxy/packet/command/FieldCountPacket.java
...o/shardingjdbc/proxy/packet/command/FieldCountPacket.java
+2
-2
sharding-proxy/src/main/java/io/shardingjdbc/proxy/packet/command/TextResultSetRowPacket.java
...dingjdbc/proxy/packet/command/TextResultSetRowPacket.java
+2
-2
sharding-proxy/src/main/java/io/shardingjdbc/proxy/packet/command/UnsupportedCommandPacket.java
...ngjdbc/proxy/packet/command/UnsupportedCommandPacket.java
+4
-4
sharding-proxy/src/main/java/io/shardingjdbc/proxy/packet/handshake/HandshakePacket.java
.../shardingjdbc/proxy/packet/handshake/HandshakePacket.java
+2
-2
sharding-proxy/src/main/java/io/shardingjdbc/proxy/packet/handshake/HandshakeResponse41Packet.java
...dbc/proxy/packet/handshake/HandshakeResponse41Packet.java
+2
-2
sharding-proxy/src/main/java/io/shardingjdbc/proxy/packet/ok/EofPacket.java
.../main/java/io/shardingjdbc/proxy/packet/ok/EofPacket.java
+2
-2
sharding-proxy/src/main/java/io/shardingjdbc/proxy/packet/ok/ErrPacket.java
.../main/java/io/shardingjdbc/proxy/packet/ok/ErrPacket.java
+2
-2
sharding-proxy/src/main/java/io/shardingjdbc/proxy/packet/ok/OKPacket.java
...c/main/java/io/shardingjdbc/proxy/packet/ok/OKPacket.java
+2
-2
未找到文件。
sharding-proxy/src/main/java/io/shardingjdbc/proxy/codec/MySQLPacketCodec.java
浏览文件 @
0439c61d
...
...
@@ -21,9 +21,9 @@ import io.netty.buffer.ByteBuf;
import
io.netty.buffer.ByteBufUtil
;
import
io.netty.channel.ChannelHandlerContext
;
import
io.netty.handler.codec.ByteToMessageCodec
;
import
io.shardingjdbc.proxy.packet.
Abstract
MySQLPacket
;
import
io.shardingjdbc.proxy.packet.MySQLPacket
;
import
io.shardingjdbc.proxy.packet.MySQLPacketPayload
;
import
io.shardingjdbc.proxy.packet.
Abstract
MySQLSentPacket
;
import
io.shardingjdbc.proxy.packet.MySQLSentPacket
;
import
lombok.extern.slf4j.Slf4j
;
import
java.util.List
;
...
...
@@ -34,32 +34,32 @@ import java.util.List;
* @author zhangliang
*/
@Slf4j
public
final
class
MySQLPacketCodec
extends
ByteToMessageCodec
<
Abstract
MySQLSentPacket
>
{
public
final
class
MySQLPacketCodec
extends
ByteToMessageCodec
<
MySQLSentPacket
>
{
@Override
protected
void
decode
(
final
ChannelHandlerContext
context
,
final
ByteBuf
in
,
final
List
<
Object
>
out
)
throws
Exception
{
int
readableBytes
=
in
.
readableBytes
();
if
(
readableBytes
<
AbstractMySQLPacket
.
PAYLOAD_LENGTH
+
Abstract
MySQLPacket
.
SEQUENCE_LENGTH
)
{
if
(
readableBytes
<
MySQLPacket
.
PAYLOAD_LENGTH
+
MySQLPacket
.
SEQUENCE_LENGTH
)
{
return
;
}
if
(
log
.
isDebugEnabled
())
{
log
.
debug
(
"Read from client: \n {}"
,
ByteBufUtil
.
prettyHexDump
(
in
));
}
int
payloadLength
=
in
.
markReaderIndex
().
readMediumLE
();
int
realPacketLength
=
payloadLength
+
AbstractMySQLPacket
.
PAYLOAD_LENGTH
+
Abstract
MySQLPacket
.
SEQUENCE_LENGTH
;
int
realPacketLength
=
payloadLength
+
MySQLPacket
.
PAYLOAD_LENGTH
+
MySQLPacket
.
SEQUENCE_LENGTH
;
if
(
readableBytes
<
realPacketLength
)
{
in
.
resetReaderIndex
();
return
;
}
if
(
readableBytes
>
realPacketLength
)
{
out
.
add
(
in
.
readRetainedSlice
(
payloadLength
+
Abstract
MySQLPacket
.
SEQUENCE_LENGTH
));
out
.
add
(
in
.
readRetainedSlice
(
payloadLength
+
MySQLPacket
.
SEQUENCE_LENGTH
));
return
;
}
out
.
add
(
in
);
}
@Override
protected
void
encode
(
final
ChannelHandlerContext
context
,
final
Abstract
MySQLSentPacket
message
,
final
ByteBuf
out
)
throws
Exception
{
protected
void
encode
(
final
ChannelHandlerContext
context
,
final
MySQLSentPacket
message
,
final
ByteBuf
out
)
throws
Exception
{
MySQLPacketPayload
mysqlPacketPayload
=
new
MySQLPacketPayload
(
context
.
alloc
().
buffer
());
message
.
write
(
mysqlPacketPayload
);
out
.
writeMediumLE
(
mysqlPacketPayload
.
getByteBuf
().
readableBytes
());
...
...
sharding-proxy/src/main/java/io/shardingjdbc/proxy/constant/ColumnType.java
浏览文件 @
0439c61d
...
...
@@ -31,6 +31,7 @@ import java.sql.Types;
@RequiredArgsConstructor
@Getter
public
enum
ColumnType
{
MYSQL_TYPE_DECIMAL
(
0x00
),
MYSQL_TYPE_TINY
(
0x01
),
MYSQL_TYPE_SHORT
(
0x02
),
...
...
sharding-proxy/src/main/java/io/shardingjdbc/proxy/handler/ServerHandler.java
浏览文件 @
0439c61d
...
...
@@ -21,9 +21,9 @@ import io.netty.buffer.ByteBuf;
import
io.netty.channel.ChannelHandlerContext
;
import
io.netty.channel.ChannelInboundHandlerAdapter
;
import
io.shardingjdbc.proxy.constant.StatusFlag
;
import
io.shardingjdbc.proxy.packet.
Abstract
MySQLSentPacket
;
import
io.shardingjdbc.proxy.packet.MySQLSentPacket
;
import
io.shardingjdbc.proxy.packet.MySQLPacketPayload
;
import
io.shardingjdbc.proxy.packet.command.
Abstract
CommandPacket
;
import
io.shardingjdbc.proxy.packet.command.CommandPacket
;
import
io.shardingjdbc.proxy.packet.command.CommandPacketFactory
;
import
io.shardingjdbc.proxy.packet.handshake.AuthPluginData
;
import
io.shardingjdbc.proxy.packet.handshake.ConnectionIdGenerator
;
...
...
@@ -43,13 +43,13 @@ public class ServerHandler extends ChannelInboundHandlerAdapter {
private
boolean
authorized
;
@Override
public
void
channelActive
(
final
ChannelHandlerContext
context
)
throws
Exception
{
public
void
channelActive
(
final
ChannelHandlerContext
context
)
{
authPluginData
=
new
AuthPluginData
();
context
.
writeAndFlush
(
new
HandshakePacket
(
ConnectionIdGenerator
.
getInstance
().
nextId
(),
authPluginData
));
}
@Override
public
void
channelRead
(
final
ChannelHandlerContext
context
,
final
Object
message
)
throws
Exception
{
public
void
channelRead
(
final
ChannelHandlerContext
context
,
final
Object
message
)
{
MySQLPacketPayload
mysqlPacketPayload
=
new
MySQLPacketPayload
((
ByteBuf
)
message
);
if
(!
authorized
)
{
auth
(
context
,
mysqlPacketPayload
);
...
...
@@ -67,10 +67,10 @@ public class ServerHandler extends ChannelInboundHandlerAdapter {
private
void
executeCommand
(
final
ChannelHandlerContext
context
,
final
MySQLPacketPayload
mysqlPacketPayload
)
{
int
sequenceId
=
mysqlPacketPayload
.
readInt1
();
Abstract
CommandPacket
commandPacket
=
CommandPacketFactory
.
getCommandPacket
(
mysqlPacketPayload
.
readInt1
());
CommandPacket
commandPacket
=
CommandPacketFactory
.
getCommandPacket
(
mysqlPacketPayload
.
readInt1
());
commandPacket
.
setSequenceId
(
sequenceId
);
commandPacket
.
read
(
mysqlPacketPayload
);
for
(
Abstract
MySQLSentPacket
each
:
commandPacket
.
execute
())
{
for
(
MySQLSentPacket
each
:
commandPacket
.
execute
())
{
context
.
write
(
each
);
}
context
.
flush
();
...
...
sharding-proxy/src/main/java/io/shardingjdbc/proxy/packet/
Abstract
MySQLPacket.java
→
sharding-proxy/src/main/java/io/shardingjdbc/proxy/packet/MySQLPacket.java
浏览文件 @
0439c61d
...
...
@@ -27,7 +27,7 @@ import lombok.Setter;
*/
@Getter
@Setter
public
abstract
class
Abstract
MySQLPacket
{
public
abstract
class
MySQLPacket
{
public
static
final
int
PAYLOAD_LENGTH
=
3
;
...
...
sharding-proxy/src/main/java/io/shardingjdbc/proxy/packet/
Abstract
MySQLReceivedPacket.java
→
sharding-proxy/src/main/java/io/shardingjdbc/proxy/packet/MySQLReceivedPacket.java
浏览文件 @
0439c61d
...
...
@@ -22,7 +22,7 @@ package io.shardingjdbc.proxy.packet;
*
* @author zhangliang
*/
public
abstract
class
AbstractMySQLReceivedPacket
extends
Abstract
MySQLPacket
{
public
abstract
class
MySQLReceivedPacket
extends
MySQLPacket
{
/**
* Read packet from byte buffer.
...
...
@@ -31,5 +31,5 @@ public abstract class AbstractMySQLReceivedPacket extends AbstractMySQLPacket {
*
* @return instance of received packet
*/
public
abstract
Abstract
MySQLReceivedPacket
read
(
MySQLPacketPayload
mysqlPacketPayload
);
public
abstract
MySQLReceivedPacket
read
(
MySQLPacketPayload
mysqlPacketPayload
);
}
sharding-proxy/src/main/java/io/shardingjdbc/proxy/packet/
Abstract
MySQLSentPacket.java
→
sharding-proxy/src/main/java/io/shardingjdbc/proxy/packet/MySQLSentPacket.java
浏览文件 @
0439c61d
...
...
@@ -22,7 +22,7 @@ package io.shardingjdbc.proxy.packet;
*
* @author zhangliang
*/
public
abstract
class
AbstractMySQLSentPacket
extends
Abstract
MySQLPacket
{
public
abstract
class
MySQLSentPacket
extends
MySQLPacket
{
/**
* Write packet to byte buffer.
...
...
sharding-proxy/src/main/java/io/shardingjdbc/proxy/packet/command/ColumnDefinition41Packet.java
浏览文件 @
0439c61d
...
...
@@ -20,7 +20,7 @@ package io.shardingjdbc.proxy.packet.command;
import
io.shardingjdbc.proxy.constant.ColumnType
;
import
io.shardingjdbc.proxy.constant.ServerInfo
;
import
io.shardingjdbc.proxy.packet.MySQLPacketPayload
;
import
io.shardingjdbc.proxy.packet.
Abstract
MySQLSentPacket
;
import
io.shardingjdbc.proxy.packet.MySQLSentPacket
;
/**
* Column definition above MySQL 4.1 packet protocol.
...
...
@@ -28,7 +28,7 @@ import io.shardingjdbc.proxy.packet.AbstractMySQLSentPacket;
*
* @author zhangliang
*/
public
final
class
ColumnDefinition41Packet
extends
Abstract
MySQLSentPacket
{
public
final
class
ColumnDefinition41Packet
extends
MySQLSentPacket
{
private
final
String
catalog
=
"def"
;
...
...
sharding-proxy/src/main/java/io/shardingjdbc/proxy/packet/command/ComFieldListPacket.java
浏览文件 @
0439c61d
...
...
@@ -21,7 +21,7 @@ import io.shardingjdbc.core.constant.ShardingConstant;
import
io.shardingjdbc.proxy.DataSourceManager
;
import
io.shardingjdbc.proxy.constant.ColumnType
;
import
io.shardingjdbc.proxy.constant.StatusFlag
;
import
io.shardingjdbc.proxy.packet.
Abstract
MySQLSentPacket
;
import
io.shardingjdbc.proxy.packet.MySQLSentPacket
;
import
io.shardingjdbc.proxy.packet.MySQLPacketPayload
;
import
io.shardingjdbc.proxy.packet.ok.EofPacket
;
import
io.shardingjdbc.proxy.packet.ok.ErrPacket
;
...
...
@@ -41,7 +41,7 @@ import java.util.List;
* @author zhangliang
*/
@Slf4j
public
final
class
ComFieldListPacket
extends
Abstract
CommandPacket
{
public
final
class
ComFieldListPacket
extends
CommandPacket
{
private
String
table
;
...
...
@@ -57,9 +57,9 @@ public final class ComFieldListPacket extends AbstractCommandPacket {
}
@Override
public
List
<
Abstract
MySQLSentPacket
>
execute
()
{
public
List
<
MySQLSentPacket
>
execute
()
{
String
sql
=
String
.
format
(
"SHOW COLUMNS FROM %s FROM %s"
,
table
,
ShardingConstant
.
LOGIC_SCHEMA_NAME
);
List
<
Abstract
MySQLSentPacket
>
result
=
new
LinkedList
<>();
List
<
MySQLSentPacket
>
result
=
new
LinkedList
<>();
int
currentSequenceId
=
getSequenceId
();
try
(
Connection
conn
=
DataSourceManager
.
getInstance
().
getDataSource
().
getConnection
();
...
...
sharding-proxy/src/main/java/io/shardingjdbc/proxy/packet/command/ComInitDbPacket.java
浏览文件 @
0439c61d
...
...
@@ -19,7 +19,7 @@ package io.shardingjdbc.proxy.packet.command;
import
io.shardingjdbc.core.constant.ShardingConstant
;
import
io.shardingjdbc.proxy.constant.StatusFlag
;
import
io.shardingjdbc.proxy.packet.
Abstract
MySQLSentPacket
;
import
io.shardingjdbc.proxy.packet.MySQLSentPacket
;
import
io.shardingjdbc.proxy.packet.MySQLPacketPayload
;
import
io.shardingjdbc.proxy.packet.ok.ErrPacket
;
import
io.shardingjdbc.proxy.packet.ok.OKPacket
;
...
...
@@ -35,7 +35,7 @@ import java.util.List;
* @author zhangliang
*/
@Slf4j
public
final
class
ComInitDbPacket
extends
Abstract
CommandPacket
{
public
final
class
ComInitDbPacket
extends
CommandPacket
{
private
String
schemaName
;
...
...
@@ -47,10 +47,10 @@ public final class ComInitDbPacket extends AbstractCommandPacket {
}
@Override
public
List
<
Abstract
MySQLSentPacket
>
execute
()
{
public
List
<
MySQLSentPacket
>
execute
()
{
if
(
ShardingConstant
.
LOGIC_SCHEMA_NAME
.
equalsIgnoreCase
(
schemaName
))
{
return
Collections
.<
Abstract
MySQLSentPacket
>
singletonList
(
new
OKPacket
(
getSequenceId
()
+
1
,
0
,
0
,
StatusFlag
.
SERVER_STATUS_AUTOCOMMIT
.
getValue
(),
0
,
""
));
return
Collections
.<
MySQLSentPacket
>
singletonList
(
new
OKPacket
(
getSequenceId
()
+
1
,
0
,
0
,
StatusFlag
.
SERVER_STATUS_AUTOCOMMIT
.
getValue
(),
0
,
""
));
}
return
Collections
.<
Abstract
MySQLSentPacket
>
singletonList
(
new
ErrPacket
(
getSequenceId
()
+
1
,
1049
,
""
,
""
,
String
.
format
(
"Unknown database '%s'"
,
schemaName
)));
return
Collections
.<
MySQLSentPacket
>
singletonList
(
new
ErrPacket
(
getSequenceId
()
+
1
,
1049
,
""
,
""
,
String
.
format
(
"Unknown database '%s'"
,
schemaName
)));
}
}
sharding-proxy/src/main/java/io/shardingjdbc/proxy/packet/command/ComQueryPacket.java
浏览文件 @
0439c61d
...
...
@@ -22,7 +22,7 @@ import io.shardingjdbc.core.parsing.parser.sql.SQLStatement;
import
io.shardingjdbc.proxy.DataSourceManager
;
import
io.shardingjdbc.proxy.constant.ColumnType
;
import
io.shardingjdbc.proxy.constant.StatusFlag
;
import
io.shardingjdbc.proxy.packet.
Abstract
MySQLSentPacket
;
import
io.shardingjdbc.proxy.packet.MySQLSentPacket
;
import
io.shardingjdbc.proxy.packet.MySQLPacketPayload
;
import
io.shardingjdbc.proxy.packet.ok.EofPacket
;
import
io.shardingjdbc.proxy.packet.ok.ErrPacket
;
...
...
@@ -44,7 +44,7 @@ import java.util.List;
* @author zhangliang
*/
@Slf4j
public
final
class
ComQueryPacket
extends
Abstract
CommandPacket
{
public
final
class
ComQueryPacket
extends
CommandPacket
{
private
String
sql
;
...
...
@@ -56,8 +56,8 @@ public final class ComQueryPacket extends AbstractCommandPacket {
}
@Override
public
List
<
Abstract
MySQLSentPacket
>
execute
()
{
List
<
Abstract
MySQLSentPacket
>
result
=
new
LinkedList
<>();
public
List
<
MySQLSentPacket
>
execute
()
{
List
<
MySQLSentPacket
>
result
=
new
LinkedList
<>();
int
currentSequenceId
=
getSequenceId
();
try
(
Connection
conn
=
DataSourceManager
.
getInstance
().
getDataSource
().
getConnection
();
...
...
sharding-proxy/src/main/java/io/shardingjdbc/proxy/packet/command/ComQuitPacket.java
浏览文件 @
0439c61d
...
...
@@ -18,7 +18,7 @@
package
io.shardingjdbc.proxy.packet.command
;
import
io.shardingjdbc.proxy.constant.StatusFlag
;
import
io.shardingjdbc.proxy.packet.
Abstract
MySQLSentPacket
;
import
io.shardingjdbc.proxy.packet.MySQLSentPacket
;
import
io.shardingjdbc.proxy.packet.MySQLPacketPayload
;
import
io.shardingjdbc.proxy.packet.ok.OKPacket
;
...
...
@@ -31,7 +31,7 @@ import java.util.List;
*
* @author zhangliang
*/
public
final
class
ComQuitPacket
extends
Abstract
CommandPacket
{
public
final
class
ComQuitPacket
extends
CommandPacket
{
@Override
public
ComQuitPacket
read
(
final
MySQLPacketPayload
mysqlPacketPayload
)
{
...
...
@@ -39,7 +39,7 @@ public final class ComQuitPacket extends AbstractCommandPacket {
}
@Override
public
List
<
Abstract
MySQLSentPacket
>
execute
()
{
return
Collections
.<
Abstract
MySQLSentPacket
>
singletonList
(
new
OKPacket
(
getSequenceId
()
+
1
,
0
,
0
,
StatusFlag
.
SERVER_STATUS_AUTOCOMMIT
.
getValue
(),
0
,
""
));
public
List
<
MySQLSentPacket
>
execute
()
{
return
Collections
.<
MySQLSentPacket
>
singletonList
(
new
OKPacket
(
getSequenceId
()
+
1
,
0
,
0
,
StatusFlag
.
SERVER_STATUS_AUTOCOMMIT
.
getValue
(),
0
,
""
));
}
}
sharding-proxy/src/main/java/io/shardingjdbc/proxy/packet/command/
Abstract
CommandPacket.java
→
sharding-proxy/src/main/java/io/shardingjdbc/proxy/packet/command/CommandPacket.java
浏览文件 @
0439c61d
...
...
@@ -17,8 +17,8 @@
package
io.shardingjdbc.proxy.packet.command
;
import
io.shardingjdbc.proxy.packet.
Abstract
MySQLReceivedPacket
;
import
io.shardingjdbc.proxy.packet.
Abstract
MySQLSentPacket
;
import
io.shardingjdbc.proxy.packet.MySQLReceivedPacket
;
import
io.shardingjdbc.proxy.packet.MySQLSentPacket
;
import
java.util.List
;
...
...
@@ -27,12 +27,12 @@ import java.util.List;
*
* @author zhangliang
*/
public
abstract
class
AbstractCommandPacket
extends
Abstract
MySQLReceivedPacket
{
public
abstract
class
CommandPacket
extends
MySQLReceivedPacket
{
/**
* Execute command.
*
* @return result packets to be sent
*/
public
abstract
List
<
Abstract
MySQLSentPacket
>
execute
();
public
abstract
List
<
MySQLSentPacket
>
execute
();
}
sharding-proxy/src/main/java/io/shardingjdbc/proxy/packet/command/CommandPacketFactory.java
浏览文件 @
0439c61d
...
...
@@ -30,7 +30,7 @@ public final class CommandPacketFactory {
* @param commandPacketTypeValue command packet type value
* @return Command packet
*/
public
static
Abstract
CommandPacket
getCommandPacket
(
final
int
commandPacketTypeValue
)
{
public
static
CommandPacket
getCommandPacket
(
final
int
commandPacketTypeValue
)
{
CommandPacketType
type
=
CommandPacketType
.
valueOf
(
commandPacketTypeValue
);
switch
(
type
)
{
case
COM_QUIT:
...
...
sharding-proxy/src/main/java/io/shardingjdbc/proxy/packet/command/FieldCountPacket.java
浏览文件 @
0439c61d
...
...
@@ -18,7 +18,7 @@
package
io.shardingjdbc.proxy.packet.command
;
import
io.shardingjdbc.proxy.packet.MySQLPacketPayload
;
import
io.shardingjdbc.proxy.packet.
Abstract
MySQLSentPacket
;
import
io.shardingjdbc.proxy.packet.MySQLSentPacket
;
/**
* COM_QUERY response field count packet.
...
...
@@ -26,7 +26,7 @@ import io.shardingjdbc.proxy.packet.AbstractMySQLSentPacket;
*
* @author zhangliang
*/
public
final
class
FieldCountPacket
extends
Abstract
MySQLSentPacket
{
public
final
class
FieldCountPacket
extends
MySQLSentPacket
{
private
final
long
columnCount
;
...
...
sharding-proxy/src/main/java/io/shardingjdbc/proxy/packet/command/TextResultSetRowPacket.java
浏览文件 @
0439c61d
...
...
@@ -18,7 +18,7 @@
package
io.shardingjdbc.proxy.packet.command
;
import
io.shardingjdbc.proxy.packet.MySQLPacketPayload
;
import
io.shardingjdbc.proxy.packet.
Abstract
MySQLSentPacket
;
import
io.shardingjdbc.proxy.packet.MySQLSentPacket
;
import
java.util.List
;
...
...
@@ -28,7 +28,7 @@ import java.util.List;
*
* @author zhangliang
*/
public
final
class
TextResultSetRowPacket
extends
Abstract
MySQLSentPacket
{
public
final
class
TextResultSetRowPacket
extends
MySQLSentPacket
{
private
static
final
int
NULL
=
0xfb
;
...
...
sharding-proxy/src/main/java/io/shardingjdbc/proxy/packet/command/UnsupportedCommandPacket.java
浏览文件 @
0439c61d
...
...
@@ -18,7 +18,7 @@
package
io.shardingjdbc.proxy.packet.command
;
import
io.shardingjdbc.proxy.packet.MySQLPacketPayload
;
import
io.shardingjdbc.proxy.packet.
Abstract
MySQLSentPacket
;
import
io.shardingjdbc.proxy.packet.MySQLSentPacket
;
import
io.shardingjdbc.proxy.packet.ok.ErrPacket
;
import
lombok.RequiredArgsConstructor
;
...
...
@@ -31,7 +31,7 @@ import java.util.List;
* @author zhangliang
*/
@RequiredArgsConstructor
public
final
class
UnsupportedCommandPacket
extends
Abstract
CommandPacket
{
public
final
class
UnsupportedCommandPacket
extends
CommandPacket
{
private
static
final
int
ERROR_CODE
=
0xcc
;
...
...
@@ -49,7 +49,7 @@ public final class UnsupportedCommandPacket extends AbstractCommandPacket {
}
@Override
public
List
<
Abstract
MySQLSentPacket
>
execute
()
{
return
Collections
.<
Abstract
MySQLSentPacket
>
singletonList
(
new
ErrPacket
(
getSequenceId
()
+
1
,
ERROR_CODE
,
SQL_STATE_MARKER
,
SQL_STATE
,
String
.
format
(
ERROR_MESSAGE
,
type
)));
public
List
<
MySQLSentPacket
>
execute
()
{
return
Collections
.<
MySQLSentPacket
>
singletonList
(
new
ErrPacket
(
getSequenceId
()
+
1
,
ERROR_CODE
,
SQL_STATE_MARKER
,
SQL_STATE
,
String
.
format
(
ERROR_MESSAGE
,
type
)));
}
}
sharding-proxy/src/main/java/io/shardingjdbc/proxy/packet/handshake/HandshakePacket.java
浏览文件 @
0439c61d
...
...
@@ -21,7 +21,7 @@ import io.shardingjdbc.proxy.constant.CapabilityFlag;
import
io.shardingjdbc.proxy.constant.ServerInfo
;
import
io.shardingjdbc.proxy.constant.StatusFlag
;
import
io.shardingjdbc.proxy.packet.MySQLPacketPayload
;
import
io.shardingjdbc.proxy.packet.
Abstract
MySQLSentPacket
;
import
io.shardingjdbc.proxy.packet.MySQLSentPacket
;
import
lombok.Getter
;
/**
...
...
@@ -32,7 +32,7 @@ import lombok.Getter;
* @author zhangliang
*/
@Getter
public
class
HandshakePacket
extends
Abstract
MySQLSentPacket
{
public
class
HandshakePacket
extends
MySQLSentPacket
{
private
final
int
protocolVersion
=
ServerInfo
.
PROTOCOL_VERSION
;
...
...
sharding-proxy/src/main/java/io/shardingjdbc/proxy/packet/handshake/HandshakeResponse41Packet.java
浏览文件 @
0439c61d
...
...
@@ -19,7 +19,7 @@ package io.shardingjdbc.proxy.packet.handshake;
import
io.shardingjdbc.proxy.constant.CapabilityFlag
;
import
io.shardingjdbc.proxy.packet.MySQLPacketPayload
;
import
io.shardingjdbc.proxy.packet.
Abstract
MySQLReceivedPacket
;
import
io.shardingjdbc.proxy.packet.MySQLReceivedPacket
;
import
lombok.Getter
;
/**
...
...
@@ -29,7 +29,7 @@ import lombok.Getter;
* @author zhangliang
*/
@Getter
public
final
class
HandshakeResponse41Packet
extends
Abstract
MySQLReceivedPacket
{
public
final
class
HandshakeResponse41Packet
extends
MySQLReceivedPacket
{
private
int
capabilityFlags
;
...
...
sharding-proxy/src/main/java/io/shardingjdbc/proxy/packet/ok/EofPacket.java
浏览文件 @
0439c61d
...
...
@@ -18,7 +18,7 @@
package
io.shardingjdbc.proxy.packet.ok
;
import
io.shardingjdbc.proxy.packet.MySQLPacketPayload
;
import
io.shardingjdbc.proxy.packet.
Abstract
MySQLSentPacket
;
import
io.shardingjdbc.proxy.packet.MySQLSentPacket
;
import
lombok.Getter
;
/**
...
...
@@ -28,7 +28,7 @@ import lombok.Getter;
* @author zhangliang
*/
@Getter
public
class
EofPacket
extends
Abstract
MySQLSentPacket
{
public
class
EofPacket
extends
MySQLSentPacket
{
private
static
final
int
HEADER
=
0xfe
;
...
...
sharding-proxy/src/main/java/io/shardingjdbc/proxy/packet/ok/ErrPacket.java
浏览文件 @
0439c61d
...
...
@@ -18,7 +18,7 @@
package
io.shardingjdbc.proxy.packet.ok
;
import
io.shardingjdbc.proxy.packet.MySQLPacketPayload
;
import
io.shardingjdbc.proxy.packet.
Abstract
MySQLSentPacket
;
import
io.shardingjdbc.proxy.packet.MySQLSentPacket
;
import
lombok.Getter
;
/**
...
...
@@ -28,7 +28,7 @@ import lombok.Getter;
* @author zhangliang
*/
@Getter
public
class
ErrPacket
extends
Abstract
MySQLSentPacket
{
public
class
ErrPacket
extends
MySQLSentPacket
{
private
static
final
int
HEADER
=
0xff
;
...
...
sharding-proxy/src/main/java/io/shardingjdbc/proxy/packet/ok/OKPacket.java
浏览文件 @
0439c61d
...
...
@@ -18,7 +18,7 @@
package
io.shardingjdbc.proxy.packet.ok
;
import
io.shardingjdbc.proxy.packet.MySQLPacketPayload
;
import
io.shardingjdbc.proxy.packet.
Abstract
MySQLSentPacket
;
import
io.shardingjdbc.proxy.packet.MySQLSentPacket
;
import
lombok.Getter
;
/**
...
...
@@ -28,7 +28,7 @@ import lombok.Getter;
* @author zhangliang
*/
@Getter
public
class
OKPacket
extends
Abstract
MySQLSentPacket
{
public
class
OKPacket
extends
MySQLSentPacket
{
private
static
final
int
HEADER
=
0x00
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录