[GitHub] [incubator-shardingsphere] tuohai666 commented on a change in pull request #3034: Optimize performance, reduce unnecessary loops

2019-09-16 Thread GitBox
tuohai666 commented on a change in pull request #3034: Optimize performance, 
reduce unnecessary loops
URL: 
https://github.com/apache/incubator-shardingsphere/pull/3034#discussion_r324596480
 
 

 ##
 File path: 
sharding-proxy/sharding-proxy-transport/sharding-proxy-transport-mysql/src/main/java/org/apache/shardingsphere/shardingproxy/transport/mysql/packet/command/MySQLCommandPacketType.java
 ##
 @@ -21,6 +21,9 @@
 import lombok.RequiredArgsConstructor;
 import 
org.apache.shardingsphere.shardingproxy.transport.packet.CommandPacketType;
 
+import java.util.HashMap;
 
 Review comment:
   Accept.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [incubator-shardingsphere] tuohai666 commented on a change in pull request #3034: Optimize performance, reduce unnecessary loops

2019-09-16 Thread GitBox
tuohai666 commented on a change in pull request #3034: Optimize performance, 
reduce unnecessary loops
URL: 
https://github.com/apache/incubator-shardingsphere/pull/3034#discussion_r324596480
 
 

 ##
 File path: 
sharding-proxy/sharding-proxy-transport/sharding-proxy-transport-mysql/src/main/java/org/apache/shardingsphere/shardingproxy/transport/mysql/packet/command/MySQLCommandPacketType.java
 ##
 @@ -21,6 +21,9 @@
 import lombok.RequiredArgsConstructor;
 import 
org.apache.shardingsphere.shardingproxy.transport.packet.CommandPacketType;
 
+import java.util.HashMap;
 
 Review comment:
   Accept.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [incubator-shardingsphere] tuohai666 commented on a change in pull request #3034: Optimize performance, reduce unnecessary loops

2019-09-16 Thread GitBox
tuohai666 commented on a change in pull request #3034: Optimize performance, 
reduce unnecessary loops
URL: 
https://github.com/apache/incubator-shardingsphere/pull/3034#discussion_r324560696
 
 

 ##
 File path: 
sharding-proxy/sharding-proxy-transport/sharding-proxy-transport-mysql/src/main/java/org/apache/shardingsphere/shardingproxy/transport/mysql/packet/command/MySQLCommandPacketType.java
 ##
 @@ -253,6 +256,17 @@
  * @see https://dev.mysql.com/doc/internals/en/com-reset-connection.html;>COM_RESET_CONNECTION
  */
 COM_RESET_CONNECTION(0x1f);
+
+/**
+ * The cache map for MySQLCommandPacketType.
+ */
+private static final Map 
MYSQL_COMMAND_PACKET_TYPE_CACHE = new HashMap() {
 
 Review comment:
   @yanickxia
   You are right. Effectively <> turns off the type checking, rather than 
providing type inference. An anonymous class stores the actual generic type and 
so you have to provide it.
   
   @yanyzy I'm afraid you have to recover the line 263 to origin, you had 
already made it perfect.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [incubator-shardingsphere] tuohai666 commented on a change in pull request #3034: Optimize performance, reduce unnecessary loops

2019-09-16 Thread GitBox
tuohai666 commented on a change in pull request #3034: Optimize performance, 
reduce unnecessary loops
URL: 
https://github.com/apache/incubator-shardingsphere/pull/3034#discussion_r324541812
 
 

 ##
 File path: 
sharding-proxy/sharding-proxy-transport/sharding-proxy-transport-mysql/src/main/java/org/apache/shardingsphere/shardingproxy/transport/mysql/packet/command/MySQLCommandPacketType.java
 ##
 @@ -253,6 +256,17 @@
  * @see https://dev.mysql.com/doc/internals/en/com-reset-connection.html;>COM_RESET_CONNECTION
  */
 COM_RESET_CONNECTION(0x1f);
+
+/**
+ * The cache map for MySQLCommandPacketType.
+ */
+private static final Map 
MYSQL_COMMAND_PACKET_TYPE_CACHE = new HashMap() {
 
 Review comment:
   @yanickxia
   What does it mean? Can you explicitly point out the problem and suggestion?


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [incubator-shardingsphere] tuohai666 commented on a change in pull request #3034: Optimize performance, reduce unnecessary loops

2019-09-16 Thread GitBox
tuohai666 commented on a change in pull request #3034: Optimize performance, 
reduce unnecessary loops
URL: 
https://github.com/apache/incubator-shardingsphere/pull/3034#discussion_r324541812
 
 

 ##
 File path: 
sharding-proxy/sharding-proxy-transport/sharding-proxy-transport-mysql/src/main/java/org/apache/shardingsphere/shardingproxy/transport/mysql/packet/command/MySQLCommandPacketType.java
 ##
 @@ -253,6 +256,17 @@
  * @see https://dev.mysql.com/doc/internals/en/com-reset-connection.html;>COM_RESET_CONNECTION
  */
 COM_RESET_CONNECTION(0x1f);
+
+/**
+ * The cache map for MySQLCommandPacketType.
+ */
+private static final Map 
MYSQL_COMMAND_PACKET_TYPE_CACHE = new HashMap() {
 
 Review comment:
   > WARNING
   
   What does it mean? Can you explicitly point out the problem and suggestion?


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [incubator-shardingsphere] tuohai666 commented on a change in pull request #3034: Optimize performance, reduce unnecessary loops

2019-09-15 Thread GitBox
tuohai666 commented on a change in pull request #3034: Optimize performance, 
reduce unnecessary loops
URL: 
https://github.com/apache/incubator-shardingsphere/pull/3034#discussion_r324511936
 
 

 ##
 File path: 
sharding-proxy/sharding-proxy-transport/sharding-proxy-transport-mysql/src/main/java/org/apache/shardingsphere/shardingproxy/transport/mysql/packet/command/MySQLCommandPacketType.java
 ##
 @@ -253,6 +256,17 @@
  * @see https://dev.mysql.com/doc/internals/en/com-reset-connection.html;>COM_RESET_CONNECTION
  */
 COM_RESET_CONNECTION(0x1f);
+
+/**
+ * The cache map for MySQLCommandPacketType.
+ */
+private static final Map 
MYSQL_COMMAND_PACKET_TYPE_CACHE = new HashMap() {
 
 Review comment:
   The second  can be omitted.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [incubator-shardingsphere] tuohai666 commented on a change in pull request #3034: Optimize performance, reduce unnecessary loops

2019-09-15 Thread GitBox
tuohai666 commented on a change in pull request #3034: Optimize performance, 
reduce unnecessary loops
URL: 
https://github.com/apache/incubator-shardingsphere/pull/3034#discussion_r324511229
 
 

 ##
 File path: 
sharding-proxy/sharding-proxy-transport/sharding-proxy-transport-mysql/src/main/java/org/apache/shardingsphere/shardingproxy/transport/mysql/packet/command/MySQLCommandPacketType.java
 ##
 @@ -253,6 +256,17 @@
  * @see https://dev.mysql.com/doc/internals/en/com-reset-connection.html;>COM_RESET_CONNECTION
  */
 COM_RESET_CONNECTION(0x1f);
+
+/**
 
 Review comment:
   The private method usually don't need a comment, can you remove it?


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services