-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Minor cleanups and improvements to FileSystemExchange #14806
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -49,7 +49,8 @@ protected void setup(Binder binder) | |
|
|
||
| List<URI> baseDirectories = buildConfigObject(FileSystemExchangeConfig.class).getBaseDirectories(); | ||
| if (baseDirectories.stream().map(URI::getScheme).distinct().count() != 1) { | ||
| throw new TrinoException(CONFIGURATION_INVALID, "Multiple schemes in exchange base directories"); | ||
| binder.addError(new TrinoException(CONFIGURATION_INVALID, "Multiple schemes in exchange base directories")); | ||
| return; | ||
| } | ||
| String scheme = baseDirectories.get(0).getScheme(); | ||
| if (scheme == null || scheme.equals("file")) { | ||
|
|
@@ -68,7 +69,7 @@ else if (ImmutableSet.of("abfs", "abfss").contains(scheme)) { | |
| configBinder(binder).bindConfig(ExchangeAzureConfig.class); | ||
| } | ||
| else { | ||
| throw new TrinoException(NOT_SUPPORTED, format("Scheme %s is not supported as exchange spooling storage", scheme)); | ||
| binder.addError(new TrinoException(NOT_SUPPORTED, format("Scheme %s is not supported as exchange spooling storage", scheme))); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what does it change really? Isn't exception caught up the stack anyway and handle same way?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for pointing out, updating line 52 too.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. But still:
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually yeah - that way we may collect more than one error.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I tested and just realized that it doesn't make much of a difference in terms of error surfacing. Added return under line 52. I'm fine both ways. |
||
| } | ||
| } | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.