adamantal commented on a change in pull request #568: HADOOP-15691 Add 
PathCapabilities to FS and FC to complement StreamCapabilities
URL: https://github.com/apache/hadoop/pull/568#discussion_r295733465
 
 

 ##########
 File path: 
hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/S3AFileSystem.java
 ##########
 @@ -3674,7 +3671,31 @@ public boolean hasCapability(String capability) {
       // select is only supported if enabled
       return selectBinding.isEnabled();
 
+    case CommonPathCapabilities.FS_CHECKSUMS:
+      // capability depends on FS configuration
+      return getConf().getBoolean(ETAG_CHECKSUM_ENABLED,
+          ETAG_CHECKSUM_ENABLED_DEFAULT);
+
     default:
+      return super.hasPathCapability(p, capability);
+    }
+  }
+
+  /**
+   * Return the capabilities of this filesystem instance.
+   *
+   * This has been supplanted by {@link #hasPathCapability(Path, String)}.
+   * @param capability string to query the stream support for.
+   * @return whether the FS instance has the capability.
+   */
+  @Deprecated
+  @Override
+  public boolean hasCapability(String capability) {
 
 Review comment:
   I do not really get this part. The `S3AFileSystem` implements 
`StreamCapability` (is this a mistake?), so it's
   - either a valid usage: the deprecation and delegation to the 
`hasPathCapability` is unnecessary
   - or is not a valid usage: then we should get rid of the implementation of 
the `StreamCapabilities`, and also modify the ~dozen places where it is used. 
   
   I suppose the second option is true, and does not seem a big effort to 
handle that also in this patch. 
   
   I hope I got this correctly, correct me if I'm wrong. What do you think 
about this?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to