You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2022/01/25 05:40:11 UTC

[GitHub] [shardingsphere] TeslaCN opened a new pull request #15045: Remove unnecessary method invocations

TeslaCN opened a new pull request #15045:
URL: https://github.com/apache/shardingsphere/pull/15045


   Related to #10626.
   


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] terrymanu merged pull request #15045: Migrate type of execute results to List in proxy backend

Posted by GitBox <gi...@apache.org>.
terrymanu merged pull request #15045:
URL: https://github.com/apache/shardingsphere/pull/15045


   


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] terrymanu commented on a change in pull request #15045: Remove unnecessary method invocations

Posted by GitBox <gi...@apache.org>.
terrymanu commented on a change in pull request #15045:
URL: https://github.com/apache/shardingsphere/pull/15045#discussion_r791482793



##########
File path: shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/communication/jdbc/JDBCDatabaseCommunicationEngine.java
##########
@@ -129,8 +129,8 @@ public ResponseHeader execute() {
         refreshMetaData(executionContext);
         ExecuteResult executeResultSample = result.iterator().next();
         return executeResultSample instanceof QueryResult
-                ? processExecuteQuery(executionContext, result.stream().map(each -> (QueryResult) each).collect(Collectors.toList()), (QueryResult) executeResultSample)
-                : processExecuteUpdate(executionContext, result.stream().map(each -> (UpdateResult) each).collect(Collectors.toList()));
+                ? processExecuteQuery(executionContext, (List) result, (QueryResult) executeResultSample)
+                : processExecuteUpdate(executionContext, (List) result);

Review comment:
       Can we consider about change the result of `proxySQLExecutor.execute(executionContext)` as List?




-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] TeslaCN commented on a change in pull request #15045: Migrate type of execute results to List in proxy backend

Posted by GitBox <gi...@apache.org>.
TeslaCN commented on a change in pull request #15045:
URL: https://github.com/apache/shardingsphere/pull/15045#discussion_r792340382



##########
File path: shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/communication/jdbc/JDBCDatabaseCommunicationEngine.java
##########
@@ -129,8 +129,8 @@ public ResponseHeader execute() {
         refreshMetaData(executionContext);
         ExecuteResult executeResultSample = result.iterator().next();
         return executeResultSample instanceof QueryResult
-                ? processExecuteQuery(executionContext, result.stream().map(each -> (QueryResult) each).collect(Collectors.toList()), (QueryResult) executeResultSample)
-                : processExecuteUpdate(executionContext, result.stream().map(each -> (UpdateResult) each).collect(Collectors.toList()));
+                ? processExecuteQuery(executionContext, (List) result, (QueryResult) executeResultSample)
+                : processExecuteUpdate(executionContext, (List) result);

Review comment:
       @terrymanu I've migrated some Collection to List. But I have to use raw type because the List in method's parameter accepts different generic types.




-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] terrymanu commented on a change in pull request #15045: Remove unnecessary method invocations

Posted by GitBox <gi...@apache.org>.
terrymanu commented on a change in pull request #15045:
URL: https://github.com/apache/shardingsphere/pull/15045#discussion_r791482793



##########
File path: shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/communication/jdbc/JDBCDatabaseCommunicationEngine.java
##########
@@ -129,8 +129,8 @@ public ResponseHeader execute() {
         refreshMetaData(executionContext);
         ExecuteResult executeResultSample = result.iterator().next();
         return executeResultSample instanceof QueryResult
-                ? processExecuteQuery(executionContext, result.stream().map(each -> (QueryResult) each).collect(Collectors.toList()), (QueryResult) executeResultSample)
-                : processExecuteUpdate(executionContext, result.stream().map(each -> (UpdateResult) each).collect(Collectors.toList()));
+                ? processExecuteQuery(executionContext, (List) result, (QueryResult) executeResultSample)
+                : processExecuteUpdate(executionContext, (List) result);

Review comment:
       Can we consider about change the result of `proxySQLExecutor.execute(executionContext)` as List?




-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] TeslaCN commented on a change in pull request #15045: Remove unnecessary method invocations

Posted by GitBox <gi...@apache.org>.
TeslaCN commented on a change in pull request #15045:
URL: https://github.com/apache/shardingsphere/pull/15045#discussion_r791486082



##########
File path: shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/communication/jdbc/JDBCDatabaseCommunicationEngine.java
##########
@@ -129,8 +129,8 @@ public ResponseHeader execute() {
         refreshMetaData(executionContext);
         ExecuteResult executeResultSample = result.iterator().next();
         return executeResultSample instanceof QueryResult
-                ? processExecuteQuery(executionContext, result.stream().map(each -> (QueryResult) each).collect(Collectors.toList()), (QueryResult) executeResultSample)
-                : processExecuteUpdate(executionContext, result.stream().map(each -> (UpdateResult) each).collect(Collectors.toList()));
+                ? processExecuteQuery(executionContext, (List) result, (QueryResult) executeResultSample)
+                : processExecuteUpdate(executionContext, (List) result);

Review comment:
       Sure.




-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] TeslaCN commented on a change in pull request #15045: Remove unnecessary method invocations

Posted by GitBox <gi...@apache.org>.
TeslaCN commented on a change in pull request #15045:
URL: https://github.com/apache/shardingsphere/pull/15045#discussion_r791486082



##########
File path: shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/communication/jdbc/JDBCDatabaseCommunicationEngine.java
##########
@@ -129,8 +129,8 @@ public ResponseHeader execute() {
         refreshMetaData(executionContext);
         ExecuteResult executeResultSample = result.iterator().next();
         return executeResultSample instanceof QueryResult
-                ? processExecuteQuery(executionContext, result.stream().map(each -> (QueryResult) each).collect(Collectors.toList()), (QueryResult) executeResultSample)
-                : processExecuteUpdate(executionContext, result.stream().map(each -> (UpdateResult) each).collect(Collectors.toList()));
+                ? processExecuteQuery(executionContext, (List) result, (QueryResult) executeResultSample)
+                : processExecuteUpdate(executionContext, (List) result);

Review comment:
       Sure.




-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org