This is an automated email from the ASF dual-hosted git repository.
duanzhengqiang 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 11fb7842334 Refactor InventoryDumper (#32629)
11fb7842334 is described below
commit 11fb7842334b3696a06a7ffef8417d8ba77551a6
Author: Liang Zhang <[email protected]>
AuthorDate: Thu Aug 22 15:53:53 2024 +0800
Refactor InventoryDumper (#32629)
---
.../core/ingest/dumper/inventory/InventoryDumper.java | 15 ---------------
1 file changed, 15 deletions(-)
diff --git
a/kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/core/ingest/dumper/inventory/InventoryDumper.java
b/kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/core/ingest/dumper/inventory/InventoryDumper.java
index 61a6e05f124..650713b08e8 100644
---
a/kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/core/ingest/dumper/inventory/InventoryDumper.java
+++
b/kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/core/ingest/dumper/inventory/InventoryDumper.java
@@ -49,7 +49,6 @@ import
org.apache.shardingsphere.data.pipeline.core.util.PipelineJdbcUtils;
import org.apache.shardingsphere.infra.annotation.HighFrequencyInvocation;
import org.apache.shardingsphere.infra.database.core.type.DatabaseType;
import
org.apache.shardingsphere.infra.exception.core.ShardingSpherePreconditions;
-import
org.apache.shardingsphere.infra.metadata.caseinsensitive.CaseInsensitiveIdentifier;
import javax.sql.DataSource;
import java.sql.Connection;
@@ -65,7 +64,6 @@ import java.util.Objects;
import java.util.Optional;
import java.util.concurrent.atomic.AtomicLong;
import java.util.concurrent.atomic.AtomicReference;
-import java.util.stream.Collectors;
/**
* Inventory dumper.
@@ -91,9 +89,6 @@ public class InventoryDumper extends
AbstractPipelineLifecycleRunnable implement
private PipelineTableMetaData tableMetaData;
- // TODO now Remove
- private List<CaseInsensitiveIdentifier> uniqueKeysNames =
Collections.emptyList();
-
public InventoryDumper(final InventoryDumperContext dumperContext, final
PipelineChannel channel, final DataSource dataSource, final
PipelineTableMetaDataLoader metaDataLoader) {
this.dumperContext = dumperContext;
this.channel = channel;
@@ -134,22 +129,12 @@ public class InventoryDumper extends
AbstractPipelineLifecycleRunnable implement
* Initialize.
*/
public void init() {
- if (null == uniqueKeysNames) {
- uniqueKeysNames = getUniqueKeysNames();
- }
if (null == tableMetaData) {
tableMetaData = metaDataLoader.getTableMetaData(
dumperContext.getCommonContext().getTableAndSchemaNameMapper().getSchemaName(dumperContext.getLogicTableName()),
dumperContext.getActualTableName());
}
}
- private List<CaseInsensitiveIdentifier> getUniqueKeysNames() {
- if (dumperContext.hasUniqueKey()) {
- return dumperContext.getUniqueKeyColumns().stream().map(each ->
new CaseInsensitiveIdentifier(each.getName())).collect(Collectors.toList());
- }
- return Collections.emptyList();
- }
-
@SuppressWarnings("MagicConstant")
private void dumpWithStreamingQuery(final Connection connection) throws
SQLException {
int batchSize = dumperContext.getBatchSize();