[
https://issues.apache.org/jira/browse/HADOOP-18708?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17870388#comment-17870388
]
ASF GitHub Bot commented on HADOOP-18708:
-----------------------------------------
shameersss1 commented on PR #6884:
URL: https://github.com/apache/hadoop/pull/6884#issuecomment-2264686264
> @shameersss1 what do you think of @raphaelazzolini 's comment
I understand @raphaelazzolini 's concern of having many isCSEEnabled
conditions especially in the listing methods. If i understand it correctly the
ask is to introduce to handler interface pattern as follows
`interface ListingHandler {
Listing getListing(Path path, boolean includeSelf);
}
class CSEEnabledListingHandler implements ListingHandler {
@Override
public Listing getListing(Path path, boolean includeSelf) {
return includeSelf
? new Listing.AcceptAllButS3nDirsAndCSEInstructionFile()
: new
Listing.AcceptAllButSelfAndS3nDirsAndCSEInstructionFile(path);
}
}
class CSEDisabledListingHandler implements ListingHandler {
@Override
public Listing getListing(Path path, boolean includeSelf) {
return includeSelf
? new Listing.AcceptAllButS3nDirs()
: new Listing.AcceptAllButSelfAndS3nDirs(path);
}
}
@Retries.RetryTranslated
public RemoteIterator<S3ALocatedFileStatus> listFilesAndDirectoryMarkers(
final Path path,
final S3AFileStatus status,
final boolean includeSelf) throws IOException {
auditSpan.activate();
ListingHandler handler = isCSEEnabled ? new CSEEnabledListingHandler() :
new CSEDisabledListingHandler();
return innerListFiles(path, true, handler.getListing(path, includeSelf),
status);
}
`
I agree handler interface strategy will be more elegant. I will make the
required code changes. I see there are conflicting changes which requires
rebase and force push
> AWS SDK V2 - Implement CSE
> --------------------------
>
> Key: HADOOP-18708
> URL: https://issues.apache.org/jira/browse/HADOOP-18708
> Project: Hadoop Common
> Issue Type: Sub-task
> Components: fs/s3
> Affects Versions: 3.4.0
> Reporter: Ahmar Suhail
> Assignee: Syed Shameerur Rahman
> Priority: Major
> Labels: pull-request-available
>
> S3 Encryption client for SDK V2 is now available, so add client side
> encryption back in.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]