saxenapranav commented on code in PR #5505:
URL: https://github.com/apache/hadoop/pull/5505#discussion_r1147140028
##########
hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/web/WebHdfsFileSystem.java:
##########
@@ -2207,10 +2206,8 @@ public boolean hasPathCapability(final Path path, final
String capability)
throws IOException {
// qualify the path to make sure that it refers to the current FS.
final Path p = makeQualified(path);
- Optional<Boolean> cap = DfsPathCapabilities.hasPathCapability(p,
- capability);
- if (cap.isPresent()) {
- return cap.get();
+ if (DfsPathCapabilities.hasPathCapability(p, capability)) {
Review Comment:
I am completely understanding your point. But my only difference is that if
something is returned from `DfsPathCapabilities.hasPathCapability` should be
returned back to caller of `DistributedFileSystem.hasPathCapablity), without
going to super's method.
I understand that super.hasPathCapability call doesn't pose any issue as of
now and we can see for Enum in case more complications are added in future. I
have a suggestion in the tests
https://github.com/szetszwo/hadoop/commit/6ddc4f245b2f234bc5da5b3f02c1882ecc5fdaec.
In this commit it has added asserts on the conditions used in
`FileSystem.hasPathCapablity` Would be awesome if you can pick my commit in
your pr.
Thanks.
--
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]