You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by zh...@apache.org on 2026/08/22 12:01:13 UTC
(shardingsphere) branch master updated: Remove useless pipeline DataNodeUtils (#39557)
This is an automated email from the ASF dual-hosted git repository.
terrymanu 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 6a9503300a7 Remove useless pipeline DataNodeUtils (#39557)
6a9503300a7 is described below
commit 6a9503300a7989769fc5393761a3e1b7d0ae09fd
Author: Liang Zhang <zh...@apache.org>
AuthorDate: Sat Aug 22 20:01:06 2026 +0800
Remove useless pipeline DataNodeUtils (#39557)
* Remove useless pipeline DataNodeUtils
* Remove useless pipeline DataNodeUtils
---
.../data/pipeline/core/datanode/DataNodeUtils.java | 41 ----------------
.../pipeline/core/datanode/JobDataNodeEntry.java | 2 +-
.../pipeline/core/datanode/DataNodeUtilsTest.java | 56 ----------------------
.../MigrationDataConsistencyChecker.java | 5 +-
4 files changed, 3 insertions(+), 101 deletions(-)
diff --git a/kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/core/datanode/DataNodeUtils.java b/kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/core/datanode/DataNodeUtils.java
deleted file mode 100644
index e716d7da1fa..00000000000
--- a/kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/core/datanode/DataNodeUtils.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * 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.datanode;
-
-import lombok.AccessLevel;
-import lombok.NoArgsConstructor;
-import org.apache.shardingsphere.infra.datanode.DataNode;
-import org.apache.shardingsphere.infra.exception.kernel.metadata.datanode.InvalidDataNodeFormatException;
-
-/**
- * Data node utility class.
- */
-@NoArgsConstructor(access = AccessLevel.PRIVATE)
-public final class DataNodeUtils {
-
- /**
- * Parse data node from text.
- *
- * @param text data node text
- * @return data node
- * @throws InvalidDataNodeFormatException invalid data nodes format exception
- */
- public static DataNode parseWithSchema(final String text) {
- return new DataNode(text);
- }
-}
diff --git a/kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/core/datanode/JobDataNodeEntry.java b/kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/core/datanode/JobDataNodeEntry.java
index 2960899e329..905470a04bc 100644
--- a/kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/core/datanode/JobDataNodeEntry.java
+++ b/kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/core/datanode/JobDataNodeEntry.java
@@ -45,7 +45,7 @@ public final class JobDataNodeEntry {
public static JobDataNodeEntry unmarshal(final String text) {
List<String> segments = Splitter.on(":").splitToList(text);
String logicTableName = segments.get(0);
- List<DataNode> dataNodes = Splitter.on(",").omitEmptyStrings().splitToList(segments.get(1)).stream().map(DataNodeUtils::parseWithSchema).collect(Collectors.toList());
+ List<DataNode> dataNodes = Splitter.on(",").omitEmptyStrings().splitToList(segments.get(1)).stream().map(DataNode::new).collect(Collectors.toList());
return new JobDataNodeEntry(logicTableName, dataNodes);
}
diff --git a/kernel/data-pipeline/core/src/test/java/org/apache/shardingsphere/data/pipeline/core/datanode/DataNodeUtilsTest.java b/kernel/data-pipeline/core/src/test/java/org/apache/shardingsphere/data/pipeline/core/datanode/DataNodeUtilsTest.java
deleted file mode 100644
index 22924346390..00000000000
--- a/kernel/data-pipeline/core/src/test/java/org/apache/shardingsphere/data/pipeline/core/datanode/DataNodeUtilsTest.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * 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.datanode;
-
-import org.apache.shardingsphere.infra.datanode.DataNode;
-import org.apache.shardingsphere.infra.exception.kernel.metadata.datanode.InvalidDataNodeFormatException;
-import org.junit.jupiter.api.Test;
-
-import static org.hamcrest.Matchers.is;
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.junit.jupiter.api.Assertions.assertNull;
-import static org.junit.jupiter.api.Assertions.assertThrows;
-
-class DataNodeUtilsTest {
-
- @Test
- void assertParseWithSchemaForInvalidText() {
- assertThrows(InvalidDataNodeFormatException.class, () -> DataNodeUtils.parseWithSchema("ds_0"));
- }
-
- @Test
- void assertParseWithSchemaForConsecutiveDelimiters() {
- assertThrows(InvalidDataNodeFormatException.class, () -> DataNodeUtils.parseWithSchema("ds_0..tbl_0"));
- }
-
- @Test
- void assertParseWithSchema() {
- DataNode actual = DataNodeUtils.parseWithSchema("ds_0.public.tbl_0");
- assertThat(actual.getDataSourceName(), is("ds_0"));
- assertThat(actual.getTableName(), is("tbl_0"));
- assertThat(actual.getSchemaName(), is("public"));
- }
-
- @Test
- void assertParseWithoutSchema() {
- DataNode actual = DataNodeUtils.parseWithSchema("ds_0.tbl_0");
- assertThat(actual.getDataSourceName(), is("ds_0"));
- assertThat(actual.getTableName(), is("tbl_0"));
- assertNull(actual.getSchemaName());
- }
-}
diff --git a/kernel/data-pipeline/scenario/migration/core/src/main/java/org/apache/shardingsphere/data/pipeline/scenario/migration/check/consistency/MigrationDataConsistencyChecker.java b/kernel/data-pipeline/scenario/migration/core/src/main/java/org/apache/shardingsphere/data/pipeline/scenario/migration/check/consistency/MigrationDataConsistencyChecker.java
index 8c8c8fb4013..27af07ec36e 100644
--- a/kernel/data-pipeline/scenario/migration/core/src/main/java/org/apache/shardingsphere/data/pipeline/scenario/migration/check/consistency/MigrationDataConsistencyChecker.java
+++ b/kernel/data-pipeline/scenario/migration/core/src/main/java/org/apache/shardingsphere/data/pipeline/scenario/migration/check/consistency/MigrationDataConsistencyChecker.java
@@ -30,7 +30,6 @@ import org.apache.shardingsphere.data.pipeline.core.consistencycheck.table.Table
import org.apache.shardingsphere.data.pipeline.core.consistencycheck.table.TableInventoryChecker;
import org.apache.shardingsphere.data.pipeline.core.context.PipelineContextManager;
import org.apache.shardingsphere.data.pipeline.core.context.TransmissionProcessContext;
-import org.apache.shardingsphere.data.pipeline.core.datanode.DataNodeUtils;
import org.apache.shardingsphere.data.pipeline.core.datanode.JobDataNodeEntry;
import org.apache.shardingsphere.data.pipeline.core.datanode.JobDataNodeLine;
import org.apache.shardingsphere.data.pipeline.core.datasource.PipelineDataSource;
@@ -112,7 +111,7 @@ public final class MigrationDataConsistencyChecker implements PipelineDataConsis
for (TableCheckRangePosition each : progressContext.getTableCheckRangePositions()) {
TableDataConsistencyCheckResult checkResult = checkSingleTableInventoryData(each, tableChecker, dataSourceManager);
log.info("checkResult: {}, table: {}, checkRangePosition: {}", checkResult, each.getSourceDataNode(), each);
- DataNode dataNode = DataNodeUtils.parseWithSchema(each.getSourceDataNode());
+ DataNode dataNode = new DataNode(each.getSourceDataNode());
QualifiedTable sourceTable = new QualifiedTable(dataNode.getSchemaName(), dataNode.getTableName());
checkResultMap.put(sourceTable, checkResult);
if (checkResult.isIgnored()) {
@@ -165,7 +164,7 @@ public final class MigrationDataConsistencyChecker implements PipelineDataConsis
private TableDataConsistencyCheckResult checkSingleTableInventoryData(final TableCheckRangePosition checkRangePosition,
final TableDataConsistencyChecker tableChecker, final PipelineDataSourceManager dataSourceManager) {
log.info("checkSingleTableInventoryData, jobId: {}, checkRangePosition: {}", jobConfig.getJobId(), checkRangePosition);
- DataNode dataNode = DataNodeUtils.parseWithSchema(checkRangePosition.getSourceDataNode());
+ DataNode dataNode = new DataNode(checkRangePosition.getSourceDataNode());
QualifiedTable sourceTable = new QualifiedTable(dataNode.getSchemaName(), dataNode.getTableName());
PipelineDataSource sourceDataSource = dataSourceManager.getDataSource(jobConfig.getSources().get(dataNode.getDataSourceName()));
PipelineTableMetaDataLoader metaDataLoader = new StandardPipelineTableMetaDataLoader(sourceDataSource);