You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by zh...@apache.org on 2024/08/13 05:16:35 UTC

(shardingsphere) branch master updated: Refactor ShardingSpherePipelineDataSourceCreator.updateConfigurationProperties() (#32484)

This is an automated email from the ASF dual-hosted git repository.

zhaojinchao pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git


The following commit(s) were added to refs/heads/master by this push:
     new f0e1ee9bc26 Refactor ShardingSpherePipelineDataSourceCreator.updateConfigurationProperties() (#32484)
f0e1ee9bc26 is described below

commit f0e1ee9bc268e1a8a0c9585c89b18259a7a29356
Author: Liang Zhang <zh...@apache.org>
AuthorDate: Tue Aug 13 13:16:29 2024 +0800

    Refactor ShardingSpherePipelineDataSourceCreator.updateConfigurationProperties() (#32484)
---
 .../creator/ShardingSpherePipelineDataSourceCreator.java      | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/core/datasource/creator/ShardingSpherePipelineDataSourceCreator.java b/kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/core/datasource/creator/ShardingSpherePipelineDataSourceCreator.java
index a7aa5f5a69c..984fd7e7020 100644
--- a/kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/core/datasource/creator/ShardingSpherePipelineDataSourceCreator.java
+++ b/kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/core/datasource/creator/ShardingSpherePipelineDataSourceCreator.java
@@ -46,6 +46,7 @@ import java.util.Collection;
 import java.util.Collections;
 import java.util.Map;
 import java.util.Optional;
+import java.util.Properties;
 import java.util.concurrent.atomic.AtomicInteger;
 
 /**
@@ -61,7 +62,7 @@ public final class ShardingSpherePipelineDataSourceCreator implements PipelineDa
         removeAuthorityRuleConfiguration(yamlRootConfig);
         updateSingleRuleConfiguration(yamlRootConfig);
         disableSystemSchemaMetadata(yamlRootConfig);
-        enableStreamingQuery(yamlRootConfig);
+        updateConfigurationProperties(yamlRootConfig);
         updateShardingRuleConfiguration(yamlRootConfig);
         yamlRootConfig.setMode(createStandaloneModeConfiguration());
         return createShardingSphereDataSource(yamlRootConfig);
@@ -82,10 +83,12 @@ public final class ShardingSpherePipelineDataSourceCreator implements PipelineDa
         yamlRootConfig.getProps().put(TemporaryConfigurationPropertyKey.SYSTEM_SCHEMA_METADATA_ASSEMBLY_ENABLED.getKey(), String.valueOf(Boolean.FALSE));
     }
     
-    // TODO Another way is improving ExecuteQueryCallback.executeSQL to enable streaming query, then remove it
-    private void enableStreamingQuery(final YamlRootConfiguration yamlRootConfig) {
+    private void updateConfigurationProperties(final YamlRootConfiguration yamlRootConfig) {
+        Properties newProps = new Properties();
         // Set a large enough value to enable ConnectionMode.MEMORY_STRICTLY, make sure streaming query work.
-        yamlRootConfig.getProps().put(ConfigurationPropertyKey.MAX_CONNECTIONS_SIZE_PER_QUERY.getKey(), 100000);
+        // TODO Another way is improving ExecuteQueryCallback.executeSQL to enable streaming query, then remove it
+        newProps.put(ConfigurationPropertyKey.MAX_CONNECTIONS_SIZE_PER_QUERY.getKey(), 100000);
+        yamlRootConfig.setProps(newProps);
     }
     
     private void updateShardingRuleConfiguration(final YamlRootConfiguration yamlRootConfig) {