mukund-thakur commented on a change in pull request #2149:
URL: https://github.com/apache/hadoop/pull/2149#discussion_r469744470
##########
File path:
hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/S3AFileSystem.java
##########
@@ -3019,88 +3115,86 @@ S3AFileStatus innerGetFileStatus(final Path f,
S3AFileStatus s3GetFileStatus(final Path path,
final String key,
final Set<StatusProbeEnum> probes,
- @Nullable Set<Path> tombstones) throws IOException {
- if (!key.isEmpty()) {
- if (probes.contains(StatusProbeEnum.Head) && !key.endsWith("/")) {
- try {
- // look for the simple file
- ObjectMetadata meta = getObjectMetadata(key);
- LOG.debug("Found exact file: normal file {}", key);
- return new S3AFileStatus(meta.getContentLength(),
- dateToLong(meta.getLastModified()),
- path,
- getDefaultBlockSize(path),
- username,
- meta.getETag(),
- meta.getVersionId());
- } catch (AmazonServiceException e) {
- // if the response is a 404 error, it just means that there is
- // no file at that path...the remaining checks will be needed.
- if (e.getStatusCode() != SC_404 || isUnknownBucket(e)) {
- throw translateException("getFileStatus", path, e);
- }
- } catch (AmazonClientException e) {
+ @Nullable final Set<Path> tombstones,
+ final boolean needEmptyDirectoryFlag) throws IOException {
+ LOG.debug("S3GetFileStatus {}", path);
+ Preconditions.checkArgument(!needEmptyDirectoryFlag
+ || probes.contains(StatusProbeEnum.List),
+ "s3GetFileStatus(%s) wants to know if a directory is empty but"
Review comment:
The condition and message doesn't seem consistent. Please review.
----------------------------------------------------------------
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]