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 2021/06/26 15:54:27 UTC
[GitHub] [shardingsphere] totalo opened a new pull request #11028: improve code style for issue#10678
totalo opened a new pull request #11028:
URL: https://github.com/apache/shardingsphere/pull/11028
--
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] totalo commented on a change in pull request #11028: improve code for #10840
Posted by GitBox <gi...@apache.org>.
totalo commented on a change in pull request #11028:
URL: https://github.com/apache/shardingsphere/pull/11028#discussion_r661985587
##########
File path: shardingsphere-infra/shardingsphere-infra-context/src/main/java/org/apache/shardingsphere/infra/context/metadata/MetaDataContextsBuilder.java
##########
@@ -94,21 +96,21 @@ public StandardMetaDataContexts build() throws SQLException {
Collection<RuleConfiguration> ruleConfigs = schemaRuleConfigs.get(each);
DatabaseType databaseType = DatabaseTypeRecognizer.getDatabaseType(dataSourceMap.values());
Collection<ShardingSphereRule> rules = ShardingSphereRulesBuilder.buildSchemaRules(each, ruleConfigs, databaseType, dataSourceMap);
- Map<Map<String, TableMetaData>, Map<String, TableMetaData>> tableMetaDataMap = SchemaBuilder.build(new SchemaBuilderMaterials(databaseType, dataSourceMap, rules, props));
+ Map<TableMetaData, TableMetaData> tableMetaDatas = SchemaBuilder.build(new SchemaBuilderMaterials(databaseType, dataSourceMap, rules, props));
ShardingSphereRuleMetaData ruleMetaData = new ShardingSphereRuleMetaData(ruleConfigs, rules);
ShardingSphereResource resource = buildResource(databaseType, dataSourceMap);
- ShardingSphereSchema actualSchema = new ShardingSphereSchema(tableMetaDataMap.keySet().iterator().next());
+ ShardingSphereSchema actualSchema = new ShardingSphereSchema(tableMetaDatas.keySet().stream().filter(Objects::nonNull).collect(Collectors.toMap(TableMetaData::getName, v -> v)));
actualMetaDataMap.put(each, new ShardingSphereMetaData(each, resource, ruleMetaData, actualSchema));
- metaDataMap.put(each, new ShardingSphereMetaData(each, resource, ruleMetaData, buildSchema(tableMetaDataMap)));
+ metaDataMap.put(each, new ShardingSphereMetaData(each, resource, ruleMetaData, buildSchema(tableMetaDatas)));
}
OptimizeContextFactory optimizeContextFactory = new OptimizeContextFactory(actualMetaDataMap);
return new StandardMetaDataContexts(metaDataMap, buildGlobalSchemaMetaData(metaDataMap), executorEngine, props, optimizeContextFactory);
}
-
- private ShardingSphereSchema buildSchema(final Map<Map<String, TableMetaData>, Map<String, TableMetaData>> tableMetaDataMap) {
- Map<String, TableMetaData> tables = new HashMap<>(tableMetaDataMap.size(), 1);
- tables.putAll(tableMetaDataMap.keySet().iterator().next());
- tables.putAll(tableMetaDataMap.values().iterator().next());
+
+ private ShardingSphereSchema buildSchema(final Map<TableMetaData, TableMetaData> tableMetaDatas) {
Review comment:
@tristaZero hi , I fixed this issue in #11086 .
--
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] tristaZero commented on a change in pull request #11028: improve code for #10840
Posted by GitBox <gi...@apache.org>.
tristaZero commented on a change in pull request #11028:
URL: https://github.com/apache/shardingsphere/pull/11028#discussion_r659293172
##########
File path: shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/metadata/schema/model/TableMetaDatas.java
##########
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shardingsphere.infra.metadata.schema.model;
+
+import lombok.Getter;
+import lombok.RequiredArgsConstructor;
+
+import java.util.Map;
+
+@RequiredArgsConstructor
+@Getter
+public class TableMetaDatas {
+
+ private final Map<String, TableMetaData> actualTableMeta;
Review comment:
Is it necessary?
##########
File path: shardingsphere-infra/shardingsphere-infra-context/src/main/java/org/apache/shardingsphere/infra/context/metadata/MetaDataContextsBuilder.java
##########
@@ -94,21 +95,21 @@ public StandardMetaDataContexts build() throws SQLException {
Collection<RuleConfiguration> ruleConfigs = schemaRuleConfigs.get(each);
DatabaseType databaseType = DatabaseTypeRecognizer.getDatabaseType(dataSourceMap.values());
Collection<ShardingSphereRule> rules = ShardingSphereRulesBuilder.buildSchemaRules(each, ruleConfigs, databaseType, dataSourceMap);
- Map<Map<String, TableMetaData>, Map<String, TableMetaData>> tableMetaDataMap = SchemaBuilder.build(new SchemaBuilderMaterials(databaseType, dataSourceMap, rules, props));
+ TableMetaDatas tableMetaDatas = SchemaBuilder.build(new SchemaBuilderMaterials(databaseType, dataSourceMap, rules, props));
Review comment:
Mayb a Map<LogicTableMetaData, ActualTableMetaData> is a concise variable to build? So that we can remove `TableMetaDatas` and `Map<Map<String, TableMetaData>, Map<String, TableMetaData>>`.
##########
File path: shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/metadata/schema/model/TableMetaData.java
##########
@@ -47,10 +49,15 @@
private final List<String> primaryKeyColumns = new ArrayList<>();
public TableMetaData() {
- this(Collections.emptyList(), Collections.emptyList());
+ this(null, Collections.emptyList(), Collections.emptyList());
Review comment:
An empty string is better than null to avoid npe from my point.
--
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] tristaZero commented on a change in pull request #11028: improve code for #10840
Posted by GitBox <gi...@apache.org>.
tristaZero commented on a change in pull request #11028:
URL: https://github.com/apache/shardingsphere/pull/11028#discussion_r660214739
##########
File path: shardingsphere-infra/shardingsphere-infra-context/src/main/java/org/apache/shardingsphere/infra/context/metadata/impl/StandardMetaDataContexts.java
##########
@@ -54,23 +55,8 @@
private final StateContext stateContext;
public StandardMetaDataContexts() {
- this(new LinkedHashMap<>(),
- new ShardingSphereRuleMetaData(Collections.emptyList(), Collections.emptyList()), null, new ConfigurationProperties(new Properties()));
- }
-
- /**
- * todo remove this deprecated constructor.
- * @deprecated old
- */
- @Deprecated
- public StandardMetaDataContexts(final Map<String, ShardingSphereMetaData> metaDataMap, final ShardingSphereRuleMetaData globalRuleMetaData,
- final ExecutorEngine executorEngine, final ConfigurationProperties props) {
- this.metaDataMap = new LinkedHashMap<>(metaDataMap);
- this.globalRuleMetaData = globalRuleMetaData;
- this.executorEngine = executorEngine;
- optimizeContextFactory = new OptimizeContextFactory(metaDataMap);
- this.props = props;
- stateContext = new StateContext();
+ this(new LinkedHashMap<>(), new ShardingSphereRuleMetaData(Collections.emptyList(), Collections.emptyList()),
+ null, new ConfigurationProperties(new Properties()), new OptimizeContextFactory(new HashMap<>()));
Review comment:
Is there any reference for this constructor?
##########
File path: shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/metadata/schema/model/TableMetaDatas.java
##########
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shardingsphere.infra.metadata.schema.model;
+
+import lombok.Getter;
+import lombok.RequiredArgsConstructor;
+
+import java.util.Map;
+
+@RequiredArgsConstructor
+@Getter
+public class TableMetaDatas {
+
+ private final Map<String, TableMetaData> actualTableMeta;
Review comment:
So it is needed?
--
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] tristaZero commented on a change in pull request #11028: improve code for #10840
Posted by GitBox <gi...@apache.org>.
tristaZero commented on a change in pull request #11028:
URL: https://github.com/apache/shardingsphere/pull/11028#discussion_r659504459
##########
File path: shardingsphere-infra/shardingsphere-infra-context/src/main/java/org/apache/shardingsphere/infra/context/metadata/MetaDataContextsBuilder.java
##########
@@ -94,21 +95,21 @@ public StandardMetaDataContexts build() throws SQLException {
Collection<RuleConfiguration> ruleConfigs = schemaRuleConfigs.get(each);
DatabaseType databaseType = DatabaseTypeRecognizer.getDatabaseType(dataSourceMap.values());
Collection<ShardingSphereRule> rules = ShardingSphereRulesBuilder.buildSchemaRules(each, ruleConfigs, databaseType, dataSourceMap);
- Map<Map<String, TableMetaData>, Map<String, TableMetaData>> tableMetaDataMap = SchemaBuilder.build(new SchemaBuilderMaterials(databaseType, dataSourceMap, rules, props));
+ TableMetaDatas tableMetaDatas = SchemaBuilder.build(new SchemaBuilderMaterials(databaseType, dataSourceMap, rules, props));
Review comment:
It is supposed that one actual tableMetadata has a corresponding logic tableMetaData, isn't it?
Suppose `ShardingSphereSchema` has all the `decorated` tableMetaData, the `OptimizeContextFactory` will own all the non-`decoreated` tableMetaData, right?
--
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] totalo commented on a change in pull request #11028: improve code for #10840
Posted by GitBox <gi...@apache.org>.
totalo commented on a change in pull request #11028:
URL: https://github.com/apache/shardingsphere/pull/11028#discussion_r659322484
##########
File path: shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/metadata/schema/model/TableMetaData.java
##########
@@ -47,10 +49,15 @@
private final List<String> primaryKeyColumns = new ArrayList<>();
public TableMetaData() {
- this(Collections.emptyList(), Collections.emptyList());
+ this(null, Collections.emptyList(), Collections.emptyList());
Review comment:
Yes, I agree.
--
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] codecov-commenter edited a comment on pull request #11028: improve code for #10840
Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #11028:
URL: https://github.com/apache/shardingsphere/pull/11028#issuecomment-869026629
# [Codecov](https://codecov.io/gh/apache/shardingsphere/pull/11028?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#11028](https://codecov.io/gh/apache/shardingsphere/pull/11028?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (f13c791) into [master](https://codecov.io/gh/apache/shardingsphere/commit/5f08c67fd718380a417cb8d6e9263d3ec4b005e2?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (5f08c67) will **decrease** coverage by `0.00%`.
> The diff coverage is `96.77%`.
[![Impacted file tree graph](https://codecov.io/gh/apache/shardingsphere/pull/11028/graphs/tree.svg?width=650&height=150&src=pr&token=ZvlXpWa7so&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/shardingsphere/pull/11028?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
```diff
@@ Coverage Diff @@
## master #11028 +/- ##
============================================
- Coverage 65.30% 65.29% -0.01%
Complexity 704 704
============================================
Files 1851 1851
Lines 31116 31126 +10
Branches 5603 5604 +1
============================================
+ Hits 20319 20325 +6
- Misses 9187 9191 +4
Partials 1610 1610
```
| [Impacted Files](https://codecov.io/gh/apache/shardingsphere/pull/11028?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [...harding/metadata/ShardingTableMetaDataBuilder.java](https://codecov.io/gh/apache/shardingsphere/pull/11028/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtc2hhcmRpbmcvc2hhcmRpbmdzcGhlcmUtc2hhcmRpbmctY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvc2hhcmRpbmcvbWV0YWRhdGEvU2hhcmRpbmdUYWJsZU1ldGFEYXRhQnVpbGRlci5qYXZh) | `0.00% <0.00%> (ø)` | |
| [...ontext/metadata/impl/StandardMetaDataContexts.java](https://codecov.io/gh/apache/shardingsphere/pull/11028/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtaW5mcmEvc2hhcmRpbmdzcGhlcmUtaW5mcmEtY29udGV4dC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvaW5mcmEvY29udGV4dC9tZXRhZGF0YS9pbXBsL1N0YW5kYXJkTWV0YURhdGFDb250ZXh0cy5qYXZh) | `81.25% <0.00%> (-2.75%)` | :arrow_down: |
| [.../encrypt/metadata/EncryptTableMetaDataBuilder.java](https://codecov.io/gh/apache/shardingsphere/pull/11028/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtZW5jcnlwdC9zaGFyZGluZ3NwaGVyZS1lbmNyeXB0LWNvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2VuY3J5cHQvbWV0YWRhdGEvRW5jcnlwdFRhYmxlTWV0YURhdGFCdWlsZGVyLmphdmE=) | `95.00% <100.00%> (+0.26%)` | :arrow_up: |
| [...e/context/metadata/GovernanceMetaDataContexts.java](https://codecov.io/gh/apache/shardingsphere/pull/11028/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtZ292ZXJuYW5jZS9zaGFyZGluZ3NwaGVyZS1nb3Zlcm5hbmNlLWNvbnRleHQvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2dvdmVybmFuY2UvY29udGV4dC9tZXRhZGF0YS9Hb3Zlcm5hbmNlTWV0YURhdGFDb250ZXh0cy5qYXZh) | `78.97% <100.00%> (-1.63%)` | :arrow_down: |
| [...ce/core/yaml/schema/swapper/SchemaYamlSwapper.java](https://codecov.io/gh/apache/shardingsphere/pull/11028/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtZ292ZXJuYW5jZS9zaGFyZGluZ3NwaGVyZS1nb3Zlcm5hbmNlLWNvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2dvdmVybmFuY2UvY29yZS95YW1sL3NjaGVtYS9zd2FwcGVyL1NjaGVtYVlhbWxTd2FwcGVyLmphdmE=) | `93.54% <100.00%> (ø)` | |
| [...e/infra/metadata/schema/builder/SchemaBuilder.java](https://codecov.io/gh/apache/shardingsphere/pull/11028/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtaW5mcmEvc2hhcmRpbmdzcGhlcmUtaW5mcmEtY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9pbmZyYS9tZXRhZGF0YS9zY2hlbWEvYnVpbGRlci9TY2hlbWFCdWlsZGVyLmphdmE=) | `69.62% <100.00%> (+1.19%)` | :arrow_up: |
| [.../metadata/schema/builder/TableMetaDataBuilder.java](https://codecov.io/gh/apache/shardingsphere/pull/11028/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtaW5mcmEvc2hhcmRpbmdzcGhlcmUtaW5mcmEtY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9pbmZyYS9tZXRhZGF0YS9zY2hlbWEvYnVpbGRlci9UYWJsZU1ldGFEYXRhQnVpbGRlci5qYXZh) | `90.47% <100.00%> (+0.47%)` | :arrow_up: |
| [...ata/schema/builder/loader/TableMetaDataLoader.java](https://codecov.io/gh/apache/shardingsphere/pull/11028/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtaW5mcmEvc2hhcmRpbmdzcGhlcmUtaW5mcmEtY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9pbmZyYS9tZXRhZGF0YS9zY2hlbWEvYnVpbGRlci9sb2FkZXIvVGFibGVNZXRhRGF0YUxvYWRlci5qYXZh) | `80.00% <100.00%> (ø)` | |
| [.../builder/loader/dialect/H2TableMetaDataLoader.java](https://codecov.io/gh/apache/shardingsphere/pull/11028/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtaW5mcmEvc2hhcmRpbmdzcGhlcmUtaW5mcmEtY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9pbmZyYS9tZXRhZGF0YS9zY2hlbWEvYnVpbGRlci9sb2FkZXIvZGlhbGVjdC9IMlRhYmxlTWV0YURhdGFMb2FkZXIuamF2YQ==) | `87.05% <100.00%> (ø)` | |
| [...ilder/loader/dialect/MySQLTableMetaDataLoader.java](https://codecov.io/gh/apache/shardingsphere/pull/11028/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtaW5mcmEvc2hhcmRpbmdzcGhlcmUtaW5mcmEtY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9pbmZyYS9tZXRhZGF0YS9zY2hlbWEvYnVpbGRlci9sb2FkZXIvZGlhbGVjdC9NeVNRTFRhYmxlTWV0YURhdGFMb2FkZXIuamF2YQ==) | `86.79% <100.00%> (ø)` | |
| ... and [6 more](https://codecov.io/gh/apache/shardingsphere/pull/11028/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/shardingsphere/pull/11028?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/shardingsphere/pull/11028?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [5f08c67...f13c791](https://codecov.io/gh/apache/shardingsphere/pull/11028?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
--
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] codecov-commenter edited a comment on pull request #11028: improve code for #10840
Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #11028:
URL: https://github.com/apache/shardingsphere/pull/11028#issuecomment-869026629
# [Codecov](https://codecov.io/gh/apache/shardingsphere/pull/11028?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#11028](https://codecov.io/gh/apache/shardingsphere/pull/11028?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (4b914d4) into [master](https://codecov.io/gh/apache/shardingsphere/commit/940e053f45b5c1e2acd3c18bb9baf88c2b244b4f?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (940e053) will **decrease** coverage by `0.01%`.
> The diff coverage is `92.59%`.
[![Impacted file tree graph](https://codecov.io/gh/apache/shardingsphere/pull/11028/graphs/tree.svg?width=650&height=150&src=pr&token=ZvlXpWa7so&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/shardingsphere/pull/11028?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
```diff
@@ Coverage Diff @@
## master #11028 +/- ##
============================================
- Coverage 65.16% 65.15% -0.02%
Complexity 701 701
============================================
Files 1827 1827
Lines 30862 30866 +4
Branches 5556 5556
============================================
- Hits 20112 20110 -2
- Misses 9159 9165 +6
Partials 1591 1591
```
| [Impacted Files](https://codecov.io/gh/apache/shardingsphere/pull/11028?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [...harding/metadata/ShardingTableMetaDataBuilder.java](https://codecov.io/gh/apache/shardingsphere/pull/11028/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtc2hhcmRpbmcvc2hhcmRpbmdzcGhlcmUtc2hhcmRpbmctY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvc2hhcmRpbmcvbWV0YWRhdGEvU2hhcmRpbmdUYWJsZU1ldGFEYXRhQnVpbGRlci5qYXZh) | `0.00% <0.00%> (ø)` | |
| [...ontext/metadata/impl/StandardMetaDataContexts.java](https://codecov.io/gh/apache/shardingsphere/pull/11028/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtaW5mcmEvc2hhcmRpbmdzcGhlcmUtaW5mcmEtY29udGV4dC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvaW5mcmEvY29udGV4dC9tZXRhZGF0YS9pbXBsL1N0YW5kYXJkTWV0YURhdGFDb250ZXh0cy5qYXZh) | `81.25% <0.00%> (-2.75%)` | :arrow_down: |
| [...ere/infra/metadata/schema/model/TableMetaData.java](https://codecov.io/gh/apache/shardingsphere/pull/11028/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtaW5mcmEvc2hhcmRpbmdzcGhlcmUtaW5mcmEtY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9pbmZyYS9tZXRhZGF0YS9zY2hlbWEvbW9kZWwvVGFibGVNZXRhRGF0YS5qYXZh) | `90.32% <60.00%> (-6.11%)` | :arrow_down: |
| [.../encrypt/metadata/EncryptTableMetaDataBuilder.java](https://codecov.io/gh/apache/shardingsphere/pull/11028/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtZW5jcnlwdC9zaGFyZGluZ3NwaGVyZS1lbmNyeXB0LWNvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2VuY3J5cHQvbWV0YWRhdGEvRW5jcnlwdFRhYmxlTWV0YURhdGFCdWlsZGVyLmphdmE=) | `95.00% <100.00%> (+0.26%)` | :arrow_up: |
| [...e/context/metadata/GovernanceMetaDataContexts.java](https://codecov.io/gh/apache/shardingsphere/pull/11028/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtZ292ZXJuYW5jZS9zaGFyZGluZ3NwaGVyZS1nb3Zlcm5hbmNlLWNvbnRleHQvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2dvdmVybmFuY2UvY29udGV4dC9tZXRhZGF0YS9Hb3Zlcm5hbmNlTWV0YURhdGFDb250ZXh0cy5qYXZh) | `78.97% <100.00%> (-1.63%)` | :arrow_down: |
| [...ce/core/yaml/schema/swapper/SchemaYamlSwapper.java](https://codecov.io/gh/apache/shardingsphere/pull/11028/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtZ292ZXJuYW5jZS9zaGFyZGluZ3NwaGVyZS1nb3Zlcm5hbmNlLWNvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2dvdmVybmFuY2UvY29yZS95YW1sL3NjaGVtYS9zd2FwcGVyL1NjaGVtYVlhbWxTd2FwcGVyLmphdmE=) | `93.54% <100.00%> (ø)` | |
| [...e/infra/metadata/schema/builder/SchemaBuilder.java](https://codecov.io/gh/apache/shardingsphere/pull/11028/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtaW5mcmEvc2hhcmRpbmdzcGhlcmUtaW5mcmEtY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9pbmZyYS9tZXRhZGF0YS9zY2hlbWEvYnVpbGRlci9TY2hlbWFCdWlsZGVyLmphdmE=) | `67.56% <100.00%> (-0.86%)` | :arrow_down: |
| [...ata/schema/builder/loader/TableMetaDataLoader.java](https://codecov.io/gh/apache/shardingsphere/pull/11028/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtaW5mcmEvc2hhcmRpbmdzcGhlcmUtaW5mcmEtY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9pbmZyYS9tZXRhZGF0YS9zY2hlbWEvYnVpbGRlci9sb2FkZXIvVGFibGVNZXRhRGF0YUxvYWRlci5qYXZh) | `80.00% <100.00%> (ø)` | |
| [.../builder/loader/dialect/H2TableMetaDataLoader.java](https://codecov.io/gh/apache/shardingsphere/pull/11028/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtaW5mcmEvc2hhcmRpbmdzcGhlcmUtaW5mcmEtY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9pbmZyYS9tZXRhZGF0YS9zY2hlbWEvYnVpbGRlci9sb2FkZXIvZGlhbGVjdC9IMlRhYmxlTWV0YURhdGFMb2FkZXIuamF2YQ==) | `87.05% <100.00%> (ø)` | |
| [...ilder/loader/dialect/MySQLTableMetaDataLoader.java](https://codecov.io/gh/apache/shardingsphere/pull/11028/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtaW5mcmEvc2hhcmRpbmdzcGhlcmUtaW5mcmEtY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9pbmZyYS9tZXRhZGF0YS9zY2hlbWEvYnVpbGRlci9sb2FkZXIvZGlhbGVjdC9NeVNRTFRhYmxlTWV0YURhdGFMb2FkZXIuamF2YQ==) | `86.79% <100.00%> (ø)` | |
| ... and [5 more](https://codecov.io/gh/apache/shardingsphere/pull/11028/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/shardingsphere/pull/11028?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/shardingsphere/pull/11028?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [940e053...4b914d4](https://codecov.io/gh/apache/shardingsphere/pull/11028?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
--
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] totalo commented on pull request #11028: improve code for #10840
Posted by GitBox <gi...@apache.org>.
totalo commented on pull request #11028:
URL: https://github.com/apache/shardingsphere/pull/11028#issuecomment-869163590
> Hi @totalo
> You exactly pay more effort on this PR, appreciated your work.
> Here are some comments FYI.
I am very happy to have the opportunity to participate in SS, and I am very happy to do 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.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] tristaZero merged pull request #11028: improve code for #10840
Posted by GitBox <gi...@apache.org>.
tristaZero merged pull request #11028:
URL: https://github.com/apache/shardingsphere/pull/11028
--
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] tristaZero commented on a change in pull request #11028: improve code for #10840
Posted by GitBox <gi...@apache.org>.
tristaZero commented on a change in pull request #11028:
URL: https://github.com/apache/shardingsphere/pull/11028#discussion_r661147202
##########
File path: shardingsphere-infra/shardingsphere-infra-context/src/main/java/org/apache/shardingsphere/infra/context/metadata/impl/StandardMetaDataContexts.java
##########
@@ -54,23 +55,8 @@
private final StateContext stateContext;
public StandardMetaDataContexts() {
- this(new LinkedHashMap<>(),
- new ShardingSphereRuleMetaData(Collections.emptyList(), Collections.emptyList()), null, new ConfigurationProperties(new Properties()));
- }
-
- /**
- * todo remove this deprecated constructor.
- * @deprecated old
- */
- @Deprecated
- public StandardMetaDataContexts(final Map<String, ShardingSphereMetaData> metaDataMap, final ShardingSphereRuleMetaData globalRuleMetaData,
- final ExecutorEngine executorEngine, final ConfigurationProperties props) {
- this.metaDataMap = new LinkedHashMap<>(metaDataMap);
- this.globalRuleMetaData = globalRuleMetaData;
- this.executorEngine = executorEngine;
- optimizeContextFactory = new OptimizeContextFactory(metaDataMap);
- this.props = props;
- stateContext = new StateContext();
+ this(new LinkedHashMap<>(), new ShardingSphereRuleMetaData(Collections.emptyList(), Collections.emptyList()),
+ null, new ConfigurationProperties(new Properties()), new OptimizeContextFactory(new HashMap<>()));
Review comment:
Got it, therefore this is resolved.
--
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] totalo commented on a change in pull request #11028: improve code for #10840
Posted by GitBox <gi...@apache.org>.
totalo commented on a change in pull request #11028:
URL: https://github.com/apache/shardingsphere/pull/11028#discussion_r659322384
##########
File path: shardingsphere-infra/shardingsphere-infra-context/src/main/java/org/apache/shardingsphere/infra/context/metadata/MetaDataContextsBuilder.java
##########
@@ -94,21 +95,21 @@ public StandardMetaDataContexts build() throws SQLException {
Collection<RuleConfiguration> ruleConfigs = schemaRuleConfigs.get(each);
DatabaseType databaseType = DatabaseTypeRecognizer.getDatabaseType(dataSourceMap.values());
Collection<ShardingSphereRule> rules = ShardingSphereRulesBuilder.buildSchemaRules(each, ruleConfigs, databaseType, dataSourceMap);
- Map<Map<String, TableMetaData>, Map<String, TableMetaData>> tableMetaDataMap = SchemaBuilder.build(new SchemaBuilderMaterials(databaseType, dataSourceMap, rules, props));
+ TableMetaDatas tableMetaDatas = SchemaBuilder.build(new SchemaBuilderMaterials(databaseType, dataSourceMap, rules, props));
Review comment:
But the `Map` only allows a `NULL` key, which may cause some tables to be missing. What do you think? Or something else like `Pair`?
--
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] codecov-commenter commented on pull request #11028: improve code style for #10840
Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on pull request #11028:
URL: https://github.com/apache/shardingsphere/pull/11028#issuecomment-869026629
# [Codecov](https://codecov.io/gh/apache/shardingsphere/pull/11028?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#11028](https://codecov.io/gh/apache/shardingsphere/pull/11028?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (07b7647) into [master](https://codecov.io/gh/apache/shardingsphere/commit/940e053f45b5c1e2acd3c18bb9baf88c2b244b4f?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (940e053) will **decrease** coverage by `0.01%`.
> The diff coverage is `92.59%`.
[![Impacted file tree graph](https://codecov.io/gh/apache/shardingsphere/pull/11028/graphs/tree.svg?width=650&height=150&src=pr&token=ZvlXpWa7so&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/shardingsphere/pull/11028?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
```diff
@@ Coverage Diff @@
## master #11028 +/- ##
============================================
- Coverage 65.16% 65.15% -0.02%
Complexity 701 701
============================================
Files 1827 1827
Lines 30862 30866 +4
Branches 5556 5556
============================================
- Hits 20112 20110 -2
- Misses 9159 9165 +6
Partials 1591 1591
```
| [Impacted Files](https://codecov.io/gh/apache/shardingsphere/pull/11028?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [...harding/metadata/ShardingTableMetaDataBuilder.java](https://codecov.io/gh/apache/shardingsphere/pull/11028/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtc2hhcmRpbmcvc2hhcmRpbmdzcGhlcmUtc2hhcmRpbmctY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvc2hhcmRpbmcvbWV0YWRhdGEvU2hhcmRpbmdUYWJsZU1ldGFEYXRhQnVpbGRlci5qYXZh) | `0.00% <0.00%> (ø)` | |
| [...ontext/metadata/impl/StandardMetaDataContexts.java](https://codecov.io/gh/apache/shardingsphere/pull/11028/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtaW5mcmEvc2hhcmRpbmdzcGhlcmUtaW5mcmEtY29udGV4dC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvaW5mcmEvY29udGV4dC9tZXRhZGF0YS9pbXBsL1N0YW5kYXJkTWV0YURhdGFDb250ZXh0cy5qYXZh) | `81.25% <0.00%> (-2.75%)` | :arrow_down: |
| [...ere/infra/metadata/schema/model/TableMetaData.java](https://codecov.io/gh/apache/shardingsphere/pull/11028/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtaW5mcmEvc2hhcmRpbmdzcGhlcmUtaW5mcmEtY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9pbmZyYS9tZXRhZGF0YS9zY2hlbWEvbW9kZWwvVGFibGVNZXRhRGF0YS5qYXZh) | `90.32% <60.00%> (-6.11%)` | :arrow_down: |
| [.../encrypt/metadata/EncryptTableMetaDataBuilder.java](https://codecov.io/gh/apache/shardingsphere/pull/11028/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtZW5jcnlwdC9zaGFyZGluZ3NwaGVyZS1lbmNyeXB0LWNvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2VuY3J5cHQvbWV0YWRhdGEvRW5jcnlwdFRhYmxlTWV0YURhdGFCdWlsZGVyLmphdmE=) | `95.00% <100.00%> (+0.26%)` | :arrow_up: |
| [...e/context/metadata/GovernanceMetaDataContexts.java](https://codecov.io/gh/apache/shardingsphere/pull/11028/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtZ292ZXJuYW5jZS9zaGFyZGluZ3NwaGVyZS1nb3Zlcm5hbmNlLWNvbnRleHQvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2dvdmVybmFuY2UvY29udGV4dC9tZXRhZGF0YS9Hb3Zlcm5hbmNlTWV0YURhdGFDb250ZXh0cy5qYXZh) | `78.97% <100.00%> (-1.63%)` | :arrow_down: |
| [...ce/core/yaml/schema/swapper/SchemaYamlSwapper.java](https://codecov.io/gh/apache/shardingsphere/pull/11028/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtZ292ZXJuYW5jZS9zaGFyZGluZ3NwaGVyZS1nb3Zlcm5hbmNlLWNvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2dvdmVybmFuY2UvY29yZS95YW1sL3NjaGVtYS9zd2FwcGVyL1NjaGVtYVlhbWxTd2FwcGVyLmphdmE=) | `93.54% <100.00%> (ø)` | |
| [...e/infra/metadata/schema/builder/SchemaBuilder.java](https://codecov.io/gh/apache/shardingsphere/pull/11028/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtaW5mcmEvc2hhcmRpbmdzcGhlcmUtaW5mcmEtY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9pbmZyYS9tZXRhZGF0YS9zY2hlbWEvYnVpbGRlci9TY2hlbWFCdWlsZGVyLmphdmE=) | `67.56% <100.00%> (-0.86%)` | :arrow_down: |
| [...ata/schema/builder/loader/TableMetaDataLoader.java](https://codecov.io/gh/apache/shardingsphere/pull/11028/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtaW5mcmEvc2hhcmRpbmdzcGhlcmUtaW5mcmEtY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9pbmZyYS9tZXRhZGF0YS9zY2hlbWEvYnVpbGRlci9sb2FkZXIvVGFibGVNZXRhRGF0YUxvYWRlci5qYXZh) | `80.00% <100.00%> (ø)` | |
| [.../builder/loader/dialect/H2TableMetaDataLoader.java](https://codecov.io/gh/apache/shardingsphere/pull/11028/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtaW5mcmEvc2hhcmRpbmdzcGhlcmUtaW5mcmEtY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9pbmZyYS9tZXRhZGF0YS9zY2hlbWEvYnVpbGRlci9sb2FkZXIvZGlhbGVjdC9IMlRhYmxlTWV0YURhdGFMb2FkZXIuamF2YQ==) | `87.05% <100.00%> (ø)` | |
| [...ilder/loader/dialect/MySQLTableMetaDataLoader.java](https://codecov.io/gh/apache/shardingsphere/pull/11028/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtaW5mcmEvc2hhcmRpbmdzcGhlcmUtaW5mcmEtY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9pbmZyYS9tZXRhZGF0YS9zY2hlbWEvYnVpbGRlci9sb2FkZXIvZGlhbGVjdC9NeVNRTFRhYmxlTWV0YURhdGFMb2FkZXIuamF2YQ==) | `86.79% <100.00%> (ø)` | |
| ... and [5 more](https://codecov.io/gh/apache/shardingsphere/pull/11028/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/shardingsphere/pull/11028?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/shardingsphere/pull/11028?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [940e053...07b7647](https://codecov.io/gh/apache/shardingsphere/pull/11028?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
--
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] codecov-commenter edited a comment on pull request #11028: improve code for #10840
Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #11028:
URL: https://github.com/apache/shardingsphere/pull/11028#issuecomment-869026629
# [Codecov](https://codecov.io/gh/apache/shardingsphere/pull/11028?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#11028](https://codecov.io/gh/apache/shardingsphere/pull/11028?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (f13c791) into [master](https://codecov.io/gh/apache/shardingsphere/commit/5f08c67fd718380a417cb8d6e9263d3ec4b005e2?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (5f08c67) will **decrease** coverage by `0.00%`.
> The diff coverage is `96.77%`.
[![Impacted file tree graph](https://codecov.io/gh/apache/shardingsphere/pull/11028/graphs/tree.svg?width=650&height=150&src=pr&token=ZvlXpWa7so&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/shardingsphere/pull/11028?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
```diff
@@ Coverage Diff @@
## master #11028 +/- ##
============================================
- Coverage 65.30% 65.29% -0.01%
Complexity 704 704
============================================
Files 1851 1851
Lines 31116 31126 +10
Branches 5603 5604 +1
============================================
+ Hits 20319 20325 +6
- Misses 9187 9191 +4
Partials 1610 1610
```
| [Impacted Files](https://codecov.io/gh/apache/shardingsphere/pull/11028?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [...harding/metadata/ShardingTableMetaDataBuilder.java](https://codecov.io/gh/apache/shardingsphere/pull/11028/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtc2hhcmRpbmcvc2hhcmRpbmdzcGhlcmUtc2hhcmRpbmctY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvc2hhcmRpbmcvbWV0YWRhdGEvU2hhcmRpbmdUYWJsZU1ldGFEYXRhQnVpbGRlci5qYXZh) | `0.00% <0.00%> (ø)` | |
| [...ontext/metadata/impl/StandardMetaDataContexts.java](https://codecov.io/gh/apache/shardingsphere/pull/11028/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtaW5mcmEvc2hhcmRpbmdzcGhlcmUtaW5mcmEtY29udGV4dC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvaW5mcmEvY29udGV4dC9tZXRhZGF0YS9pbXBsL1N0YW5kYXJkTWV0YURhdGFDb250ZXh0cy5qYXZh) | `81.25% <0.00%> (-2.75%)` | :arrow_down: |
| [.../encrypt/metadata/EncryptTableMetaDataBuilder.java](https://codecov.io/gh/apache/shardingsphere/pull/11028/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtZW5jcnlwdC9zaGFyZGluZ3NwaGVyZS1lbmNyeXB0LWNvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2VuY3J5cHQvbWV0YWRhdGEvRW5jcnlwdFRhYmxlTWV0YURhdGFCdWlsZGVyLmphdmE=) | `95.00% <100.00%> (+0.26%)` | :arrow_up: |
| [...e/context/metadata/GovernanceMetaDataContexts.java](https://codecov.io/gh/apache/shardingsphere/pull/11028/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtZ292ZXJuYW5jZS9zaGFyZGluZ3NwaGVyZS1nb3Zlcm5hbmNlLWNvbnRleHQvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2dvdmVybmFuY2UvY29udGV4dC9tZXRhZGF0YS9Hb3Zlcm5hbmNlTWV0YURhdGFDb250ZXh0cy5qYXZh) | `78.97% <100.00%> (-1.63%)` | :arrow_down: |
| [...ce/core/yaml/schema/swapper/SchemaYamlSwapper.java](https://codecov.io/gh/apache/shardingsphere/pull/11028/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtZ292ZXJuYW5jZS9zaGFyZGluZ3NwaGVyZS1nb3Zlcm5hbmNlLWNvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2dvdmVybmFuY2UvY29yZS95YW1sL3NjaGVtYS9zd2FwcGVyL1NjaGVtYVlhbWxTd2FwcGVyLmphdmE=) | `93.54% <100.00%> (ø)` | |
| [...e/infra/metadata/schema/builder/SchemaBuilder.java](https://codecov.io/gh/apache/shardingsphere/pull/11028/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtaW5mcmEvc2hhcmRpbmdzcGhlcmUtaW5mcmEtY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9pbmZyYS9tZXRhZGF0YS9zY2hlbWEvYnVpbGRlci9TY2hlbWFCdWlsZGVyLmphdmE=) | `69.62% <100.00%> (+1.19%)` | :arrow_up: |
| [.../metadata/schema/builder/TableMetaDataBuilder.java](https://codecov.io/gh/apache/shardingsphere/pull/11028/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtaW5mcmEvc2hhcmRpbmdzcGhlcmUtaW5mcmEtY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9pbmZyYS9tZXRhZGF0YS9zY2hlbWEvYnVpbGRlci9UYWJsZU1ldGFEYXRhQnVpbGRlci5qYXZh) | `90.47% <100.00%> (+0.47%)` | :arrow_up: |
| [...ata/schema/builder/loader/TableMetaDataLoader.java](https://codecov.io/gh/apache/shardingsphere/pull/11028/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtaW5mcmEvc2hhcmRpbmdzcGhlcmUtaW5mcmEtY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9pbmZyYS9tZXRhZGF0YS9zY2hlbWEvYnVpbGRlci9sb2FkZXIvVGFibGVNZXRhRGF0YUxvYWRlci5qYXZh) | `80.00% <100.00%> (ø)` | |
| [.../builder/loader/dialect/H2TableMetaDataLoader.java](https://codecov.io/gh/apache/shardingsphere/pull/11028/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtaW5mcmEvc2hhcmRpbmdzcGhlcmUtaW5mcmEtY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9pbmZyYS9tZXRhZGF0YS9zY2hlbWEvYnVpbGRlci9sb2FkZXIvZGlhbGVjdC9IMlRhYmxlTWV0YURhdGFMb2FkZXIuamF2YQ==) | `87.05% <100.00%> (ø)` | |
| [...ilder/loader/dialect/MySQLTableMetaDataLoader.java](https://codecov.io/gh/apache/shardingsphere/pull/11028/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtaW5mcmEvc2hhcmRpbmdzcGhlcmUtaW5mcmEtY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9pbmZyYS9tZXRhZGF0YS9zY2hlbWEvYnVpbGRlci9sb2FkZXIvZGlhbGVjdC9NeVNRTFRhYmxlTWV0YURhdGFMb2FkZXIuamF2YQ==) | `86.79% <100.00%> (ø)` | |
| ... and [6 more](https://codecov.io/gh/apache/shardingsphere/pull/11028/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/shardingsphere/pull/11028?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/shardingsphere/pull/11028?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [5f08c67...f13c791](https://codecov.io/gh/apache/shardingsphere/pull/11028?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
--
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] totalo commented on a change in pull request #11028: improve code for #10840
Posted by GitBox <gi...@apache.org>.
totalo commented on a change in pull request #11028:
URL: https://github.com/apache/shardingsphere/pull/11028#discussion_r661106733
##########
File path: shardingsphere-infra/shardingsphere-infra-context/src/main/java/org/apache/shardingsphere/infra/context/metadata/impl/StandardMetaDataContexts.java
##########
@@ -54,23 +55,8 @@
private final StateContext stateContext;
public StandardMetaDataContexts() {
- this(new LinkedHashMap<>(),
- new ShardingSphereRuleMetaData(Collections.emptyList(), Collections.emptyList()), null, new ConfigurationProperties(new Properties()));
- }
-
- /**
- * todo remove this deprecated constructor.
- * @deprecated old
- */
- @Deprecated
- public StandardMetaDataContexts(final Map<String, ShardingSphereMetaData> metaDataMap, final ShardingSphereRuleMetaData globalRuleMetaData,
- final ExecutorEngine executorEngine, final ConfigurationProperties props) {
- this.metaDataMap = new LinkedHashMap<>(metaDataMap);
- this.globalRuleMetaData = globalRuleMetaData;
- this.executorEngine = executorEngine;
- optimizeContextFactory = new OptimizeContextFactory(metaDataMap);
- this.props = props;
- stateContext = new StateContext();
+ this(new LinkedHashMap<>(), new ShardingSphereRuleMetaData(Collections.emptyList(), Collections.emptyList()),
+ null, new ConfigurationProperties(new Properties()), new OptimizeContextFactory(new HashMap<>()));
Review comment:
My oversight. I made the change, but it doesn't seem to have triggered the change.
--
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] totalo commented on a change in pull request #11028: improve code for #10840
Posted by GitBox <gi...@apache.org>.
totalo commented on a change in pull request #11028:
URL: https://github.com/apache/shardingsphere/pull/11028#discussion_r660531203
##########
File path: shardingsphere-infra/shardingsphere-infra-context/src/main/java/org/apache/shardingsphere/infra/context/metadata/impl/StandardMetaDataContexts.java
##########
@@ -54,23 +55,8 @@
private final StateContext stateContext;
public StandardMetaDataContexts() {
- this(new LinkedHashMap<>(),
- new ShardingSphereRuleMetaData(Collections.emptyList(), Collections.emptyList()), null, new ConfigurationProperties(new Properties()));
- }
-
- /**
- * todo remove this deprecated constructor.
- * @deprecated old
- */
- @Deprecated
- public StandardMetaDataContexts(final Map<String, ShardingSphereMetaData> metaDataMap, final ShardingSphereRuleMetaData globalRuleMetaData,
- final ExecutorEngine executorEngine, final ConfigurationProperties props) {
- this.metaDataMap = new LinkedHashMap<>(metaDataMap);
- this.globalRuleMetaData = globalRuleMetaData;
- this.executorEngine = executorEngine;
- optimizeContextFactory = new OptimizeContextFactory(metaDataMap);
- this.props = props;
- stateContext = new StateContext();
+ this(new LinkedHashMap<>(), new ShardingSphereRuleMetaData(Collections.emptyList(), Collections.emptyList()),
+ null, new ConfigurationProperties(new Properties()), new OptimizeContextFactory(new HashMap<>()));
Review comment:
yes, the ProxyContent is in use.
--
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] tristaZero commented on a change in pull request #11028: improve code for #10840
Posted by GitBox <gi...@apache.org>.
tristaZero commented on a change in pull request #11028:
URL: https://github.com/apache/shardingsphere/pull/11028#discussion_r660214739
##########
File path: shardingsphere-infra/shardingsphere-infra-context/src/main/java/org/apache/shardingsphere/infra/context/metadata/impl/StandardMetaDataContexts.java
##########
@@ -54,23 +55,8 @@
private final StateContext stateContext;
public StandardMetaDataContexts() {
- this(new LinkedHashMap<>(),
- new ShardingSphereRuleMetaData(Collections.emptyList(), Collections.emptyList()), null, new ConfigurationProperties(new Properties()));
- }
-
- /**
- * todo remove this deprecated constructor.
- * @deprecated old
- */
- @Deprecated
- public StandardMetaDataContexts(final Map<String, ShardingSphereMetaData> metaDataMap, final ShardingSphereRuleMetaData globalRuleMetaData,
- final ExecutorEngine executorEngine, final ConfigurationProperties props) {
- this.metaDataMap = new LinkedHashMap<>(metaDataMap);
- this.globalRuleMetaData = globalRuleMetaData;
- this.executorEngine = executorEngine;
- optimizeContextFactory = new OptimizeContextFactory(metaDataMap);
- this.props = props;
- stateContext = new StateContext();
+ this(new LinkedHashMap<>(), new ShardingSphereRuleMetaData(Collections.emptyList(), Collections.emptyList()),
+ null, new ConfigurationProperties(new Properties()), new OptimizeContextFactory(new HashMap<>()));
Review comment:
Is there any reference for this constructor?
##########
File path: shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/metadata/schema/model/TableMetaDatas.java
##########
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shardingsphere.infra.metadata.schema.model;
+
+import lombok.Getter;
+import lombok.RequiredArgsConstructor;
+
+import java.util.Map;
+
+@RequiredArgsConstructor
+@Getter
+public class TableMetaDatas {
+
+ private final Map<String, TableMetaData> actualTableMeta;
Review comment:
So it is needed?
--
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] totalo commented on a change in pull request #11028: improve code for #10840
Posted by GitBox <gi...@apache.org>.
totalo commented on a change in pull request #11028:
URL: https://github.com/apache/shardingsphere/pull/11028#discussion_r659711742
##########
File path: shardingsphere-infra/shardingsphere-infra-context/src/main/java/org/apache/shardingsphere/infra/context/metadata/MetaDataContextsBuilder.java
##########
@@ -94,21 +95,21 @@ public StandardMetaDataContexts build() throws SQLException {
Collection<RuleConfiguration> ruleConfigs = schemaRuleConfigs.get(each);
DatabaseType databaseType = DatabaseTypeRecognizer.getDatabaseType(dataSourceMap.values());
Collection<ShardingSphereRule> rules = ShardingSphereRulesBuilder.buildSchemaRules(each, ruleConfigs, databaseType, dataSourceMap);
- Map<Map<String, TableMetaData>, Map<String, TableMetaData>> tableMetaDataMap = SchemaBuilder.build(new SchemaBuilderMaterials(databaseType, dataSourceMap, rules, props));
+ TableMetaDatas tableMetaDatas = SchemaBuilder.build(new SchemaBuilderMaterials(databaseType, dataSourceMap, rules, props));
Review comment:
Yeah, then I think it's fine. I'll fix him.
--
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] totalo commented on a change in pull request #11028: improve code for #10840
Posted by GitBox <gi...@apache.org>.
totalo commented on a change in pull request #11028:
URL: https://github.com/apache/shardingsphere/pull/11028#discussion_r660531203
##########
File path: shardingsphere-infra/shardingsphere-infra-context/src/main/java/org/apache/shardingsphere/infra/context/metadata/impl/StandardMetaDataContexts.java
##########
@@ -54,23 +55,8 @@
private final StateContext stateContext;
public StandardMetaDataContexts() {
- this(new LinkedHashMap<>(),
- new ShardingSphereRuleMetaData(Collections.emptyList(), Collections.emptyList()), null, new ConfigurationProperties(new Properties()));
- }
-
- /**
- * todo remove this deprecated constructor.
- * @deprecated old
- */
- @Deprecated
- public StandardMetaDataContexts(final Map<String, ShardingSphereMetaData> metaDataMap, final ShardingSphereRuleMetaData globalRuleMetaData,
- final ExecutorEngine executorEngine, final ConfigurationProperties props) {
- this.metaDataMap = new LinkedHashMap<>(metaDataMap);
- this.globalRuleMetaData = globalRuleMetaData;
- this.executorEngine = executorEngine;
- optimizeContextFactory = new OptimizeContextFactory(metaDataMap);
- this.props = props;
- stateContext = new StateContext();
+ this(new LinkedHashMap<>(), new ShardingSphereRuleMetaData(Collections.emptyList(), Collections.emptyList()),
+ null, new ConfigurationProperties(new Properties()), new OptimizeContextFactory(new HashMap<>()));
Review comment:
yes, the ProxyContent is in use.
--
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] totalo commented on a change in pull request #11028: improve code for #10840
Posted by GitBox <gi...@apache.org>.
totalo commented on a change in pull request #11028:
URL: https://github.com/apache/shardingsphere/pull/11028#discussion_r661108251
##########
File path: shardingsphere-infra/shardingsphere-infra-context/src/main/java/org/apache/shardingsphere/infra/context/metadata/impl/StandardMetaDataContexts.java
##########
@@ -54,23 +55,8 @@
private final StateContext stateContext;
public StandardMetaDataContexts() {
- this(new LinkedHashMap<>(),
- new ShardingSphereRuleMetaData(Collections.emptyList(), Collections.emptyList()), null, new ConfigurationProperties(new Properties()));
- }
-
- /**
- * todo remove this deprecated constructor.
- * @deprecated old
- */
- @Deprecated
- public StandardMetaDataContexts(final Map<String, ShardingSphereMetaData> metaDataMap, final ShardingSphereRuleMetaData globalRuleMetaData,
- final ExecutorEngine executorEngine, final ConfigurationProperties props) {
- this.metaDataMap = new LinkedHashMap<>(metaDataMap);
- this.globalRuleMetaData = globalRuleMetaData;
- this.executorEngine = executorEngine;
- optimizeContextFactory = new OptimizeContextFactory(metaDataMap);
- this.props = props;
- stateContext = new StateContext();
+ this(new LinkedHashMap<>(), new ShardingSphereRuleMetaData(Collections.emptyList(), Collections.emptyList()),
+ null, new ConfigurationProperties(new Properties()), new OptimizeContextFactory(new HashMap<>()));
Review comment:
I don't quite understand. `this` calls our new constructor.
--
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] totalo commented on a change in pull request #11028: improve code for #10840
Posted by GitBox <gi...@apache.org>.
totalo commented on a change in pull request #11028:
URL: https://github.com/apache/shardingsphere/pull/11028#discussion_r661219276
##########
File path: shardingsphere-infra/shardingsphere-infra-context/src/main/java/org/apache/shardingsphere/infra/context/metadata/impl/StandardMetaDataContexts.java
##########
@@ -54,23 +55,8 @@
private final StateContext stateContext;
public StandardMetaDataContexts() {
- this(new LinkedHashMap<>(),
- new ShardingSphereRuleMetaData(Collections.emptyList(), Collections.emptyList()), null, new ConfigurationProperties(new Properties()));
- }
-
- /**
- * todo remove this deprecated constructor.
- * @deprecated old
- */
- @Deprecated
- public StandardMetaDataContexts(final Map<String, ShardingSphereMetaData> metaDataMap, final ShardingSphereRuleMetaData globalRuleMetaData,
- final ExecutorEngine executorEngine, final ConfigurationProperties props) {
- this.metaDataMap = new LinkedHashMap<>(metaDataMap);
- this.globalRuleMetaData = globalRuleMetaData;
- this.executorEngine = executorEngine;
- optimizeContextFactory = new OptimizeContextFactory(metaDataMap);
- this.props = props;
- stateContext = new StateContext();
+ this(new LinkedHashMap<>(), new ShardingSphereRuleMetaData(Collections.emptyList(), Collections.emptyList()),
+ null, new ConfigurationProperties(new Properties()), new OptimizeContextFactory(new HashMap<>()));
Review comment:
yeah!
--
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] tristaZero commented on a change in pull request #11028: improve code for #10840
Posted by GitBox <gi...@apache.org>.
tristaZero commented on a change in pull request #11028:
URL: https://github.com/apache/shardingsphere/pull/11028#discussion_r661099428
##########
File path: shardingsphere-infra/shardingsphere-infra-context/src/main/java/org/apache/shardingsphere/infra/context/metadata/impl/StandardMetaDataContexts.java
##########
@@ -54,23 +55,8 @@
private final StateContext stateContext;
public StandardMetaDataContexts() {
- this(new LinkedHashMap<>(),
- new ShardingSphereRuleMetaData(Collections.emptyList(), Collections.emptyList()), null, new ConfigurationProperties(new Properties()));
- }
-
- /**
- * todo remove this deprecated constructor.
- * @deprecated old
- */
- @Deprecated
- public StandardMetaDataContexts(final Map<String, ShardingSphereMetaData> metaDataMap, final ShardingSphereRuleMetaData globalRuleMetaData,
- final ExecutorEngine executorEngine, final ConfigurationProperties props) {
- this.metaDataMap = new LinkedHashMap<>(metaDataMap);
- this.globalRuleMetaData = globalRuleMetaData;
- this.executorEngine = executorEngine;
- optimizeContextFactory = new OptimizeContextFactory(metaDataMap);
- this.props = props;
- stateContext = new StateContext();
+ this(new LinkedHashMap<>(), new ShardingSphereRuleMetaData(Collections.emptyList(), Collections.emptyList()),
+ null, new ConfigurationProperties(new Properties()), new OptimizeContextFactory(new HashMap<>()));
Review comment:
`TableMetaDatas` still needs your attention. Thanks.
##########
File path: shardingsphere-infra/shardingsphere-infra-context/src/main/java/org/apache/shardingsphere/infra/context/metadata/impl/StandardMetaDataContexts.java
##########
@@ -54,23 +55,8 @@
private final StateContext stateContext;
public StandardMetaDataContexts() {
- this(new LinkedHashMap<>(),
- new ShardingSphereRuleMetaData(Collections.emptyList(), Collections.emptyList()), null, new ConfigurationProperties(new Properties()));
- }
-
- /**
- * todo remove this deprecated constructor.
- * @deprecated old
- */
- @Deprecated
- public StandardMetaDataContexts(final Map<String, ShardingSphereMetaData> metaDataMap, final ShardingSphereRuleMetaData globalRuleMetaData,
- final ExecutorEngine executorEngine, final ConfigurationProperties props) {
- this.metaDataMap = new LinkedHashMap<>(metaDataMap);
- this.globalRuleMetaData = globalRuleMetaData;
- this.executorEngine = executorEngine;
- optimizeContextFactory = new OptimizeContextFactory(metaDataMap);
- this.props = props;
- stateContext = new StateContext();
+ this(new LinkedHashMap<>(), new ShardingSphereRuleMetaData(Collections.emptyList(), Collections.emptyList()),
+ null, new ConfigurationProperties(new Properties()), new OptimizeContextFactory(new HashMap<>()));
Review comment:
If an empty StandardMetaDataContexts is wanted, we can consider using our new constructor. How do you think?
--
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] totalo commented on a change in pull request #11028: improve code for #10840
Posted by GitBox <gi...@apache.org>.
totalo commented on a change in pull request #11028:
URL: https://github.com/apache/shardingsphere/pull/11028#discussion_r661950568
##########
File path: shardingsphere-infra/shardingsphere-infra-context/src/main/java/org/apache/shardingsphere/infra/context/metadata/MetaDataContextsBuilder.java
##########
@@ -94,21 +96,21 @@ public StandardMetaDataContexts build() throws SQLException {
Collection<RuleConfiguration> ruleConfigs = schemaRuleConfigs.get(each);
DatabaseType databaseType = DatabaseTypeRecognizer.getDatabaseType(dataSourceMap.values());
Collection<ShardingSphereRule> rules = ShardingSphereRulesBuilder.buildSchemaRules(each, ruleConfigs, databaseType, dataSourceMap);
- Map<Map<String, TableMetaData>, Map<String, TableMetaData>> tableMetaDataMap = SchemaBuilder.build(new SchemaBuilderMaterials(databaseType, dataSourceMap, rules, props));
+ Map<TableMetaData, TableMetaData> tableMetaDatas = SchemaBuilder.build(new SchemaBuilderMaterials(databaseType, dataSourceMap, rules, props));
ShardingSphereRuleMetaData ruleMetaData = new ShardingSphereRuleMetaData(ruleConfigs, rules);
ShardingSphereResource resource = buildResource(databaseType, dataSourceMap);
- ShardingSphereSchema actualSchema = new ShardingSphereSchema(tableMetaDataMap.keySet().iterator().next());
+ ShardingSphereSchema actualSchema = new ShardingSphereSchema(tableMetaDatas.keySet().stream().filter(Objects::nonNull).collect(Collectors.toMap(TableMetaData::getName, v -> v)));
actualMetaDataMap.put(each, new ShardingSphereMetaData(each, resource, ruleMetaData, actualSchema));
- metaDataMap.put(each, new ShardingSphereMetaData(each, resource, ruleMetaData, buildSchema(tableMetaDataMap)));
+ metaDataMap.put(each, new ShardingSphereMetaData(each, resource, ruleMetaData, buildSchema(tableMetaDatas)));
}
OptimizeContextFactory optimizeContextFactory = new OptimizeContextFactory(actualMetaDataMap);
return new StandardMetaDataContexts(metaDataMap, buildGlobalSchemaMetaData(metaDataMap), executorEngine, props, optimizeContextFactory);
}
-
- private ShardingSphereSchema buildSchema(final Map<Map<String, TableMetaData>, Map<String, TableMetaData>> tableMetaDataMap) {
- Map<String, TableMetaData> tables = new HashMap<>(tableMetaDataMap.size(), 1);
- tables.putAll(tableMetaDataMap.keySet().iterator().next());
- tables.putAll(tableMetaDataMap.values().iterator().next());
+
+ private ShardingSphereSchema buildSchema(final Map<TableMetaData, TableMetaData> tableMetaDatas) {
Review comment:
Yes, you are right, so there is no problem with understanding it. My original understanding was to separate the two concepts. Based on this, I think the current logic is a bit of a problem, my current logical table and physical table are strictly separate. I'll revise my logic.
--
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] tristaZero commented on a change in pull request #11028: improve code for #10840
Posted by GitBox <gi...@apache.org>.
tristaZero commented on a change in pull request #11028:
URL: https://github.com/apache/shardingsphere/pull/11028#discussion_r661943638
##########
File path: shardingsphere-infra/shardingsphere-infra-context/src/main/java/org/apache/shardingsphere/infra/context/metadata/MetaDataContextsBuilder.java
##########
@@ -94,21 +96,21 @@ public StandardMetaDataContexts build() throws SQLException {
Collection<RuleConfiguration> ruleConfigs = schemaRuleConfigs.get(each);
DatabaseType databaseType = DatabaseTypeRecognizer.getDatabaseType(dataSourceMap.values());
Collection<ShardingSphereRule> rules = ShardingSphereRulesBuilder.buildSchemaRules(each, ruleConfigs, databaseType, dataSourceMap);
- Map<Map<String, TableMetaData>, Map<String, TableMetaData>> tableMetaDataMap = SchemaBuilder.build(new SchemaBuilderMaterials(databaseType, dataSourceMap, rules, props));
+ Map<TableMetaData, TableMetaData> tableMetaDatas = SchemaBuilder.build(new SchemaBuilderMaterials(databaseType, dataSourceMap, rules, props));
ShardingSphereRuleMetaData ruleMetaData = new ShardingSphereRuleMetaData(ruleConfigs, rules);
ShardingSphereResource resource = buildResource(databaseType, dataSourceMap);
- ShardingSphereSchema actualSchema = new ShardingSphereSchema(tableMetaDataMap.keySet().iterator().next());
+ ShardingSphereSchema actualSchema = new ShardingSphereSchema(tableMetaDatas.keySet().stream().filter(Objects::nonNull).collect(Collectors.toMap(TableMetaData::getName, v -> v)));
actualMetaDataMap.put(each, new ShardingSphereMetaData(each, resource, ruleMetaData, actualSchema));
- metaDataMap.put(each, new ShardingSphereMetaData(each, resource, ruleMetaData, buildSchema(tableMetaDataMap)));
+ metaDataMap.put(each, new ShardingSphereMetaData(each, resource, ruleMetaData, buildSchema(tableMetaDatas)));
}
OptimizeContextFactory optimizeContextFactory = new OptimizeContextFactory(actualMetaDataMap);
return new StandardMetaDataContexts(metaDataMap, buildGlobalSchemaMetaData(metaDataMap), executorEngine, props, optimizeContextFactory);
}
-
- private ShardingSphereSchema buildSchema(final Map<Map<String, TableMetaData>, Map<String, TableMetaData>> tableMetaDataMap) {
- Map<String, TableMetaData> tables = new HashMap<>(tableMetaDataMap.size(), 1);
- tables.putAll(tableMetaDataMap.keySet().iterator().next());
- tables.putAll(tableMetaDataMap.values().iterator().next());
+
+ private ShardingSphereSchema buildSchema(final Map<TableMetaData, TableMetaData> tableMetaDatas) {
Review comment:
Hi @totalo
Basically, this PR looks better now. But I still have two points for our discussion.
1. `Objects::nonNull).collect` , why do we need these filters?
2. To solve the first question, I guess we have to look at `SchemaBuilder.build()`. I think it is possible that the current handling has some issues.
As I said before, one logic table corresponds to a physical table, there is no possibility to do filtering. If there is no rule to generate a logic table, a physical table will be a logic table (No rule applied.)
##########
File path: shardingsphere-infra/shardingsphere-infra-context/src/main/java/org/apache/shardingsphere/infra/context/metadata/MetaDataContextsBuilder.java
##########
@@ -94,21 +96,21 @@ public StandardMetaDataContexts build() throws SQLException {
Collection<RuleConfiguration> ruleConfigs = schemaRuleConfigs.get(each);
DatabaseType databaseType = DatabaseTypeRecognizer.getDatabaseType(dataSourceMap.values());
Collection<ShardingSphereRule> rules = ShardingSphereRulesBuilder.buildSchemaRules(each, ruleConfigs, databaseType, dataSourceMap);
- Map<Map<String, TableMetaData>, Map<String, TableMetaData>> tableMetaDataMap = SchemaBuilder.build(new SchemaBuilderMaterials(databaseType, dataSourceMap, rules, props));
+ Map<TableMetaData, TableMetaData> tableMetaDatas = SchemaBuilder.build(new SchemaBuilderMaterials(databaseType, dataSourceMap, rules, props));
ShardingSphereRuleMetaData ruleMetaData = new ShardingSphereRuleMetaData(ruleConfigs, rules);
ShardingSphereResource resource = buildResource(databaseType, dataSourceMap);
- ShardingSphereSchema actualSchema = new ShardingSphereSchema(tableMetaDataMap.keySet().iterator().next());
+ ShardingSphereSchema actualSchema = new ShardingSphereSchema(tableMetaDatas.keySet().stream().filter(Objects::nonNull).collect(Collectors.toMap(TableMetaData::getName, v -> v)));
actualMetaDataMap.put(each, new ShardingSphereMetaData(each, resource, ruleMetaData, actualSchema));
- metaDataMap.put(each, new ShardingSphereMetaData(each, resource, ruleMetaData, buildSchema(tableMetaDataMap)));
+ metaDataMap.put(each, new ShardingSphereMetaData(each, resource, ruleMetaData, buildSchema(tableMetaDatas)));
}
OptimizeContextFactory optimizeContextFactory = new OptimizeContextFactory(actualMetaDataMap);
return new StandardMetaDataContexts(metaDataMap, buildGlobalSchemaMetaData(metaDataMap), executorEngine, props, optimizeContextFactory);
}
-
- private ShardingSphereSchema buildSchema(final Map<Map<String, TableMetaData>, Map<String, TableMetaData>> tableMetaDataMap) {
- Map<String, TableMetaData> tables = new HashMap<>(tableMetaDataMap.size(), 1);
- tables.putAll(tableMetaDataMap.keySet().iterator().next());
- tables.putAll(tableMetaDataMap.values().iterator().next());
+
+ private ShardingSphereSchema buildSchema(final Map<TableMetaData, TableMetaData> tableMetaDatas) {
Review comment:
Could you reflect on these issues? Maybe we can improve them in the next PR.
--
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] codecov-commenter edited a comment on pull request #11028: improve code for #10840
Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #11028:
URL: https://github.com/apache/shardingsphere/pull/11028#issuecomment-869026629
# [Codecov](https://codecov.io/gh/apache/shardingsphere/pull/11028?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#11028](https://codecov.io/gh/apache/shardingsphere/pull/11028?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (17dd327) into [master](https://codecov.io/gh/apache/shardingsphere/commit/96528441931ca6f32e9c66fc807cebfa94d8ab9e?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (9652844) will **decrease** coverage by `0.07%`.
> The diff coverage is `96.77%`.
[![Impacted file tree graph](https://codecov.io/gh/apache/shardingsphere/pull/11028/graphs/tree.svg?width=650&height=150&src=pr&token=ZvlXpWa7so&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/shardingsphere/pull/11028?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
```diff
@@ Coverage Diff @@
## master #11028 +/- ##
============================================
- Coverage 65.34% 65.27% -0.08%
Complexity 685 685
============================================
Files 1835 1835
Lines 31019 31029 +10
Branches 5595 5596 +1
============================================
- Hits 20270 20254 -16
- Misses 9143 9170 +27
+ Partials 1606 1605 -1
```
| [Impacted Files](https://codecov.io/gh/apache/shardingsphere/pull/11028?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [...harding/metadata/ShardingTableMetaDataBuilder.java](https://codecov.io/gh/apache/shardingsphere/pull/11028/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtc2hhcmRpbmcvc2hhcmRpbmdzcGhlcmUtc2hhcmRpbmctY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvc2hhcmRpbmcvbWV0YWRhdGEvU2hhcmRpbmdUYWJsZU1ldGFEYXRhQnVpbGRlci5qYXZh) | `0.00% <0.00%> (ø)` | |
| [...ontext/metadata/impl/StandardMetaDataContexts.java](https://codecov.io/gh/apache/shardingsphere/pull/11028/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtaW5mcmEvc2hhcmRpbmdzcGhlcmUtaW5mcmEtY29udGV4dC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvaW5mcmEvY29udGV4dC9tZXRhZGF0YS9pbXBsL1N0YW5kYXJkTWV0YURhdGFDb250ZXh0cy5qYXZh) | `81.25% <0.00%> (-2.75%)` | :arrow_down: |
| [.../encrypt/metadata/EncryptTableMetaDataBuilder.java](https://codecov.io/gh/apache/shardingsphere/pull/11028/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtZW5jcnlwdC9zaGFyZGluZ3NwaGVyZS1lbmNyeXB0LWNvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2VuY3J5cHQvbWV0YWRhdGEvRW5jcnlwdFRhYmxlTWV0YURhdGFCdWlsZGVyLmphdmE=) | `95.00% <100.00%> (+0.26%)` | :arrow_up: |
| [...e/context/metadata/GovernanceMetaDataContexts.java](https://codecov.io/gh/apache/shardingsphere/pull/11028/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtZ292ZXJuYW5jZS9zaGFyZGluZ3NwaGVyZS1nb3Zlcm5hbmNlLWNvbnRleHQvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2dvdmVybmFuY2UvY29udGV4dC9tZXRhZGF0YS9Hb3Zlcm5hbmNlTWV0YURhdGFDb250ZXh0cy5qYXZh) | `78.97% <100.00%> (-1.63%)` | :arrow_down: |
| [...ce/core/yaml/schema/swapper/SchemaYamlSwapper.java](https://codecov.io/gh/apache/shardingsphere/pull/11028/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtZ292ZXJuYW5jZS9zaGFyZGluZ3NwaGVyZS1nb3Zlcm5hbmNlLWNvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2dvdmVybmFuY2UvY29yZS95YW1sL3NjaGVtYS9zd2FwcGVyL1NjaGVtYVlhbWxTd2FwcGVyLmphdmE=) | `93.54% <100.00%> (ø)` | |
| [...e/infra/metadata/schema/builder/SchemaBuilder.java](https://codecov.io/gh/apache/shardingsphere/pull/11028/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtaW5mcmEvc2hhcmRpbmdzcGhlcmUtaW5mcmEtY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9pbmZyYS9tZXRhZGF0YS9zY2hlbWEvYnVpbGRlci9TY2hlbWFCdWlsZGVyLmphdmE=) | `69.62% <100.00%> (+1.19%)` | :arrow_up: |
| [.../metadata/schema/builder/TableMetaDataBuilder.java](https://codecov.io/gh/apache/shardingsphere/pull/11028/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtaW5mcmEvc2hhcmRpbmdzcGhlcmUtaW5mcmEtY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9pbmZyYS9tZXRhZGF0YS9zY2hlbWEvYnVpbGRlci9UYWJsZU1ldGFEYXRhQnVpbGRlci5qYXZh) | `90.47% <100.00%> (+0.47%)` | :arrow_up: |
| [...ata/schema/builder/loader/TableMetaDataLoader.java](https://codecov.io/gh/apache/shardingsphere/pull/11028/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtaW5mcmEvc2hhcmRpbmdzcGhlcmUtaW5mcmEtY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9pbmZyYS9tZXRhZGF0YS9zY2hlbWEvYnVpbGRlci9sb2FkZXIvVGFibGVNZXRhRGF0YUxvYWRlci5qYXZh) | `80.00% <100.00%> (ø)` | |
| [.../builder/loader/dialect/H2TableMetaDataLoader.java](https://codecov.io/gh/apache/shardingsphere/pull/11028/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtaW5mcmEvc2hhcmRpbmdzcGhlcmUtaW5mcmEtY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9pbmZyYS9tZXRhZGF0YS9zY2hlbWEvYnVpbGRlci9sb2FkZXIvZGlhbGVjdC9IMlRhYmxlTWV0YURhdGFMb2FkZXIuamF2YQ==) | `87.05% <100.00%> (ø)` | |
| [...ilder/loader/dialect/MySQLTableMetaDataLoader.java](https://codecov.io/gh/apache/shardingsphere/pull/11028/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtaW5mcmEvc2hhcmRpbmdzcGhlcmUtaW5mcmEtY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9pbmZyYS9tZXRhZGF0YS9zY2hlbWEvYnVpbGRlci9sb2FkZXIvZGlhbGVjdC9NeVNRTFRhYmxlTWV0YURhdGFMb2FkZXIuamF2YQ==) | `86.79% <100.00%> (ø)` | |
| ... and [10 more](https://codecov.io/gh/apache/shardingsphere/pull/11028/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/shardingsphere/pull/11028?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/shardingsphere/pull/11028?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [9652844...17dd327](https://codecov.io/gh/apache/shardingsphere/pull/11028?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
--
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] totalo commented on a change in pull request #11028: improve code for #10840
Posted by GitBox <gi...@apache.org>.
totalo commented on a change in pull request #11028:
URL: https://github.com/apache/shardingsphere/pull/11028#discussion_r661950568
##########
File path: shardingsphere-infra/shardingsphere-infra-context/src/main/java/org/apache/shardingsphere/infra/context/metadata/MetaDataContextsBuilder.java
##########
@@ -94,21 +96,21 @@ public StandardMetaDataContexts build() throws SQLException {
Collection<RuleConfiguration> ruleConfigs = schemaRuleConfigs.get(each);
DatabaseType databaseType = DatabaseTypeRecognizer.getDatabaseType(dataSourceMap.values());
Collection<ShardingSphereRule> rules = ShardingSphereRulesBuilder.buildSchemaRules(each, ruleConfigs, databaseType, dataSourceMap);
- Map<Map<String, TableMetaData>, Map<String, TableMetaData>> tableMetaDataMap = SchemaBuilder.build(new SchemaBuilderMaterials(databaseType, dataSourceMap, rules, props));
+ Map<TableMetaData, TableMetaData> tableMetaDatas = SchemaBuilder.build(new SchemaBuilderMaterials(databaseType, dataSourceMap, rules, props));
ShardingSphereRuleMetaData ruleMetaData = new ShardingSphereRuleMetaData(ruleConfigs, rules);
ShardingSphereResource resource = buildResource(databaseType, dataSourceMap);
- ShardingSphereSchema actualSchema = new ShardingSphereSchema(tableMetaDataMap.keySet().iterator().next());
+ ShardingSphereSchema actualSchema = new ShardingSphereSchema(tableMetaDatas.keySet().stream().filter(Objects::nonNull).collect(Collectors.toMap(TableMetaData::getName, v -> v)));
actualMetaDataMap.put(each, new ShardingSphereMetaData(each, resource, ruleMetaData, actualSchema));
- metaDataMap.put(each, new ShardingSphereMetaData(each, resource, ruleMetaData, buildSchema(tableMetaDataMap)));
+ metaDataMap.put(each, new ShardingSphereMetaData(each, resource, ruleMetaData, buildSchema(tableMetaDatas)));
}
OptimizeContextFactory optimizeContextFactory = new OptimizeContextFactory(actualMetaDataMap);
return new StandardMetaDataContexts(metaDataMap, buildGlobalSchemaMetaData(metaDataMap), executorEngine, props, optimizeContextFactory);
}
-
- private ShardingSphereSchema buildSchema(final Map<Map<String, TableMetaData>, Map<String, TableMetaData>> tableMetaDataMap) {
- Map<String, TableMetaData> tables = new HashMap<>(tableMetaDataMap.size(), 1);
- tables.putAll(tableMetaDataMap.keySet().iterator().next());
- tables.putAll(tableMetaDataMap.values().iterator().next());
+
+ private ShardingSphereSchema buildSchema(final Map<TableMetaData, TableMetaData> tableMetaDatas) {
Review comment:
Yes, you are right, I think maybe I did not understand clearly enough, let me look at the relevant code in detail, to understand. Then optimize the logic again.😹
--
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