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:36:14 UTC
(shardingsphere) branch master updated: Refactor ShardingSpherePipelineDataSourceCreator (#32486)
This is an automated email from the ASF dual-hosted git repository.
zhangliang 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 4a7ef1f7db2 Refactor ShardingSpherePipelineDataSourceCreator (#32486)
4a7ef1f7db2 is described below
commit 4a7ef1f7db2b62091c39ba314e5796b5061232ef
Author: Liang Zhang <zh...@apache.org>
AuthorDate: Tue Aug 13 13:36:08 2024 +0800
Refactor ShardingSpherePipelineDataSourceCreator (#32486)
---
.../creator/ShardingSpherePipelineDataSourceCreator.java | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 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 984fd7e7020..2b40cb06739 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,7 +46,6 @@ 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 +60,6 @@ public final class ShardingSpherePipelineDataSourceCreator implements PipelineDa
YamlRootConfiguration yamlRootConfig = YamlEngine.unmarshal(YamlEngine.marshal(dataSourceConfig), YamlRootConfiguration.class);
removeAuthorityRuleConfiguration(yamlRootConfig);
updateSingleRuleConfiguration(yamlRootConfig);
- disableSystemSchemaMetadata(yamlRootConfig);
updateConfigurationProperties(yamlRootConfig);
updateShardingRuleConfiguration(yamlRootConfig);
yamlRootConfig.setMode(createStandaloneModeConfiguration());
@@ -79,16 +77,19 @@ public final class ShardingSpherePipelineDataSourceCreator implements PipelineDa
yamlRootConfig.getRules().add(singleRuleConfig);
}
+ private void updateConfigurationProperties(final YamlRootConfiguration yamlRootConfig) {
+ disableSystemSchemaMetadata(yamlRootConfig);
+ enableStreamingQuery(yamlRootConfig);
+ }
+
private void disableSystemSchemaMetadata(final YamlRootConfiguration yamlRootConfig) {
yamlRootConfig.getProps().put(TemporaryConfigurationPropertyKey.SYSTEM_SCHEMA_METADATA_ASSEMBLY_ENABLED.getKey(), String.valueOf(Boolean.FALSE));
}
- private void updateConfigurationProperties(final YamlRootConfiguration yamlRootConfig) {
- Properties newProps = new Properties();
+ // TODO Another way is improving ExecuteQueryCallback.executeSQL to enable streaming query, then remove it
+ private void enableStreamingQuery(final YamlRootConfiguration yamlRootConfig) {
// Set a large enough value to enable ConnectionMode.MEMORY_STRICTLY, make sure streaming query work.
- // 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);
+ yamlRootConfig.getProps().put(ConfigurationPropertyKey.MAX_CONNECTIONS_SIZE_PER_QUERY.getKey(), 100000);
}
private void updateShardingRuleConfiguration(final YamlRootConfiguration yamlRootConfig) {