HADOOP-17398. Skipping network I/O in S3A getFileStatus(/) breaks some tests (#2493)
Follow-on to HADOOP-17323. Contributed by Mukund Thakur.
This commit is contained in:
parent
67dc0928c1
commit
03b4e98971
@ -282,16 +282,24 @@ public int run(final String[] args, final PrintStream stream)
|
||||
}
|
||||
FileSystem fs = path.getFileSystem(getConf());
|
||||
boolean nonAuth = command.getOpt(OPT_NONAUTH);
|
||||
ScanResult result = execute(
|
||||
new ScanArgsBuilder()
|
||||
.withSourceFS(fs)
|
||||
.withPath(path)
|
||||
.withDoPurge(clean)
|
||||
.withMinMarkerCount(expectedMin)
|
||||
.withMaxMarkerCount(expectedMax)
|
||||
.withLimit(limit)
|
||||
.withNonAuth(nonAuth)
|
||||
.build());
|
||||
ScanResult result;
|
||||
try {
|
||||
result = execute(
|
||||
new ScanArgsBuilder()
|
||||
.withSourceFS(fs)
|
||||
.withPath(path)
|
||||
.withDoPurge(clean)
|
||||
.withMinMarkerCount(expectedMin)
|
||||
.withMaxMarkerCount(expectedMax)
|
||||
.withLimit(limit)
|
||||
.withNonAuth(nonAuth)
|
||||
.build());
|
||||
} catch (UnknownStoreException ex) {
|
||||
// bucket doesn't exist.
|
||||
// replace the stack trace with an error code.
|
||||
throw new ExitUtil.ExitException(EXIT_NOT_FOUND,
|
||||
ex.toString(), ex);
|
||||
}
|
||||
if (verbose) {
|
||||
dumpFileSystemStatistics(out);
|
||||
}
|
||||
|
@ -62,8 +62,10 @@ public void testNoBucketProbing() throws Exception {
|
||||
|
||||
Path root = new Path(uri);
|
||||
|
||||
expectUnknownStore(
|
||||
() -> fs.getFileStatus(root));
|
||||
//See HADOOP-17323.
|
||||
assertTrue("root path should always exist", fs.exists(root));
|
||||
assertTrue("getFileStatus on root should always return a directory",
|
||||
fs.getFileStatus(root).isDirectory());
|
||||
|
||||
expectUnknownStore(
|
||||
() -> fs.listStatus(root));
|
||||
|
Loading…
Reference in New Issue
Block a user