totalo commented on a change in pull request #10840:
URL: https://github.com/apache/shardingsphere/pull/10840#discussion_r655150382
##########
File path:
shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/metadata/schema/builder/SchemaBuilder.java
##########
@@ -126,38 +144,38 @@ private static void appendDialectRemainTables(final
DialectTableMetaDataLoader d
}
}
}
-
- private static void appendDefaultRemainTables(final SchemaBuilderMaterials
materials, final ShardingSphereSchema schema) throws SQLException {
- Collection<String> existedTableNames =
getExistedTables(materials.getRules(), schema);
- for (Entry<String, DataSource> entry :
materials.getDataSourceMap().entrySet()) {
+
+ private static void appendDefaultRemainTables(final SchemaBuilderMaterials
materials, final Map<String, TableMetaData> tables) throws SQLException {
+ Collection<String> existedTableNames =
getExistedTables(materials.getRules(), tables);
+ for (Map.Entry<String, DataSource> entry :
materials.getDataSourceMap().entrySet()) {
Review comment:
done
##########
File path:
shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/metadata/schema/builder/SchemaBuilderTest.java
##########
@@ -47,19 +48,19 @@
@RunWith(MockitoJUnitRunner.class)
public final class SchemaBuilderTest {
-
+
private static final String TEST_CATALOG = "catalog";
-
Review comment:
done
##########
File path:
shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/metadata/schema/builder/SchemaBuilder.java
##########
@@ -64,42 +63,61 @@
static {
ShardingSphereServiceLoader.register(DialectTableMetaDataLoader.class);
}
-
+
/**
- * Build ShardingSphere schema.
- *
+ * build actual and logic table meta data.
+ *
* @param materials schema builder materials
- * @return ShardingSphere schema
+ * @return actual and logic table meta data
* @throws SQLException SQL exception
*/
- public static ShardingSphereSchema build(final SchemaBuilderMaterials
materials) throws SQLException {
- ShardingSphereSchema result = new ShardingSphereSchema();
- addRuleConfiguredTables(materials, result);
- appendRemainTables(materials, result);
+ public static Map<Map<String, TableMetaData>, Map<String, TableMetaData>>
build(final SchemaBuilderMaterials materials) throws SQLException {
Review comment:
ok ~
##########
File path:
shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/rule/builder/ShardingSphereRulesBuilder.java
##########
@@ -103,13 +104,15 @@ private static void
appendDefaultKernelSchemaRuleConfigurationBuilder(final Map<
}
@SuppressWarnings("rawtypes")
- private static void
appendDefaultKernelGlobalRuleConfigurationBuilder(final Map<RuleConfiguration,
GlobalRuleBuilder> builders) {
+ private static Map<RuleConfiguration, GlobalRuleBuilder>
appendDefaultKernelGlobalRuleConfigurationBuilder(final Map<RuleConfiguration,
GlobalRuleBuilder> builders) {
Review comment:
In my local as well as the process of ci, I found that produce abnormal
ConcurrentModificationException, see the code found here has a todo, and
multi-threaded read or add a builder, Can lead to a
ConcurrentModificationException, so I just dropped in to repair the him.
##########
File path:
shardingsphere-infra/shardingsphere-infra-context/src/main/java/org/apache/shardingsphere/infra/context/metadata/impl/StandardMetaDataContexts.java
##########
@@ -67,6 +67,16 @@ public StandardMetaDataContexts(final Map<String,
ShardingSphereMetaData> metaDa
this.props = props;
stateContext = new StateContext();
}
+
+ public StandardMetaDataContexts(final Map<String, ShardingSphereMetaData>
metaDataMap, final ShardingSphereRuleMetaData globalRuleMetaData,
Review comment:
In principle, yes, but I'll get rid of the old constructors as soon as I
make sure the PR works. I'll add todo to the old constructor later, what do you
think?
##########
File path:
shardingsphere-infra/shardingsphere-infra-optimize/src/main/java/org/apache/shardingsphere/infra/optimize/core/metadata/FederateTableMetadata.java
##########
@@ -45,40 +38,19 @@
public final class FederateTableMetadata {
private static final RelDataTypeFactory TYPE_FACTORY = new
SqlTypeFactoryImpl(RelDataTypeSystem.DEFAULT);
-
+
Review comment:
hhhhh,ok!My negligence.
##########
File path:
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_join_encrypt.xml
##########
@@ -21,13 +21,18 @@
<column name="address_id" />
<column name="pwd" />
<column name="status" />
- <column name="item_id" />
- <column name="user_id" />
- <column name="status" />
- <column name="creation_date" />
+ <!--fixme encrypt Expected column count is 8 but was 4-->
+<!-- <column name="item_id" />-->
+<!-- <column name="user_id" />-->
+<!-- <column name="status" />-->
Review comment:
I found that the result of the query contains only `t_user` and no
`t_user_item` in the `LogintableMeta`. I am trying to solve this problem.
##########
File path:
shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/rule/builder/ShardingSphereRulesBuilder.java
##########
@@ -103,13 +104,15 @@ private static void
appendDefaultKernelSchemaRuleConfigurationBuilder(final Map<
}
@SuppressWarnings("rawtypes")
- private static void
appendDefaultKernelGlobalRuleConfigurationBuilder(final Map<RuleConfiguration,
GlobalRuleBuilder> builders) {
+ private static Map<RuleConfiguration, GlobalRuleBuilder>
appendDefaultKernelGlobalRuleConfigurationBuilder(final Map<RuleConfiguration,
GlobalRuleBuilder> builders) {
Review comment:
In my local as well as the process of ci, I found that produce abnormal
`ConcurrentModificationException`, see the code found here has a todo, and
multi-threaded read or add a `builder`, Can lead to a
`ConcurrentModificationException`, so I just dropped in to repair the 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.
For queries about this service, please contact Infrastructure at:
[email protected]