Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HADOOP-16328: ClassCastException in S3GuardTool.checkMetadataStoreUri #849

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -236,8 +236,18 @@ protected void checkIfS3BucketIsGuarded(List<String> paths)
if(metadataStoreUri == null || metadataStoreUri.isEmpty()) {
// If not set, check if filesystem is guarded by creating an
// S3AFileSystem and check if hasMetadataStore is true
try (S3AFileSystem s3AFileSystem = (S3AFileSystem)
S3AFileSystem.newInstance(toUri(s3Path), getConf())){
URI uri = toUri(s3Path);
FileSystem fs = FileSystem.newInstance(uri, getConf());
if (!(fs instanceof S3AFileSystem)) {
// this issue has surfaced in tests (HADOOP-16328),
// so print a full stack trace out before failing.
String msg = "Filesystem for " + uri
+ " must be an S3AFilesytem, but got a "
+ fs.getClass();
LOG.error("{}: {}", msg, fs);
throw new ExitUtil.ExitException(EXIT_BAD_CONFIGURATION, msg);
}
try (S3AFileSystem s3AFileSystem = (S3AFileSystem) fs) {
Preconditions.checkState(s3AFileSystem.hasMetadataStore(),
"The S3 bucket is unguarded. " + getName()
+ " can not be used on an unguarded bucket.");
Expand Down