[ 
https://issues.apache.org/jira/browse/HDDS-13503?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Mahesh kumar gaddam updated HDDS-13503:
---------------------------------------
    Description: 
Refactor {{S3MultipartUploadCommitPartRequest.validateAndUpdateCache}} for 
readability and maintainability

*Description:*
The {{validateAndUpdateCache}} method in {{S3MultipartUploadCommitPartRequest}} 
has grown complex due to recent enhancements for handling uncommitted blocks 
and overwritten parts. The logic for building the {{keyToDeleteMap}} and 
managing pseudo-keys can be extracted into helper methods for better 
readability, modularity, and testability.

*Proposed Improvements:*
 * *Extract Helper Methods:*
 ** Introduce a {{buildKeyDeletionMap}} method to handle the creation of 
{{RepeatedOmKeyInfo}} for old keys and uncommitted pseudo-keys.
 ** Move pseudo-key creation logic to a dedicated utility method.

 * *Improve Logging:*
 ** Add {{LOG.debug}} statements when pseudo-keys or overwritten keys are added 
to {{DeletedTable}} for easier troubleshooting.
 * *Update Javadocs:*
 ** Update outdated references (e.g., {{{}oldPartKeyInfo{}}}) in method 
documentation.

 * *Enhance Unit Tests:*
 ** Create focused unit tests for helper methods to ensure they work 
independently.

  was:
Refactor {{S3MultipartUploadCommitPartRequest.validateAndUpdateCache}} for 
readability and maintainability

*Description:*
The {{validateAndUpdateCache}} method in {{S3MultipartUploadCommitPartRequest}} 
has grown complex due to recent enhancements for handling uncommitted blocks 
and overwritten parts. The logic for building the {{keyToDeleteMap}} and 
managing pseudo-keys can be extracted into helper methods for better 
readability, modularity, and testability.

*Proposed Improvements:*
 # *Extract Helper Methods:*

 ** Introduce a {{buildKeyDeletionMap}} method to handle the creation of 
{{RepeatedOmKeyInfo}} for old keys and uncommitted pseudo-keys.

 ** Move pseudo-key creation logic to a dedicated utility method.

 # *Improve Logging:*

 ** Add {{LOG.debug}} statements when pseudo-keys or overwritten keys are added 
to {{DeletedTable}} for easier troubleshooting.

 # *Update Javadocs:*

 ** Update outdated references (e.g., {{{}oldPartKeyInfo{}}}) in method 
documentation.

 # *Enhance Unit Tests:*

 ** Create focused unit tests for helper methods to ensure they work 
independently.


> Refactor S3MultipartUploadCommitPartRequest.validateAndUpdateCache for 
> readability and maintainability
> ------------------------------------------------------------------------------------------------------
>
>                 Key: HDDS-13503
>                 URL: https://issues.apache.org/jira/browse/HDDS-13503
>             Project: Apache Ozone
>          Issue Type: Improvement
>            Reporter: Mahesh kumar gaddam
>            Priority: Major
>
> Refactor {{S3MultipartUploadCommitPartRequest.validateAndUpdateCache}} for 
> readability and maintainability
> *Description:*
> The {{validateAndUpdateCache}} method in 
> {{S3MultipartUploadCommitPartRequest}} has grown complex due to recent 
> enhancements for handling uncommitted blocks and overwritten parts. The logic 
> for building the {{keyToDeleteMap}} and managing pseudo-keys can be extracted 
> into helper methods for better readability, modularity, and testability.
> *Proposed Improvements:*
>  * *Extract Helper Methods:*
>  ** Introduce a {{buildKeyDeletionMap}} method to handle the creation of 
> {{RepeatedOmKeyInfo}} for old keys and uncommitted pseudo-keys.
>  ** Move pseudo-key creation logic to a dedicated utility method.
>  * *Improve Logging:*
>  ** Add {{LOG.debug}} statements when pseudo-keys or overwritten keys are 
> added to {{DeletedTable}} for easier troubleshooting.
>  * *Update Javadocs:*
>  ** Update outdated references (e.g., {{{}oldPartKeyInfo{}}}) in method 
> documentation.
>  * *Enhance Unit Tests:*
>  ** Create focused unit tests for helper methods to ensure they work 
> independently.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@ozone.apache.org
For additional commands, e-mail: issues-h...@ozone.apache.org

Reply via email to