sandynz commented on code in PR #19455:
URL: https://github.com/apache/shardingsphere/pull/19455#discussion_r927519441
##########
shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-core/src/main/java/org/apache/shardingsphere/data/pipeline/core/prepare/datasource/PrepareTargetSchemasParameter.java:
##########
@@ -30,7 +32,13 @@
@Getter
public final class PrepareTargetSchemasParameter {
- private final TaskConfiguration taskConfig;
+ private final List<String> logicTableNames;
+
+ private final DatabaseType targetDatabaseType;
+
+ private final String databaseName;
+
+ private final PipelineDataSourceConfiguration
pipelineDataSourceConfiguration;
Review Comment:
`pipelineDataSourceConfiguration` could be `dataSourceConfig`
##########
shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-core/src/main/java/org/apache/shardingsphere/data/pipeline/scenario/rulealtered/RuleAlteredJobPreparer.java:
##########
@@ -142,10 +141,19 @@ private void prepareTarget(final RuleAlteredJobContext
jobContext) {
log.info("dataSourcePreparer null, ignore prepare target");
return;
}
+ DatabaseType sourceDatabaseType =
DatabaseTypeFactory.getInstance(jobConfig.getSourceDatabaseType());
+ DatabaseType targetDatabaseType =
DatabaseTypeFactory.getInstance(jobConfig.getTargetDatabaseType());
+ if (!sourceDatabaseType.isSchemaAvailable() ||
!targetDatabaseType.isSchemaAvailable()) {
+ log.info("prepareTargetSchemas, one of source or target database
type schema is not available, ignore");
+ return;
+ }
Review Comment:
Looks it could not return, since it just could ignore creating schema but
not creating table.
Could we add an judgement method to check whether it need to create schema
or not? And then use it to precheck for `prepareTargetSchemas`.
##########
shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-core/src/main/java/org/apache/shardingsphere/data/pipeline/core/prepare/datasource/PrepareTargetTablesParameter.java:
##########
@@ -31,28 +30,23 @@
@Getter
public final class PrepareTargetTablesParameter {
- private final TaskConfiguration taskConfig;
+ private final String databaseName;
private final JobDataNodeLine tablesFirstDataNodes;
+ private final PipelineDataSourceConfiguration
pipelineDataSourceConfiguration;
+
Review Comment:
`pipelineDataSourceConfiguration` could be `dataSourceConfig`
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]