adoroszlai commented on code in PR #5704:
URL: https://github.com/apache/ozone/pull/5704#discussion_r1410869710
##########
hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/freon/HadoopFsGenerator.java:
##########
@@ -87,6 +87,10 @@ public Void call() throws Exception {
configuration = createOzoneConfiguration();
uri = URI.create(rootPath);
+ String scheme = uri.getScheme();
+ if (scheme == null) {
+ throw new IllegalArgumentException("--path requires FQDN");
+ }
String disableCacheName = String.format("fs.%s.impl.disable.cache",
uri.getScheme());
Review Comment:
```suggestion
String scheme = Optional.ofNullable(uri.getScheme())
.orElseGet(() ->
FileSystem.getDefaultUri(configuration).getScheme());
String disableCacheName = String.format("fs.%s.impl.disable.cache",
scheme);
```
(also add `import java.util.Optional`)
Or can use `if` block, if you prefer.
##########
hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/freon/HadoopFsGenerator.java:
##########
@@ -87,6 +87,10 @@ public Void call() throws Exception {
configuration = createOzoneConfiguration();
uri = URI.create(rootPath);
+ String scheme = uri.getScheme();
+ if (scheme == null) {
+ throw new IllegalArgumentException("--path requires FQDN");
+ }
Review Comment:
We don't even need to completely replace `uri`, can use scheme of default
URI only for disabling the cache.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]