hudi-client/src/main/java/org/apache/hudi/table/action/rollback/RollbackUtils.java
/**
   * Helper to merge 2 rollback-stats for a given partition.
   *
   * @param stat1 HoodieRollbackStat
   * @param stat2 HoodieRollbackStat
   * @return Merged HoodieRollbackStat
   */
Helper to merge 2 rollback-stats for a given partition.
Helper to merge 2 rollback - stats for a given partition .
static HoodieRollbackStat mergeRollbackStat(HoodieRollbackStat stat1, HoodieRollbackStat stat2) {
    ValidationUtils.checkArgument(stat1.getPartitionPath().equals(stat2.getPartitionPath()));
    final List<String> successDeleteFiles = new ArrayList<>();
    final List<String> failedDeleteFiles = new ArrayList<>();
    final Map<FileStatus, Long> commandBlocksCount = new HashMap<>();
    final List<FileStatus> filesToRollback = new ArrayList<>();
    Option.ofNullable(stat1.getSuccessDeleteFiles()).ifPresent(successDeleteFiles::addAll);
    Option.ofNullable(stat2.getSuccessDeleteFiles()).ifPresent(successDeleteFiles::addAll);
    Option.ofNullable(stat1.getFailedDeleteFiles()).ifPresent(failedDeleteFiles::addAll);
    Option.ofNullable(stat2.getFailedDeleteFiles()).ifPresent(failedDeleteFiles::addAll);
    Option.ofNullable(stat1.getCommandBlocksCount()).ifPresent(commandBlocksCount::putAll);
    Option.ofNullable(stat2.getCommandBlocksCount()).ifPresent(commandBlocksCount::putAll);
    return new HoodieRollbackStat(stat1.getPartitionPath(), successDeleteFiles, failedDeleteFiles, commandBlocksCount);
  }
static HoodieRollbackStat mergeRollbackStat ( HoodieRollbackStat stat1 , HoodieRollbackStat stat2 ) { ValidationUtils . checkArgument ( stat1 . getPartitionPath ( ) . equals ( stat2 . getPartitionPath ( ) ) ) ; final List < String > successDeleteFiles = new ArrayList < > ( ) ; final List < String > failedDeleteFiles = new ArrayList < > ( ) ; final Map < FileStatus , Long > commandBlocksCount = new HashMap < > ( ) ; final List < FileStatus > filesToRollback = new ArrayList < > ( ) ; Option . ofNullable ( stat1 . getSuccessDeleteFiles ( ) ) . ifPresent ( successDeleteFiles :: addAll ) ; Option . ofNullable ( stat2 . getSuccessDeleteFiles ( ) ) . ifPresent ( successDeleteFiles :: addAll ) ; Option . ofNullable ( stat1 . getFailedDeleteFiles ( ) ) . ifPresent ( failedDeleteFiles :: addAll ) ; Option . ofNullable ( stat2 . getFailedDeleteFiles ( ) ) . ifPresent ( failedDeleteFiles :: addAll ) ; Option . ofNullable ( stat1 . getCommandBlocksCount ( ) ) . ifPresent ( commandBlocksCount :: putAll ) ; Option . ofNullable ( stat2 . getCommandBlocksCount ( ) ) . ifPresent ( commandBlocksCount :: putAll ) ; return new HoodieRollbackStat ( stat1 . getPartitionPath ( ) , successDeleteFiles , failedDeleteFiles , commandBlocksCount ) ; }
Helper to merge 2 rollback-stats for a given partition.
Helper to merge 2 rollback - stats for a given partition .