nsivabalan commented on a change in pull request #2845:
URL: https://github.com/apache/hudi/pull/2845#discussion_r616593119



##########
File path: 
hudi-utilities/src/main/java/org/apache/hudi/utilities/sources/helpers/DFSPathSelector.java
##########
@@ -121,28 +121,30 @@ public static DFSPathSelector 
createSourceSelector(TypedProperties props,
       
eligibleFiles.sort(Comparator.comparingLong(FileStatus::getModificationTime));

Review comment:
       don't we need any fix in listEligibleFiles()? this method filters files 
based on mod time > checkpoint time. I thought fix is to make this mod time 
>**=** checkpoint time.

##########
File path: 
hudi-utilities/src/main/java/org/apache/hudi/utilities/sources/helpers/DFSPathSelector.java
##########
@@ -121,28 +121,30 @@ public static DFSPathSelector 
createSourceSelector(TypedProperties props,
       
eligibleFiles.sort(Comparator.comparingLong(FileStatus::getModificationTime));
       // Filter based on checkpoint & input size, if needed
       long currentBytes = 0;
-      long maxModificationTime = Long.MIN_VALUE;
+      long newCheckpointTime = lastCheckpointTime;
       List<FileStatus> filteredFiles = new ArrayList<>();
       for (FileStatus f : eligibleFiles) {
-        if (currentBytes + f.getLen() >= sourceLimit) {
+        if (currentBytes + f.getLen() >= sourceLimit && 
f.getModificationTime() > newCheckpointTime) {

Review comment:
       won't this lead to overflow. in the sense that, this could lead to 
reading ```2*sourceLimit``` or even ```10* sourceLimit```, we never know. 

##########
File path: 
hudi-utilities/src/main/java/org/apache/hudi/utilities/sources/helpers/DFSPathSelector.java
##########
@@ -121,28 +121,30 @@ public static DFSPathSelector 
createSourceSelector(TypedProperties props,
       
eligibleFiles.sort(Comparator.comparingLong(FileStatus::getModificationTime));
       // Filter based on checkpoint & input size, if needed
       long currentBytes = 0;
-      long maxModificationTime = Long.MIN_VALUE;
+      long newCheckpointTime = lastCheckpointTime;
       List<FileStatus> filteredFiles = new ArrayList<>();
       for (FileStatus f : eligibleFiles) {
-        if (currentBytes + f.getLen() >= sourceLimit) {
+        if (currentBytes + f.getLen() >= sourceLimit && 
f.getModificationTime() > newCheckpointTime) {

Review comment:
       guess I get the gist now and why we don't need any fix in 
listEligibleFiles.




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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to