liangyu-1 commented on code in PR #7859:
URL: https://github.com/apache/hadoop/pull/7859#discussion_r2293267533


##########
hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapred/FileInputFormat.java:
##########
@@ -369,6 +369,9 @@ public InputSplit[] getSplits(JobConf job, int numSplits)
         } else {
           blkLocations = fs.getFileBlockLocations(file, 0, length);
         }
+        if (blkLocations.length == 0){

Review Comment:
   > Thanks. Got it. Make sense to me. +1 to check in. BTW, the root cause here 
is invoke `listStatus` to get file status and invoke another interface 
`getFileBlockLocations` to get block location, but file has changed between 
this steps, right? If it is true, is it proper to use `blkLocations` only as 
condition at L364 rather than `file.length` which could be not the correct 
result here? Thanks again.
   
   Thanks for your review. It is a good solution to use `blkLocations` only as 
condition at L364, if blkLocations array is empty, `file.length` is also empty, 
this will not effect the later opretions.



-- 
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: common-issues-unsubscr...@hadoop.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-issues-h...@hadoop.apache.org

Reply via email to