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 2020/09/07 13:59:39 UTC

[GitHub] [shardingsphere] tuohai666 opened a new pull request #7300: #6872, concurrent truncate

tuohai666 opened a new pull request #7300:
URL: https://github.com/apache/shardingsphere/pull/7300


   For #6872.
   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [shardingsphere] terrymanu merged pull request #7300: #6872, concurrent truncate

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


   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [shardingsphere] terrymanu commented on a change in pull request #7300: #6872, concurrent truncate

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



##########
File path: shardingsphere-integration-test/shardingsphere-test-suite/src/test/java/org/apache/shardingsphere/dbtest/env/dataset/DataSetEnvironmentManager.java
##########
@@ -126,25 +132,18 @@ private void setParameters(final PreparedStatement preparedStatement, final SQLV
     /**
      * Clear data.
      * 
-     * @throws SQLException SQL exception
      */
-    public void clear() throws SQLException {
+    public void clear() {
+        List<Callable<Boolean>> clearNodes = new ArrayList<>();

Review comment:
       Please use LinkedList or use initial size for ArrayList




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [shardingsphere] terrymanu commented on a change in pull request #7300: #6872, concurrent truncate

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



##########
File path: shardingsphere-integration-test/shardingsphere-test-suite/src/test/java/org/apache/shardingsphere/dbtest/env/dataset/DataSetEnvironmentManager.java
##########
@@ -187,4 +186,25 @@ private String generateTableName(final String tableName, final DatabaseType data
                 throw new UnsupportedOperationException(String.format("Cannot support database [%s].", databaseType));
         }
     }
+    
+    @RequiredArgsConstructor
+    private static class CallableClear implements Callable<Boolean> {

Review comment:
       It is better to rename `CallableClear` to `ClearTask`

##########
File path: shardingsphere-integration-test/shardingsphere-test-suite/src/test/java/org/apache/shardingsphere/dbtest/env/dataset/DataSetEnvironmentManager.java
##########
@@ -126,25 +132,18 @@ private void setParameters(final PreparedStatement preparedStatement, final SQLV
     /**
      * Clear data.
      * 
-     * @throws SQLException SQL exception
      */
-    public void clear() throws SQLException {
+    public void clear() {
+        List<Callable<Boolean>> clearNodes = new ArrayList<>();
         for (Entry<String, Collection<String>> entry : getDataNodeMap().entrySet()) {
-            clear(entry.getKey(), entry.getValue());
+            CallableClear callableClear = new CallableClear(dataSourceMap.get(entry.getKey()), entry.getValue());
+            clearNodes.add(callableClear);

Review comment:
       `new CallableClear` can be inline into clearNodes.add

##########
File path: shardingsphere-integration-test/shardingsphere-test-suite/src/test/java/org/apache/shardingsphere/dbtest/env/dataset/DataSetEnvironmentManager.java
##########
@@ -126,25 +132,18 @@ private void setParameters(final PreparedStatement preparedStatement, final SQLV
     /**
      * Clear data.
      * 
-     * @throws SQLException SQL exception
      */
-    public void clear() throws SQLException {
+    public void clear() {
+        List<Callable<Boolean>> clearNodes = new ArrayList<>();

Review comment:
       It is better to rename `clearNodes` to `clearTasks`




----------------------------------------------------------------
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:
users@infra.apache.org