sandynz opened a new issue, #19742:
URL: https://github.com/apache/shardingsphere/issues/19742

   Current code:
   ```
   public final class TaskConfiguration {
       
       private final RuleAlteredJobConfiguration jobConfig;
       
       private final DumperConfiguration dumperConfig;
       
       private final ImporterConfiguration importerConfig;
   }
   ```
   
   And `jobConfig` is used in 2 places, in RuleAlteredJobPreparer:
   ```
           IncrementalTask incrementalTask = new 
IncrementalTask(taskConfig.getJobConfig().getConcurrency(),
                   taskConfig.getDumperConfig(), 
taskConfig.getImporterConfig(), pipelineChannelCreator, dataSourceManager, 
sourceMetaDataLoader, incrementalDumperExecuteEngine, persistCallback);
   
   ...
   
           String databaseType = 
taskConfig.getJobConfig().getSourceDatabaseType();
           DataSource dataSource = 
dataSourceManager.getDataSource(taskConfig.getDumperConfig().getDataSourceConfig());
           return 
PositionInitializerFactory.getInstance(databaseType).init(dataSource);
   ```
   `int concurrency` and `sourceDatabaseType`.
   
   `TaskConfiguration` is planned to be common class used for some types of 
jobs, but `jobConfig` is not common, there're 2 possible solutions:
   1. Change `jobConfig` type to PipelineJobConfiguration, and add some common 
methods in PipelineJobConfiguration.
   2. Extract fields into `dumperConfig` or `importerConfig` and remove 
`jobConfig` from `TaskConfiguration`.
   
   Solution 2 is preferred.
   
   Possible changes:
   - Add `concurrency` in `ImporterConfiguration`
   - Use `taskConfig.getDumperConfig().getDataSourceConfig().getDatabaseType()` 
to replace `taskConfig.getJobConfig().getSourceDatabaseType()`
   - Remove `jobConfig` from `TaskConfiguration`
   
   


-- 
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]

Reply via email to