This is an automated email from the ASF dual-hosted git repository.
yangzhg pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-doris.git
The following commit(s) were added to refs/heads/master by this push:
new 80c4007 [Refactor] Refactor ConnectProcessor's code doc and unused
code (#6823)
80c4007 is described below
commit 80c4007a342a6fd781c2e5c77414edfa7ff05ede
Author: Wei <[email protected]>
AuthorDate: Wed Oct 13 11:44:29 2021 +0800
[Refactor] Refactor ConnectProcessor's code doc and unused code (#6823)
Co-authored-by: wei.zhang2 <[email protected]>
---
.../java/org/apache/doris/qe/ConnectProcessor.java | 18 ++++++++----------
1 file changed, 8 insertions(+), 10 deletions(-)
diff --git a/fe/fe-core/src/main/java/org/apache/doris/qe/ConnectProcessor.java
b/fe/fe-core/src/main/java/org/apache/doris/qe/ConnectProcessor.java
index 32f5435..836e160 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/qe/ConnectProcessor.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/qe/ConnectProcessor.java
@@ -161,8 +161,8 @@ public class ConnectProcessor {
Catalog.getCurrentAuditEventProcessor().handleAuditEvent(ctx.getAuditEventBuilder().build());
}
- // process COM_QUERY statement,
- // 只有在与请求客户端交互出现问题时候才抛出异常
+ // Process COM_QUERY statement,
+ // only throw an exception when there is a problem interacting with the
requesting client
private void handleQuery() {
MetricRepo.COUNTER_REQUEST_ALL.increase(1L);
// convert statement to Java string
@@ -288,10 +288,8 @@ public class ConnectProcessor {
private void handleFieldList() throws IOException {
// Already get command code.
String tableName = null;
- String pattern = null;
try {
tableName = new
String(MysqlProto.readNulTerminateString(packetBuf), "UTF-8");
- pattern = new String(MysqlProto.readEofString(packetBuf), "UTF-8");
} catch (UnsupportedEncodingException e) {
// Impossible!!!
LOG.error("Unknown UTF-8 character set.");
@@ -370,9 +368,9 @@ public class ConnectProcessor {
private ByteBuffer getResultPacket() {
MysqlPacket packet = ctx.getState().toResponsePacket();
if (packet == null) {
- // 当出现此种情况可能有两种可能
- // 1. 处理函数已经发送请求
- // 2. 这个协议不需要发送任何响应包
+ // possible two cases:
+ // 1. handler has send request
+ // 2. this command need not to send response
return null;
}
@@ -382,8 +380,8 @@ public class ConnectProcessor {
return serializer.toByteBuffer();
}
- // 当任何一个请求完成后,一般都会需要发送一个响应包给客户端
- // 这个函数用于发送响应包给客户端
+ // When any request is completed, it will generally need to send a
response packet to the client
+ // This method is used to send a response packet to the client
private void finalizeCommand() throws IOException {
ByteBuffer packet = null;
if (executor != null && executor.isForwardToMaster()
@@ -530,7 +528,7 @@ public class ConnectProcessor {
return result;
}
- // 处理一个MySQL请求,接收,处理,返回
+ // Process a MySQL request
public void processOnce() throws IOException {
// set status of query to OK.
ctx.getState().reset();
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]