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

Ekaterina Belousova reassigned HUDI-8368:
-----------------------------------------

    Assignee: Ekaterina Belousova

> Remove unused logic of rollback log block creation in BaseRollbackHelper
> ------------------------------------------------------------------------
>
>                 Key: HUDI-8368
>                 URL: https://issues.apache.org/jira/browse/HUDI-8368
>             Project: Apache Hudi
>          Issue Type: Improvement
>          Components: code-quality
>            Reporter: Y Ethan Guo
>            Assignee: Ekaterina Belousova
>            Priority: Critical
>             Fix For: 1.1.0
>
>
> The following logic in BaseRollbackHelper is for the old rollback plan 
> containing non-empty list of "logBlocksToBeDeleted" used by table version 6 
> and below (Hudi 0.x releases).  In Hudi 1.0 and table version 8, the log 
> files to be deleted are added to the list of "filesToBeDeleted" in the 
> rollback plan, which are deleted directly.  So there is no problem here.  We 
> can consider removing the following "else if" branch to keep the code clean.  
> See HUDI-8282 for more details around log file markers.
> {code:java}
> else if (!rollbackRequest.getLogBlocksToBeDeleted().isEmpty()) {
>   HoodieLogFormat.Writer writer = null;
>   final StoragePath filePath;
>   try {
>     String fileId = rollbackRequest.getFileId();
>     writer = HoodieLogFormat.newWriterBuilder()
>         .onParentPath(FSUtils.constructAbsolutePath(metaClient.getBasePath(), 
> rollbackRequest.getPartitionPath()))
>         .withFileId(fileId)
>         .withDeltaCommit(instantToRollback.getTimestamp())
>         .withStorage(metaClient.getStorage())
>         .withFileExtension(HoodieLogFile.DELTA_EXTENSION).build();
>     // generate metadata
>     if (doDelete) {
>       Map<HoodieLogBlock.HeaderMetadataType, String> header = 
> generateHeader(instantToRollback.getTimestamp());
>       // if update belongs to an existing log file
>       // use the log file path from AppendResult in case the file handle may 
> roll over
>       filePath = writer.appendBlock(new 
> HoodieCommandBlock(header)).logFile().getPath();
>     } else {
>       filePath = writer.getLogFile().getPath();
>     } {code}



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

Reply via email to