xiaochen-zhou commented on code in PR #6766:
URL: https://github.com/apache/seatunnel/pull/6766#discussion_r1594845600


##########
seatunnel-connectors-v2/connector-paimon/src/main/java/org/apache/seatunnel/connectors/seatunnel/paimon/source/PaimonSourceState.java:
##########
@@ -17,21 +17,19 @@
 
 package org.apache.seatunnel.connectors.seatunnel.paimon.source;
 
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
 import java.io.Serializable;
+import java.util.Map;
 import java.util.Set;
 
+@AllArgsConstructor
+@Getter
 /** Paimon connector source state, saves the splits has assigned to readers. */
 public class PaimonSourceState implements Serializable {
 
     private static final long serialVersionUID = 1L;
-
-    private final Set<PaimonSourceSplit> assignedSplits;
-
-    public PaimonSourceState(Set<PaimonSourceSplit> assignedSplits) {
-        this.assignedSplits = assignedSplits;
-    }
-
-    public Set<PaimonSourceSplit> getAssignedSplits() {
-        return assignedSplits;
-    }
+    private final Map<Integer, Set<PaimonSourceSplit>> assignedSplits;

Review Comment:
   > Why change Set to Map here? Any considerations?
   
   I think there is a small optimization,avoid the traversal operation when 
removing the allocated PaimonSourceSplit from `pendingSplit`. use `set` like 
FileSourceSplitEnumerator, a nested loop will be formed in the 
`FileSourceSplitEnumerator#run()` method.



-- 
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]

Reply via email to