This is an automated email from the ASF dual-hosted git repository.

zhonghongsheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git


The following commit(s) were added to refs/heads/master by this push:
     new b95a0aa8a9c Add InventoryDumperCreator SPI to decouple InventoryDumper 
and ScalingEntry (#20157)
b95a0aa8a9c is described below

commit b95a0aa8a9ce59f53d97a102adad8b8701a3b8aa
Author: Da Xiang Huang <[email protected]>
AuthorDate: Sun Aug 14 11:33:01 2022 +0800

    Add InventoryDumperCreator SPI to decouple InventoryDumper and ScalingEntry 
(#20157)
---
 .../ingest/dumper/InventoryDumperCreator.java}     | 30 ++++----
 .../dumper/InventoryDumperCreatorFactory.java}     | 35 +++++----
 .../data/pipeline/core/task/InventoryTask.java     |  5 +-
 .../scaling/core/job/dumper/DumperFactory.java     | 21 ------
 .../scaling/core/spi/ScalingEntry.java             |  8 ---
 .../core/spi/fixture/ScalingEntryFixture.java      |  6 --
 .../data/pipeline/mysql/MySQLScalingEntry.java     |  6 --
 ...Entry.java => MySqlInventoryDumperCreator.java} | 24 +++----
 ...eline.core.ingest.dumper.InventoryDumperCreator | 19 +++++
 .../data/pipeline/mysql/MySQLScalingEntryTest.java |  2 -
 .../pipeline/opengauss/OpenGaussScalingEntry.java  |  6 --
 .../opengauss/OpenGaussScalingEntryTest.java       |  2 -
 ....java => PostgreSQLInventoryDumperCreator.java} | 23 +++---
 .../postgresql/PostgreSQLScalingEntry.java         |  6 --
 ...eline.core.ingest.dumper.InventoryDumperCreator | 19 +++++
 .../postgresql/PostgreSQLScalingEntryTest.java     |  2 -
 .../dumper/InventoryDumperCreatorFactoryTest.java  | 83 ++++++++++++++++++++++
 .../fixture/FixtureInventoryDumperCreator.java     | 53 ++++++++++++++
 .../core/fixture/H2ScalingEntryFixture.java        |  6 --
 ...eline.core.ingest.dumper.InventoryDumperCreator | 18 +++++
 20 files changed, 250 insertions(+), 124 deletions(-)

diff --git 
a/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-core/src/main/java/org/apache/shardingsphere/scaling/core/spi/ScalingEntry.java
 
b/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-core/src/main/java/org/apache/shardingsphere/data/pipeline/core/ingest/dumper/InventoryDumperCreator.java
similarity index 52%
copy from 
shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-core/src/main/java/org/apache/shardingsphere/scaling/core/spi/ScalingEntry.java
copy to 
shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-core/src/main/java/org/apache/shardingsphere/data/pipeline/core/ingest/dumper/InventoryDumperCreator.java
index 5c1dfd02e6a..0bc3df83de2 100644
--- 
a/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-core/src/main/java/org/apache/shardingsphere/scaling/core/spi/ScalingEntry.java
+++ 
b/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-core/src/main/java/org/apache/shardingsphere/data/pipeline/core/ingest/dumper/InventoryDumperCreator.java
@@ -15,30 +15,30 @@
  * limitations under the License.
  */
 
-package org.apache.shardingsphere.scaling.core.spi;
+package org.apache.shardingsphere.data.pipeline.core.ingest.dumper;
 
-import 
org.apache.shardingsphere.data.pipeline.spi.ingest.dumper.IncrementalDumper;
+import javax.sql.DataSource;
+import 
org.apache.shardingsphere.data.pipeline.api.config.ingest.InventoryDumperConfiguration;
+import 
org.apache.shardingsphere.data.pipeline.api.ingest.channel.PipelineChannel;
+import 
org.apache.shardingsphere.data.pipeline.core.metadata.loader.PipelineTableMetaDataLoader;
 import 
org.apache.shardingsphere.data.pipeline.spi.ingest.dumper.InventoryDumper;
 import org.apache.shardingsphere.infra.util.spi.annotation.SingletonSPI;
 import org.apache.shardingsphere.infra.util.spi.type.typed.TypedSPI;
 
 /**
- * Scaling entry.
+ * Inventory dumper creator.
  */
 @SingletonSPI
-public interface ScalingEntry extends TypedSPI {
+public interface InventoryDumperCreator extends TypedSPI {
     
     /**
-     * Get inventory dumper type.
-     *
-     * @return inventory dumper type
+     * Create Inventory Dumper.
+     * @param inventoryDumperConfig inventoryDumperConfig
+     * @param channel chanel
+     * @param sourceDataSource sourceDataSource
+     * @param sourceMetaDataLoader sourceMetaDataLoader
+     * @return InventoryDumper
      */
-    Class<? extends InventoryDumper> getInventoryDumperClass();
-    
-    /**
-     * Get incremental dumper type.
-     *
-     * @return incremental dumper type
-     */
-    Class<? extends IncrementalDumper> getIncrementalDumperClass();
+    InventoryDumper createInventoryDumper(InventoryDumperConfiguration 
inventoryDumperConfig, PipelineChannel channel,
+                                          DataSource sourceDataSource, 
PipelineTableMetaDataLoader sourceMetaDataLoader);
 }
diff --git 
a/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-core/src/main/java/org/apache/shardingsphere/scaling/core/spi/ScalingEntry.java
 
b/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-core/src/main/java/org/apache/shardingsphere/data/pipeline/core/ingest/dumper/InventoryDumperCreatorFactory.java
similarity index 54%
copy from 
shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-core/src/main/java/org/apache/shardingsphere/scaling/core/spi/ScalingEntry.java
copy to 
shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-core/src/main/java/org/apache/shardingsphere/data/pipeline/core/ingest/dumper/InventoryDumperCreatorFactory.java
index 5c1dfd02e6a..f291b6ad0be 100644
--- 
a/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-core/src/main/java/org/apache/shardingsphere/scaling/core/spi/ScalingEntry.java
+++ 
b/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-core/src/main/java/org/apache/shardingsphere/data/pipeline/core/ingest/dumper/InventoryDumperCreatorFactory.java
@@ -15,30 +15,29 @@
  * limitations under the License.
  */
 
-package org.apache.shardingsphere.scaling.core.spi;
+package org.apache.shardingsphere.data.pipeline.core.ingest.dumper;
 
-import 
org.apache.shardingsphere.data.pipeline.spi.ingest.dumper.IncrementalDumper;
-import 
org.apache.shardingsphere.data.pipeline.spi.ingest.dumper.InventoryDumper;
-import org.apache.shardingsphere.infra.util.spi.annotation.SingletonSPI;
-import org.apache.shardingsphere.infra.util.spi.type.typed.TypedSPI;
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
+import org.apache.shardingsphere.infra.util.spi.ShardingSphereServiceLoader;
+import org.apache.shardingsphere.infra.util.spi.type.typed.TypedSPIRegistry;
 
 /**
- * Scaling entry.
+ * InventoryDumper creator factory.
  */
-@SingletonSPI
-public interface ScalingEntry extends TypedSPI {
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
+public class InventoryDumperCreatorFactory {
     
-    /**
-     * Get inventory dumper type.
-     *
-     * @return inventory dumper type
-     */
-    Class<? extends InventoryDumper> getInventoryDumperClass();
+    static {
+        ShardingSphereServiceLoader.register(InventoryDumperCreator.class);
+    }
     
     /**
-     * Get incremental dumper type.
-     *
-     * @return incremental dumper type
+     * Get inventoryDumper creator instance.
+     * @param databaseType databaseType
+     * @return InventoryDumperCreator
      */
-    Class<? extends IncrementalDumper> getIncrementalDumperClass();
+    public static InventoryDumperCreator getInstance(final String 
databaseType) {
+        return 
TypedSPIRegistry.getRegisteredService(InventoryDumperCreator.class, 
databaseType);
+    }
 }
diff --git 
a/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-core/src/main/java/org/apache/shardingsphere/data/pipeline/core/task/InventoryTask.java
 
b/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-core/src/main/java/org/apache/shardingsphere/data/pipeline/core/task/InventoryTask.java
index ffc9f328832..b3b79657d2d 100644
--- 
a/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-core/src/main/java/org/apache/shardingsphere/data/pipeline/core/task/InventoryTask.java
+++ 
b/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-core/src/main/java/org/apache/shardingsphere/data/pipeline/core/task/InventoryTask.java
@@ -34,11 +34,11 @@ import 
org.apache.shardingsphere.data.pipeline.api.task.progress.InventoryTaskPr
 import 
org.apache.shardingsphere.data.pipeline.core.exception.PipelineJobExecutionException;
 import org.apache.shardingsphere.data.pipeline.core.execute.ExecuteCallback;
 import org.apache.shardingsphere.data.pipeline.core.execute.ExecuteEngine;
+import 
org.apache.shardingsphere.data.pipeline.core.ingest.dumper.InventoryDumperCreatorFactory;
 import 
org.apache.shardingsphere.data.pipeline.core.metadata.loader.PipelineTableMetaDataLoader;
 import 
org.apache.shardingsphere.data.pipeline.spi.importer.ImporterCreatorFactory;
 import 
org.apache.shardingsphere.data.pipeline.spi.ingest.channel.PipelineChannelCreator;
 import org.apache.shardingsphere.data.pipeline.spi.ingest.dumper.Dumper;
-import org.apache.shardingsphere.scaling.core.job.dumper.DumperFactory;
 
 import javax.sql.DataSource;
 import java.util.List;
@@ -72,7 +72,8 @@ public final class InventoryTask extends 
AbstractLifecycleExecutor implements Pi
         this.importerExecuteEngine = importerExecuteEngine;
         taskId = generateTaskId(inventoryDumperConfig);
         channel = createChannel(pipelineChannelCreator);
-        dumper = DumperFactory.createInventoryDumper(inventoryDumperConfig, 
channel, sourceDataSource, sourceMetaDataLoader);
+        dumper = 
InventoryDumperCreatorFactory.getInstance(importerConfig.getDataSourceConfig().getDatabaseType().getType()).createInventoryDumper(inventoryDumperConfig,
 channel, sourceDataSource,
+                sourceMetaDataLoader);
         importer = 
ImporterCreatorFactory.getInstance(importerConfig.getDataSourceConfig().getDatabaseType().getType()).createImporter(importerConfig,
 dataSourceManager, channel, jobProgressListener);
         position = inventoryDumperConfig.getPosition();
     }
diff --git 
a/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-core/src/main/java/org/apache/shardingsphere/scaling/core/job/dumper/DumperFactory.java
 
b/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-core/src/main/java/org/apache/shardingsphere/scaling/core/job/dumper/DumperFactory.java
index 35d3fc767ca..33018249945 100644
--- 
a/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-core/src/main/java/org/apache/shardingsphere/scaling/core/job/dumper/DumperFactory.java
+++ 
b/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-core/src/main/java/org/apache/shardingsphere/scaling/core/job/dumper/DumperFactory.java
@@ -21,16 +21,13 @@ import lombok.AccessLevel;
 import lombok.NoArgsConstructor;
 import lombok.SneakyThrows;
 import 
org.apache.shardingsphere.data.pipeline.api.config.ingest.DumperConfiguration;
-import 
org.apache.shardingsphere.data.pipeline.api.config.ingest.InventoryDumperConfiguration;
 import 
org.apache.shardingsphere.data.pipeline.api.ingest.channel.PipelineChannel;
 import 
org.apache.shardingsphere.data.pipeline.api.ingest.position.IngestPosition;
 import 
org.apache.shardingsphere.data.pipeline.core.metadata.loader.PipelineTableMetaDataLoader;
 import 
org.apache.shardingsphere.data.pipeline.spi.ingest.dumper.IncrementalDumper;
-import 
org.apache.shardingsphere.data.pipeline.spi.ingest.dumper.InventoryDumper;
 import org.apache.shardingsphere.scaling.core.spi.ScalingEntry;
 import org.apache.shardingsphere.scaling.core.spi.ScalingEntryFactory;
 
-import javax.sql.DataSource;
 import java.lang.reflect.Constructor;
 
 /**
@@ -39,24 +36,6 @@ import java.lang.reflect.Constructor;
 @NoArgsConstructor(access = AccessLevel.PRIVATE)
 public final class DumperFactory {
     
-    /**
-     * Create inventory dumper.
-     *
-     * @param inventoryDumperConfig inventory dumper configuration
-     * @param channel channel
-     * @param sourceDataSource data source
-     * @param sourceMetaDataLoader metadata loader
-     * @return inventory dumper
-     */
-    @SneakyThrows(ReflectiveOperationException.class)
-    public static InventoryDumper createInventoryDumper(final 
InventoryDumperConfiguration inventoryDumperConfig, final PipelineChannel 
channel,
-                                                        final DataSource 
sourceDataSource, final PipelineTableMetaDataLoader sourceMetaDataLoader) {
-        ScalingEntry scalingEntry = 
ScalingEntryFactory.getInstance(inventoryDumperConfig.getDataSourceConfig().getDatabaseType().getType());
-        Constructor<? extends InventoryDumper> constructor = 
scalingEntry.getInventoryDumperClass()
-                .getConstructor(InventoryDumperConfiguration.class, 
PipelineChannel.class, DataSource.class, PipelineTableMetaDataLoader.class);
-        return constructor.newInstance(inventoryDumperConfig, channel, 
sourceDataSource, sourceMetaDataLoader);
-    }
-    
     /**
      * Create incremental dumper.
      *
diff --git 
a/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-core/src/main/java/org/apache/shardingsphere/scaling/core/spi/ScalingEntry.java
 
b/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-core/src/main/java/org/apache/shardingsphere/scaling/core/spi/ScalingEntry.java
index 5c1dfd02e6a..16a446b0563 100644
--- 
a/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-core/src/main/java/org/apache/shardingsphere/scaling/core/spi/ScalingEntry.java
+++ 
b/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-core/src/main/java/org/apache/shardingsphere/scaling/core/spi/ScalingEntry.java
@@ -18,7 +18,6 @@
 package org.apache.shardingsphere.scaling.core.spi;
 
 import 
org.apache.shardingsphere.data.pipeline.spi.ingest.dumper.IncrementalDumper;
-import 
org.apache.shardingsphere.data.pipeline.spi.ingest.dumper.InventoryDumper;
 import org.apache.shardingsphere.infra.util.spi.annotation.SingletonSPI;
 import org.apache.shardingsphere.infra.util.spi.type.typed.TypedSPI;
 
@@ -28,13 +27,6 @@ import 
org.apache.shardingsphere.infra.util.spi.type.typed.TypedSPI;
 @SingletonSPI
 public interface ScalingEntry extends TypedSPI {
     
-    /**
-     * Get inventory dumper type.
-     *
-     * @return inventory dumper type
-     */
-    Class<? extends InventoryDumper> getInventoryDumperClass();
-    
     /**
      * Get incremental dumper type.
      *
diff --git 
a/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-core/src/test/java/org/apache/shardingsphere/scaling/core/spi/fixture/ScalingEntryFixture.java
 
b/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-core/src/test/java/org/apache/shardingsphere/scaling/core/spi/fixture/ScalingEntryFixture.java
index 68ab8ffa9eb..a7977bdd659 100644
--- 
a/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-core/src/test/java/org/apache/shardingsphere/scaling/core/spi/fixture/ScalingEntryFixture.java
+++ 
b/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-core/src/test/java/org/apache/shardingsphere/scaling/core/spi/fixture/ScalingEntryFixture.java
@@ -18,16 +18,10 @@
 package org.apache.shardingsphere.scaling.core.spi.fixture;
 
 import 
org.apache.shardingsphere.data.pipeline.spi.ingest.dumper.IncrementalDumper;
-import 
org.apache.shardingsphere.data.pipeline.spi.ingest.dumper.InventoryDumper;
 import org.apache.shardingsphere.scaling.core.spi.ScalingEntry;
 
 public final class ScalingEntryFixture implements ScalingEntry {
     
-    @Override
-    public Class<? extends InventoryDumper> getInventoryDumperClass() {
-        return InventoryDumper.class;
-    }
-    
     @Override
     public Class<? extends IncrementalDumper> getIncrementalDumperClass() {
         return IncrementalDumper.class;
diff --git 
a/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-dialect/shardingsphere-data-pipeline-mysql/src/main/java/org/apache/shardingsphere/data/pipeline/mysql/MySQLScalingEntry.java
 
b/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-dialect/shardingsphere-data-pipeline-mysql/src/main/java/org/apache/shardingsphere/data/pipeline/mysql/MySQLScalingEntry.java
index 71c4c23fac0..3943324a795 100644
--- 
a/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-dialect/shardingsphere-data-pipeline-mysql/src/main/java/org/apache/shardingsphere/data/pipeline/mysql/MySQLScalingEntry.java
+++ 
b/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-dialect/shardingsphere-data-pipeline-mysql/src/main/java/org/apache/shardingsphere/data/pipeline/mysql/MySQLScalingEntry.java
@@ -18,7 +18,6 @@
 package org.apache.shardingsphere.data.pipeline.mysql;
 
 import 
org.apache.shardingsphere.data.pipeline.mysql.ingest.MySQLIncrementalDumper;
-import 
org.apache.shardingsphere.data.pipeline.mysql.ingest.MySQLInventoryDumper;
 import org.apache.shardingsphere.scaling.core.spi.ScalingEntry;
 
 /**
@@ -26,11 +25,6 @@ import 
org.apache.shardingsphere.scaling.core.spi.ScalingEntry;
  */
 public final class MySQLScalingEntry implements ScalingEntry {
     
-    @Override
-    public Class<MySQLInventoryDumper> getInventoryDumperClass() {
-        return MySQLInventoryDumper.class;
-    }
-    
     @Override
     public Class<MySQLIncrementalDumper> getIncrementalDumperClass() {
         return MySQLIncrementalDumper.class;
diff --git 
a/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-dialect/shardingsphere-data-pipeline-mysql/src/main/java/org/apache/shardingsphere/data/pipeline/mysql/MySQLScalingEntry.java
 
b/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-dialect/shardingsphere-data-pipeline-mysql/src/main/java/org/apache/shardingsphere/data/pipeline/mysql/MySqlInventoryDumperCreator.java
similarity index 51%
copy from 
shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-dialect/shardingsphere-data-pipeline-mysql/src/main/java/org/apache/shardingsphere/data/pipeline/mysql/MySQLScalingEntry.java
copy to 
shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-dialect/shardingsphere-data-pipeline-mysql/src/main/java/org/apache/shardingsphere/data/pipeline/mysql/MySqlInventoryDumperCreator.java
index 71c4c23fac0..7697ee5d13c 100644
--- 
a/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-dialect/shardingsphere-data-pipeline-mysql/src/main/java/org/apache/shardingsphere/data/pipeline/mysql/MySQLScalingEntry.java
+++ 
b/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-dialect/shardingsphere-data-pipeline-mysql/src/main/java/org/apache/shardingsphere/data/pipeline/mysql/MySqlInventoryDumperCreator.java
@@ -17,23 +17,21 @@
 
 package org.apache.shardingsphere.data.pipeline.mysql;
 
-import 
org.apache.shardingsphere.data.pipeline.mysql.ingest.MySQLIncrementalDumper;
+import javax.sql.DataSource;
+import 
org.apache.shardingsphere.data.pipeline.api.config.ingest.InventoryDumperConfiguration;
+import 
org.apache.shardingsphere.data.pipeline.api.ingest.channel.PipelineChannel;
+import 
org.apache.shardingsphere.data.pipeline.core.ingest.dumper.InventoryDumperCreator;
+import 
org.apache.shardingsphere.data.pipeline.core.metadata.loader.PipelineTableMetaDataLoader;
 import 
org.apache.shardingsphere.data.pipeline.mysql.ingest.MySQLInventoryDumper;
-import org.apache.shardingsphere.scaling.core.spi.ScalingEntry;
+import 
org.apache.shardingsphere.data.pipeline.spi.ingest.dumper.InventoryDumper;
 
-/**
- * MySQL scaling entry.
- */
-public final class MySQLScalingEntry implements ScalingEntry {
-    
-    @Override
-    public Class<MySQLInventoryDumper> getInventoryDumperClass() {
-        return MySQLInventoryDumper.class;
-    }
+public class MySqlInventoryDumperCreator implements InventoryDumperCreator {
     
     @Override
-    public Class<MySQLIncrementalDumper> getIncrementalDumperClass() {
-        return MySQLIncrementalDumper.class;
+    public InventoryDumper createInventoryDumper(final 
InventoryDumperConfiguration inventoryDumperConfig,
+                                                 final PipelineChannel 
channel, final DataSource sourceDataSource,
+                                                 final 
PipelineTableMetaDataLoader sourceMetaDataLoader) {
+        return new MySQLInventoryDumper(inventoryDumperConfig, channel, 
sourceDataSource, sourceMetaDataLoader);
     }
     
     @Override
diff --git 
a/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-dialect/shardingsphere-data-pipeline-mysql/src/main/resources/META-INF/services/org.apache.shardingsphere.data.pipeline.core.ingest.dumper.InventoryDumperCreator
 
b/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-dialect/shardingsphere-data-pipeline-mysql/src/main/resources/META-INF/services/org.apache.shardingsphere.data.pipeline.core.ingest.dumper.InventoryDumperCreator
new file mode 100644
index 00000000000..031f57d19b6
--- /dev/null
+++ 
b/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-dialect/shardingsphere-data-pipeline-mysql/src/main/resources/META-INF/services/org.apache.shardingsphere.data.pipeline.core.ingest.dumper.InventoryDumperCreator
@@ -0,0 +1,19 @@
+#
+# 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.mysql.MySqlInventoryDumperCreator
+
diff --git 
a/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-dialect/shardingsphere-data-pipeline-mysql/src/test/java/org/apache/shardingsphere/data/pipeline/mysql/MySQLScalingEntryTest.java
 
b/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-dialect/shardingsphere-data-pipeline-mysql/src/test/java/org/apache/shardingsphere/data/pipeline/mysql/MySQLScalingEntryTest.java
index 5ce566cb32e..e90fa4981d1 100644
--- 
a/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-dialect/shardingsphere-data-pipeline-mysql/src/test/java/org/apache/shardingsphere/data/pipeline/mysql/MySQLScalingEntryTest.java
+++ 
b/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-dialect/shardingsphere-data-pipeline-mysql/src/test/java/org/apache/shardingsphere/data/pipeline/mysql/MySQLScalingEntryTest.java
@@ -18,7 +18,6 @@
 package org.apache.shardingsphere.data.pipeline.mysql;
 
 import 
org.apache.shardingsphere.data.pipeline.mysql.ingest.MySQLIncrementalDumper;
-import 
org.apache.shardingsphere.data.pipeline.mysql.ingest.MySQLInventoryDumper;
 import org.apache.shardingsphere.scaling.core.spi.ScalingEntry;
 import org.apache.shardingsphere.scaling.core.spi.ScalingEntryFactory;
 import org.junit.Test;
@@ -33,7 +32,6 @@ public final class MySQLScalingEntryTest {
     public void assertGetScalingEntryByDatabaseType() {
         ScalingEntry scalingEntry = ScalingEntryFactory.getInstance("MySQL");
         assertThat(scalingEntry, instanceOf(MySQLScalingEntry.class));
-        assertThat(scalingEntry.getInventoryDumperClass(), 
equalTo(MySQLInventoryDumper.class));
         assertThat(scalingEntry.getIncrementalDumperClass(), 
equalTo(MySQLIncrementalDumper.class));
     }
 }
diff --git 
a/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-dialect/shardingsphere-data-pipeline-opengauss/src/main/java/org/apache/shardingsphere/data/pipeline/opengauss/OpenGaussScalingEntry.java
 
b/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-dialect/shardingsphere-data-pipeline-opengauss/src/main/java/org/apache/shardingsphere/data/pipeline/opengauss/OpenGaussScalingEntry.java
index 36a072b9e57..8cdbadb8660 100644
--- 
a/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-dialect/shardingsphere-data-pipeline-opengauss/src/main/java/org/apache/shardingsphere/data/pipeline/opengauss/OpenGaussScalingEntry.java
+++ 
b/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-dialect/shardingsphere-data-pipeline-opengauss/src/main/java/org/apache/shardingsphere/data/pipeline/opengauss/OpenGaussScalingEntry.java
@@ -18,7 +18,6 @@
 package org.apache.shardingsphere.data.pipeline.opengauss;
 
 import 
org.apache.shardingsphere.data.pipeline.opengauss.ingest.OpenGaussWalDumper;
-import 
org.apache.shardingsphere.data.pipeline.postgresql.ingest.PostgreSQLInventoryDumper;
 import org.apache.shardingsphere.scaling.core.spi.ScalingEntry;
 
 /**
@@ -26,11 +25,6 @@ import 
org.apache.shardingsphere.scaling.core.spi.ScalingEntry;
  */
 public final class OpenGaussScalingEntry implements ScalingEntry {
     
-    @Override
-    public Class<PostgreSQLInventoryDumper> getInventoryDumperClass() {
-        return PostgreSQLInventoryDumper.class;
-    }
-    
     @Override
     public Class<OpenGaussWalDumper> getIncrementalDumperClass() {
         return OpenGaussWalDumper.class;
diff --git 
a/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-dialect/shardingsphere-data-pipeline-opengauss/src/test/java/org/apache/shardingsphere/data/pipeline/opengauss/OpenGaussScalingEntryTest.java
 
b/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-dialect/shardingsphere-data-pipeline-opengauss/src/test/java/org/apache/shardingsphere/data/pipeline/opengauss/OpenGaussScalingEntryTest.java
index 8c648087a4f..b3534b91be9 100644
--- 
a/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-dialect/shardingsphere-data-pipeline-opengauss/src/test/java/org/apache/shardingsphere/data/pipeline/opengauss/OpenGaussScalingEntryTest.java
+++ 
b/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-dialect/shardingsphere-data-pipeline-opengauss/src/test/java/org/apache/shardingsphere/data/pipeline/opengauss/OpenGaussScalingEntryTest.java
@@ -18,7 +18,6 @@
 package org.apache.shardingsphere.data.pipeline.opengauss;
 
 import 
org.apache.shardingsphere.data.pipeline.opengauss.ingest.OpenGaussWalDumper;
-import 
org.apache.shardingsphere.data.pipeline.postgresql.ingest.PostgreSQLInventoryDumper;
 import org.apache.shardingsphere.scaling.core.spi.ScalingEntry;
 import org.apache.shardingsphere.scaling.core.spi.ScalingEntryFactory;
 import org.junit.Test;
@@ -33,7 +32,6 @@ public final class OpenGaussScalingEntryTest {
     public void assertGetScalingEntryByDatabaseType() {
         ScalingEntry actual = ScalingEntryFactory.getInstance("openGauss");
         assertThat(actual, instanceOf(OpenGaussScalingEntry.class));
-        assertThat(actual.getInventoryDumperClass(), 
equalTo(PostgreSQLInventoryDumper.class));
         assertThat(actual.getIncrementalDumperClass(), 
equalTo(OpenGaussWalDumper.class));
     }
 }
diff --git 
a/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-dialect/shardingsphere-data-pipeline-postgresql/src/main/java/org/apache/shardingsphere/data/pipeline/postgresql/PostgreSQLScalingEntry.java
 
b/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-dialect/shardingsphere-data-pipeline-postgresql/src/main/java/org/apache/shardingsphere/data/pipeline/postgresql/PostgreSQLInventoryDumperCreator.java
similarity index 50%
copy from 
shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-dialect/shardingsphere-data-pipeline-postgresql/src/main/java/org/apache/shardingsphere/data/pipeline/postgresql/PostgreSQLScalingEntry.java
copy to 
shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-dialect/shardingsphere-data-pipeline-postgresql/src/main/java/org/apache/shardingsphere/data/pipeline/postgresql/PostgreSQLInventoryDumperCreator.java
index b21636c5743..357edb203ea 100644
--- 
a/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-dialect/shardingsphere-data-pipeline-postgresql/src/main/java/org/apache/shardingsphere/data/pipeline/postgresql/PostgreSQLScalingEntry.java
+++ 
b/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-dialect/shardingsphere-data-pipeline-postgresql/src/main/java/org/apache/shardingsphere/data/pipeline/postgresql/PostgreSQLInventoryDumperCreator.java
@@ -17,23 +17,24 @@
 
 package org.apache.shardingsphere.data.pipeline.postgresql;
 
+import javax.sql.DataSource;
+import 
org.apache.shardingsphere.data.pipeline.api.config.ingest.InventoryDumperConfiguration;
+import 
org.apache.shardingsphere.data.pipeline.api.ingest.channel.PipelineChannel;
+import 
org.apache.shardingsphere.data.pipeline.core.ingest.dumper.InventoryDumperCreator;
+import 
org.apache.shardingsphere.data.pipeline.core.metadata.loader.PipelineTableMetaDataLoader;
 import 
org.apache.shardingsphere.data.pipeline.postgresql.ingest.PostgreSQLInventoryDumper;
-import 
org.apache.shardingsphere.data.pipeline.postgresql.ingest.PostgreSQLWalDumper;
-import org.apache.shardingsphere.scaling.core.spi.ScalingEntry;
+import 
org.apache.shardingsphere.data.pipeline.spi.ingest.dumper.InventoryDumper;
 
 /**
- * PostgreSQL scaling entry.
+ * PostgreSQL inventory dumper creator.
  */
-public final class PostgreSQLScalingEntry implements ScalingEntry {
+public class PostgreSQLInventoryDumperCreator implements 
InventoryDumperCreator {
     
     @Override
-    public Class<PostgreSQLInventoryDumper> getInventoryDumperClass() {
-        return PostgreSQLInventoryDumper.class;
-    }
-    
-    @Override
-    public Class<PostgreSQLWalDumper> getIncrementalDumperClass() {
-        return PostgreSQLWalDumper.class;
+    public InventoryDumper createInventoryDumper(final 
InventoryDumperConfiguration inventoryDumperConfig,
+                                                 final PipelineChannel 
channel, final DataSource sourceDataSource,
+                                                 final 
PipelineTableMetaDataLoader sourceMetaDataLoader) {
+        return new PostgreSQLInventoryDumper(inventoryDumperConfig, channel, 
sourceDataSource, sourceMetaDataLoader);
     }
     
     @Override
diff --git 
a/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-dialect/shardingsphere-data-pipeline-postgresql/src/main/java/org/apache/shardingsphere/data/pipeline/postgresql/PostgreSQLScalingEntry.java
 
b/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-dialect/shardingsphere-data-pipeline-postgresql/src/main/java/org/apache/shardingsphere/data/pipeline/postgresql/PostgreSQLScalingEntry.java
index b21636c5743..1d04d0d25b8 100644
--- 
a/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-dialect/shardingsphere-data-pipeline-postgresql/src/main/java/org/apache/shardingsphere/data/pipeline/postgresql/PostgreSQLScalingEntry.java
+++ 
b/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-dialect/shardingsphere-data-pipeline-postgresql/src/main/java/org/apache/shardingsphere/data/pipeline/postgresql/PostgreSQLScalingEntry.java
@@ -17,7 +17,6 @@
 
 package org.apache.shardingsphere.data.pipeline.postgresql;
 
-import 
org.apache.shardingsphere.data.pipeline.postgresql.ingest.PostgreSQLInventoryDumper;
 import 
org.apache.shardingsphere.data.pipeline.postgresql.ingest.PostgreSQLWalDumper;
 import org.apache.shardingsphere.scaling.core.spi.ScalingEntry;
 
@@ -26,11 +25,6 @@ import 
org.apache.shardingsphere.scaling.core.spi.ScalingEntry;
  */
 public final class PostgreSQLScalingEntry implements ScalingEntry {
     
-    @Override
-    public Class<PostgreSQLInventoryDumper> getInventoryDumperClass() {
-        return PostgreSQLInventoryDumper.class;
-    }
-    
     @Override
     public Class<PostgreSQLWalDumper> getIncrementalDumperClass() {
         return PostgreSQLWalDumper.class;
diff --git 
a/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-dialect/shardingsphere-data-pipeline-postgresql/src/main/resources/META-INF/services/org.apache.shardingsphere.data.pipeline.core.ingest.dumper.InventoryDumperCreator
 
b/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-dialect/shardingsphere-data-pipeline-postgresql/src/main/resources/META-INF/services/org.apache.shardingsphere.data.pipeline.core.ingest.dumper.Invento
 [...]
new file mode 100644
index 00000000000..4864bf53ce9
--- /dev/null
+++ 
b/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-dialect/shardingsphere-data-pipeline-postgresql/src/main/resources/META-INF/services/org.apache.shardingsphere.data.pipeline.core.ingest.dumper.InventoryDumperCreator
@@ -0,0 +1,19 @@
+#
+# 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.postgresql.PostgreSQLInventoryDumperCreator
+
diff --git 
a/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-dialect/shardingsphere-data-pipeline-postgresql/src/test/java/org/apache/shardingsphere/data/pipeline/postgresql/PostgreSQLScalingEntryTest.java
 
b/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-dialect/shardingsphere-data-pipeline-postgresql/src/test/java/org/apache/shardingsphere/data/pipeline/postgresql/PostgreSQLScalingEntryTest.java
index 700e139d702..067db98f702 100644
--- 
a/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-dialect/shardingsphere-data-pipeline-postgresql/src/test/java/org/apache/shardingsphere/data/pipeline/postgresql/PostgreSQLScalingEntryTest.java
+++ 
b/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-dialect/shardingsphere-data-pipeline-postgresql/src/test/java/org/apache/shardingsphere/data/pipeline/postgresql/PostgreSQLScalingEntryTest.java
@@ -17,7 +17,6 @@
 
 package org.apache.shardingsphere.data.pipeline.postgresql;
 
-import 
org.apache.shardingsphere.data.pipeline.postgresql.ingest.PostgreSQLInventoryDumper;
 import 
org.apache.shardingsphere.data.pipeline.postgresql.ingest.PostgreSQLWalDumper;
 import org.apache.shardingsphere.scaling.core.spi.ScalingEntry;
 import org.apache.shardingsphere.scaling.core.spi.ScalingEntryFactory;
@@ -33,7 +32,6 @@ public final class PostgreSQLScalingEntryTest {
     public void assertGetScalingEntryByDatabaseType() {
         ScalingEntry scalingEntry = 
ScalingEntryFactory.getInstance("PostgreSQL");
         assertThat(scalingEntry, instanceOf(PostgreSQLScalingEntry.class));
-        assertThat(scalingEntry.getInventoryDumperClass(), 
equalTo(PostgreSQLInventoryDumper.class));
         assertThat(scalingEntry.getIncrementalDumperClass(), 
equalTo(PostgreSQLWalDumper.class));
     }
 }
diff --git 
a/shardingsphere-test/shardingsphere-pipeline-test/src/test/java/org/apache/shardingsphere/data/pipeline/core/dumper/InventoryDumperCreatorFactoryTest.java
 
b/shardingsphere-test/shardingsphere-pipeline-test/src/test/java/org/apache/shardingsphere/data/pipeline/core/dumper/InventoryDumperCreatorFactoryTest.java
new file mode 100644
index 00000000000..1a0bdbe56de
--- /dev/null
+++ 
b/shardingsphere-test/shardingsphere-pipeline-test/src/test/java/org/apache/shardingsphere/data/pipeline/core/dumper/InventoryDumperCreatorFactoryTest.java
@@ -0,0 +1,83 @@
+/*
+ * 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.data.pipeline.core.dumper;
+
+import static org.hamcrest.CoreMatchers.instanceOf;
+import static org.junit.Assert.assertThat;
+import 
org.apache.shardingsphere.data.pipeline.api.config.ingest.DumperConfiguration;
+import 
org.apache.shardingsphere.data.pipeline.api.config.ingest.InventoryDumperConfiguration;
+import 
org.apache.shardingsphere.data.pipeline.api.datasource.PipelineDataSourceManager;
+import 
org.apache.shardingsphere.data.pipeline.api.datasource.PipelineDataSourceWrapper;
+import 
org.apache.shardingsphere.data.pipeline.api.datasource.config.impl.StandardPipelineDataSourceConfiguration;
+import 
org.apache.shardingsphere.data.pipeline.core.datasource.DefaultPipelineDataSourceManager;
+import 
org.apache.shardingsphere.data.pipeline.core.fixture.FixtureInventoryDumper;
+import 
org.apache.shardingsphere.data.pipeline.core.ingest.channel.memory.SimpleMemoryPipelineChannel;
+import 
org.apache.shardingsphere.data.pipeline.core.ingest.dumper.InventoryDumperCreatorFactory;
+import 
org.apache.shardingsphere.data.pipeline.core.metadata.loader.PipelineTableMetaDataLoader;
+import 
org.apache.shardingsphere.data.pipeline.mysql.ingest.MySQLInventoryDumper;
+import 
org.apache.shardingsphere.data.pipeline.postgresql.ingest.PostgreSQLInventoryDumper;
+import 
org.apache.shardingsphere.data.pipeline.spi.ingest.dumper.InventoryDumper;
+import org.junit.Before;
+import org.junit.Test;
+
+public final class InventoryDumperCreatorFactoryTest {
+    
+    private PipelineDataSourceWrapper dataSource;
+    
+    @Before
+    public void setUp() {
+        PipelineDataSourceManager dataSourceManager = new 
DefaultPipelineDataSourceManager();
+        InventoryDumperConfiguration dumperConfig = 
mockInventoryDumperConfiguration();
+        dataSource = 
dataSourceManager.getDataSource(dumperConfig.getDataSourceConfig());
+    }
+    
+    @Test
+    public void assertInventoryDumperCreatorForMysql() {
+        InventoryDumper actual = 
InventoryDumperCreatorFactory.getInstance("MySql")
+                .createInventoryDumper(mockInventoryDumperConfiguration(), new 
SimpleMemoryPipelineChannel(100), dataSource, new 
PipelineTableMetaDataLoader(dataSource));
+        assertThat(actual, instanceOf(MySQLInventoryDumper.class));
+    }
+    
+    @Test
+    public void assertInventoryDumperCreatorForPostgreSQL() {
+        InventoryDumper actual = 
InventoryDumperCreatorFactory.getInstance("PostgreSQL")
+                .createInventoryDumper(mockInventoryDumperConfiguration(), new 
SimpleMemoryPipelineChannel(100), dataSource, new 
PipelineTableMetaDataLoader(dataSource));
+        assertThat(actual, instanceOf(PostgreSQLInventoryDumper.class));
+    }
+    
+    @Test
+    public void assertInventoryDumperCreatorForFixture() {
+        InventoryDumper actual = 
InventoryDumperCreatorFactory.getInstance("Fixture")
+                .createInventoryDumper(mockInventoryDumperConfiguration(), new 
SimpleMemoryPipelineChannel(100), dataSource, new 
PipelineTableMetaDataLoader(dataSource));
+        assertThat(actual, instanceOf(FixtureInventoryDumper.class));
+    }
+    
+    private InventoryDumperConfiguration mockInventoryDumperConfiguration() {
+        DumperConfiguration dumperConfig = mockDumperConfiguration();
+        InventoryDumperConfiguration result = new 
InventoryDumperConfiguration(dumperConfig);
+        result.setActualTableName("t_order");
+        result.setLogicTableName("t_order");
+        return result;
+    }
+    
+    private DumperConfiguration mockDumperConfiguration() {
+        DumperConfiguration result = new DumperConfiguration();
+        result.setDataSourceConfig(new 
StandardPipelineDataSourceConfiguration("jdbc:h2:mem:test;DB_CLOSE_DELAY=-1;DATABASE_TO_UPPER=false;MODE=PostgreSQL",
 "root", "root"));
+        return result;
+    }
+}
diff --git 
a/shardingsphere-test/shardingsphere-pipeline-test/src/test/java/org/apache/shardingsphere/data/pipeline/core/fixture/FixtureInventoryDumperCreator.java
 
b/shardingsphere-test/shardingsphere-pipeline-test/src/test/java/org/apache/shardingsphere/data/pipeline/core/fixture/FixtureInventoryDumperCreator.java
new file mode 100644
index 00000000000..d099e0ab3a9
--- /dev/null
+++ 
b/shardingsphere-test/shardingsphere-pipeline-test/src/test/java/org/apache/shardingsphere/data/pipeline/core/fixture/FixtureInventoryDumperCreator.java
@@ -0,0 +1,53 @@
+/*
+ * 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.data.pipeline.core.fixture;
+
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import javax.sql.DataSource;
+import 
org.apache.shardingsphere.data.pipeline.api.config.ingest.InventoryDumperConfiguration;
+import 
org.apache.shardingsphere.data.pipeline.api.ingest.channel.PipelineChannel;
+import 
org.apache.shardingsphere.data.pipeline.core.ingest.dumper.InventoryDumperCreator;
+import 
org.apache.shardingsphere.data.pipeline.core.metadata.loader.PipelineTableMetaDataLoader;
+import 
org.apache.shardingsphere.data.pipeline.spi.ingest.dumper.InventoryDumper;
+
+/**
+ * Fixture iInventory dumper creator.
+ */
+public class FixtureInventoryDumperCreator implements InventoryDumperCreator {
+    
+    private static final Collection<String> TYPE_ALIASES = 
Collections.unmodifiableList(Arrays.asList("Fixture", "H2"));
+    
+    @Override
+    public InventoryDumper createInventoryDumper(final 
InventoryDumperConfiguration inventoryDumperConfig,
+                                                 final PipelineChannel 
channel, final DataSource sourceDataSource,
+                                                 final 
PipelineTableMetaDataLoader sourceMetaDataLoader) {
+        return new FixtureInventoryDumper(inventoryDumperConfig, channel, 
sourceDataSource, sourceMetaDataLoader);
+    }
+    
+    @Override
+    public String getType() {
+        return "Fixture";
+    }
+    
+    @Override
+    public Collection<String> getTypeAliases() {
+        return TYPE_ALIASES;
+    }
+}
diff --git 
a/shardingsphere-test/shardingsphere-pipeline-test/src/test/java/org/apache/shardingsphere/data/pipeline/core/fixture/H2ScalingEntryFixture.java
 
b/shardingsphere-test/shardingsphere-pipeline-test/src/test/java/org/apache/shardingsphere/data/pipeline/core/fixture/H2ScalingEntryFixture.java
index d599be9af00..6b8f52196c6 100644
--- 
a/shardingsphere-test/shardingsphere-pipeline-test/src/test/java/org/apache/shardingsphere/data/pipeline/core/fixture/H2ScalingEntryFixture.java
+++ 
b/shardingsphere-test/shardingsphere-pipeline-test/src/test/java/org/apache/shardingsphere/data/pipeline/core/fixture/H2ScalingEntryFixture.java
@@ -18,16 +18,10 @@
 package org.apache.shardingsphere.data.pipeline.core.fixture;
 
 import 
org.apache.shardingsphere.data.pipeline.spi.ingest.dumper.IncrementalDumper;
-import 
org.apache.shardingsphere.data.pipeline.spi.ingest.dumper.InventoryDumper;
 import org.apache.shardingsphere.scaling.core.spi.ScalingEntry;
 
 public final class H2ScalingEntryFixture implements ScalingEntry {
     
-    @Override
-    public Class<? extends InventoryDumper> getInventoryDumperClass() {
-        return FixtureInventoryDumper.class;
-    }
-    
     @Override
     public Class<? extends IncrementalDumper> getIncrementalDumperClass() {
         return FixtureIncrementalDumper.class;
diff --git 
a/shardingsphere-test/shardingsphere-pipeline-test/src/test/resources/META-INF/services/org.apache.shardingsphere.data.pipeline.core.ingest.dumper.InventoryDumperCreator
 
b/shardingsphere-test/shardingsphere-pipeline-test/src/test/resources/META-INF/services/org.apache.shardingsphere.data.pipeline.core.ingest.dumper.InventoryDumperCreator
new file mode 100644
index 00000000000..2989bc73c9b
--- /dev/null
+++ 
b/shardingsphere-test/shardingsphere-pipeline-test/src/test/resources/META-INF/services/org.apache.shardingsphere.data.pipeline.core.ingest.dumper.InventoryDumperCreator
@@ -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.FixtureInventoryDumperCreator

Reply via email to