swamirishi commented on code in PR #4316:
URL: https://github.com/apache/ozone/pull/4316#discussion_r1119431517
##########
hadoop-ozone/ozonefs-common/src/main/java/org/apache/hadoop/fs/ozone/CapableOzoneFSOutputStream.java:
##########
@@ -44,6 +45,15 @@ public CapableOzoneFSOutputStream(OzoneFSOutputStream
outputStream) {
@Override
public boolean hasCapability(String capability) {
OutputStream os = getWrappedOutputStream().getOutputStream();
+
+ if (os instanceof CryptoOutputStream) {
+ OutputStream wrapped = ((CryptoOutputStream) os).getWrappedStream();
+ return hasWrappedCapability(wrapped, capability);
+ }
+ return hasWrappedCapability(os, capability);
+ }
+
+ private boolean hasWrappedCapability(OutputStream os, String capability) {
Review Comment:
Wouldn't it be better to have this method as static.
##########
hadoop-ozone/ozonefs-common/src/main/java/org/apache/hadoop/fs/ozone/CapableOzoneFSOutputStream.java:
##########
@@ -44,6 +45,15 @@ public CapableOzoneFSOutputStream(OzoneFSOutputStream
outputStream) {
@Override
public boolean hasCapability(String capability) {
OutputStream os = getWrappedOutputStream().getOutputStream();
+
+ if (os instanceof CryptoOutputStream) {
+ OutputStream wrapped = ((CryptoOutputStream) os).getWrappedStream();
+ return hasWrappedCapability(wrapped, capability);
+ }
+ return hasWrappedCapability(os, capability);
+ }
+
+ private boolean hasWrappedCapability(OutputStream os, String capability) {
Review Comment:
Nit: Wouldn't it be better to have this method as static?
--
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]