sandynz commented on code in PR #19949: URL: https://github.com/apache/shardingsphere/pull/19949#discussion_r940207935
########## shardingsphere-test/shardingsphere-pipeline-test/src/test/resources/META-INF/services/org.apache.shardingsphere.scaling.core.job.importer.ImporterCreator: ########## @@ -0,0 +1,18 @@ +# +# 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. +# + +org.apache.shardingsphere.data.pipeline.core.fixture.FixtureImporterCreator Review Comment: It should be ended with new line ########## shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-core/src/main/java/org/apache/shardingsphere/scaling/core/job/importer/DefaultImporterCreator.java: ########## @@ -27,22 +27,27 @@ import org.apache.shardingsphere.data.pipeline.spi.importer.Importer; /** - * Importer factory. + * Default importer creator. */ -@NoArgsConstructor(access = AccessLevel.PRIVATE) -public final class ImporterFactory { +public class DefaultImporterCreator implements ImporterCreator { - /** - * Create importer. - * - * @param importerConfig importer configuration - * @param dataSourceManager data source manager - * @param channel channel - * @param jobProgressListener job progress listener - * @return importer - */ - public static Importer createImporter(final ImporterConfiguration importerConfig, final PipelineDataSourceManager dataSourceManager, final PipelineChannel channel, - final PipelineJobProgressListener jobProgressListener) { + @Override + public String getType() { + return "MySQL"; + } + + @Override + public Collection<String> getTypeAliases() { + Collection<String> aliases = new LinkedList<>(); + aliases.add("PostgreSQL"); + aliases.add("openGauss"); + return aliases; + } Review Comment: It's better to put getType() and getTypeAliases() at the bottom of class, conventionally ########## shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-core/src/test/resources/META-INF/services/org.apache.shardingsphere.scaling.core.job.importer.ImporterCreator: ########## @@ -0,0 +1,18 @@ +# +# 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. +# + +org.apache.shardingsphere.scaling.core.job.importer.DefaultImporterCreator Review Comment: It should be ended with new line ########## shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-core/src/main/java/org/apache/shardingsphere/scaling/core/job/importer/DefaultImporterCreator.java: ########## @@ -27,22 +27,27 @@ import org.apache.shardingsphere.data.pipeline.spi.importer.Importer; /** - * Importer factory. + * Default importer creator. */ -@NoArgsConstructor(access = AccessLevel.PRIVATE) -public final class ImporterFactory { +public class DefaultImporterCreator implements ImporterCreator { Review Comment: `final` could be added for class -- 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]
