Hexiaoqiao commented on code in PR #7859:
URL: https://github.com/apache/hadoop/pull/7859#discussion_r2290326477
##########
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.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]