liunaijie commented on code in PR #8453:
URL: https://github.com/apache/seatunnel/pull/8453#discussion_r1904791358


##########
seatunnel-connectors-v2/connector-file/connector-file-base/src/test/java/org/apache/seatunnel/connectors/seatunnel/file/split/FileSourceSplitEnumeratorTest.java:
##########
@@ -0,0 +1,94 @@
+package org.apache.seatunnel.connectors.seatunnel.file.split;

Review Comment:
   The new file need add license header.



##########
seatunnel-connectors-v2/connector-file/connector-file-base/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/source/split/FileSourceSplitEnumerator.java:
##########
@@ -107,8 +110,7 @@ private void assignSplit(int taskId) {
         context.assignSplit(taskId, currentTaskSplits);
         // save the state of assigned splits
         assignedSplit.addAll(currentTaskSplits);
-        // remove the assigned splits from pending splits
-        currentTaskSplits.forEach(split -> pendingSplit.remove(split));

Review Comment:
   OK, I get your point. Thanks for the contribute.
   
   
   



##########
seatunnel-connectors-v2/connector-file/connector-file-base/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/source/split/FileSourceSplitEnumerator.java:
##########
@@ -118,8 +120,8 @@ private void assignSplit(int taskId) {
         context.signalNoMoreSplits(taskId);
     }
 
-    private static int getSplitOwner(String tp, int numReaders) {
-        return (tp.hashCode() & Integer.MAX_VALUE) % numReaders;
+    private static int getSplitOwner(int assignCount, int numReaders) {
+        return assignCount % numReaders;
     }
 
     @Override

Review Comment:
   We also should update `currentUnassignedSplitSize()` method. the result 
should be `pendingSplit - assignedSplit`



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