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

jiangmaolin 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 bcbcd9b0421 Refactor JobDataNodeLine (#32712)
bcbcd9b0421 is described below

commit bcbcd9b0421a3b930af6266567ab20edf66264a9
Author: Liang Zhang <[email protected]>
AuthorDate: Wed Aug 28 19:15:21 2024 +0800

    Refactor JobDataNodeLine (#32712)
---
 .../data/pipeline/core/datanode/JobDataNodeLine.java           | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

diff --git 
a/kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/core/datanode/JobDataNodeLine.java
 
b/kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/core/datanode/JobDataNodeLine.java
index 73e71b10548..69b8f22a39e 100644
--- 
a/kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/core/datanode/JobDataNodeLine.java
+++ 
b/kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/core/datanode/JobDataNodeLine.java
@@ -31,7 +31,6 @@ import java.util.stream.Collectors;
 @Getter
 public final class JobDataNodeLine {
     
-    // Need sequential collection
     private final List<JobDataNodeEntry> entries;
     
     /**
@@ -40,14 +39,7 @@ public final class JobDataNodeLine {
      * @return marshaled text, format: entry1|entry2, e.g. 
t_order:ds_0.t_order_0,ds_0.t_order_1|t_order_item:ds_0.t_order_item_0,ds_0.t_order_item_1
      */
     public String marshal() {
-        StringBuilder result = new StringBuilder();
-        for (JobDataNodeEntry each : entries) {
-            result.append(each.marshal()).append('|');
-        }
-        if (!entries.isEmpty()) {
-            result.setLength(result.length() - 1);
-        }
-        return result.toString();
+        return 
entries.stream().map(JobDataNodeEntry::marshal).collect(Collectors.joining("|"));
     }
     
     /**

Reply via email to