[
https://issues.apache.org/jira/browse/HDDS-5974?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17451771#comment-17451771
]
Rakesh Radhakrishnan edited comment on HDDS-5974 at 12/1/21, 1:13 PM:
----------------------------------------------------------------------
Can introduce something like {{public abstract class OmKeyResponse extends
OMClientResponse}} and all the key related classes can extend it.
{code:java}
public abstract class OmKeyResponse extends OMClientResponse {
private BucketLayout bucketLayout;
private static final Logger LOG =
LoggerFactory.getLogger(OmKeyResponse.class);
public OmKeyResponse(OzoneManagerProtocolProtos.OMResponse omResponse,
BucketLayout bucketLayoutArg) {
super(omResponse);
this.bucketLayout = bucketLayoutArg;
}
public BucketLayout getBucketLayout() {
return bucketLayout;
} {code}
was (Author: rakeshr):
Can introduce something like {{public abstract class OmKeyResponse extends
OMClientResponse}} and all the key related classes can extend it.
{code}
public abstract class OMKeyRequest extends OMClientRequest {
private static final Logger LOG = LoggerFactory.getLogger(OMKeyRequest.class);
private BucketLayout bucketLayout = BucketLayout.DEFAULT;
public OMKeyRequest(OMRequest omRequest) {
super(omRequest);
}
public OMKeyRequest(OMRequest omRequest, BucketLayout bucketLayoutArg) {
super(omRequest);
this.bucketLayout = bucketLayoutArg;
}
public BucketLayout getBucketLayout() {
return bucketLayout;
}
{code}
> Remove OMClientResponse#getBucketLayout overridden method in subclasses
> -----------------------------------------------------------------------
>
> Key: HDDS-5974
> URL: https://issues.apache.org/jira/browse/HDDS-5974
> Project: Apache Ozone
> Issue Type: Sub-task
> Reporter: Rakesh Radhakrishnan
> Assignee: Aryan Gupta
> Priority: Major
> Fix For: 1.3.0
>
> Attachments: OverriddenResponseClasses-getBucketLayout.png
>
>
> This is a refactoring task to avoid overriding of #getBucketLayout() to
> {{FILE_SYSTEM_OPTIMIZED}} in FSO subclasses. The idea is basically to
> instantiate {{bucketLayout}} member variable in the object.
> Attached the list of classes which can be looked into for this change.
--
This message was sent by Atlassian Jira
(v8.20.1#820001)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]