HADOOP-16201: S3AFileSystem#innerMkdirs builds needless lists (#636)

This commit is contained in:
Lokesh Jain 2019-03-22 17:12:00 +05:30 committed by Steve Loughran
parent ce5eb9cb2e
commit ae2eb2dd42
1 changed files with 0 additions and 12 deletions

View File

@ -2295,10 +2295,6 @@ public class S3AFileSystem extends FileSystem implements StreamCapabilities,
LOG.debug("Making directory: {}", f); LOG.debug("Making directory: {}", f);
entryPoint(INVOCATION_MKDIRS); entryPoint(INVOCATION_MKDIRS);
FileStatus fileStatus; FileStatus fileStatus;
List<Path> metadataStoreDirs = null;
if (hasMetadataStore()) {
metadataStoreDirs = new ArrayList<>();
}
try { try {
fileStatus = getFileStatus(f); fileStatus = getFileStatus(f);
@ -2311,9 +2307,6 @@ public class S3AFileSystem extends FileSystem implements StreamCapabilities,
} catch (FileNotFoundException e) { } catch (FileNotFoundException e) {
// Walk path to root, ensuring closest ancestor is a directory, not file // Walk path to root, ensuring closest ancestor is a directory, not file
Path fPart = f.getParent(); Path fPart = f.getParent();
if (metadataStoreDirs != null) {
metadataStoreDirs.add(f);
}
while (fPart != null) { while (fPart != null) {
try { try {
fileStatus = getFileStatus(fPart); fileStatus = getFileStatus(fPart);
@ -2327,11 +2320,6 @@ public class S3AFileSystem extends FileSystem implements StreamCapabilities,
} }
} catch (FileNotFoundException fnfe) { } catch (FileNotFoundException fnfe) {
instrumentation.errorIgnored(); instrumentation.errorIgnored();
// We create all missing directories in MetadataStore; it does not
// infer directories exist by prefix like S3.
if (metadataStoreDirs != null) {
metadataStoreDirs.add(fPart);
}
} }
fPart = fPart.getParent(); fPart = fPart.getParent();
} }