hudi-client/src/main/java/org/apache/hudi/table/action/clean/CleanActionExecutor.java
/**
   * Creates a Cleaner plan if there are files to be cleaned and stores them in instant file.
   * Cleaner Plan contains absolute file paths.
   *
   * @param startCleanTime Cleaner Instant Time
   * @return Cleaner Plan if generated
   */
Creates a Cleaner plan if there are files to be cleaned and stores them in instant file.
Cleaner Plan contains absolute file paths.

@param startCleanTime Cleaner Instant Time
@return Cleaner Plan if generated
Creates a Cleaner plan if there are files to be cleaned and stores them in instant file . Cleaner Plan contains absolute file paths . @param startCleanTime Cleaner Instant Time @return Cleaner Plan if generated
Option<HoodieCleanerPlan> requestClean(String startCleanTime) {
    final HoodieCleanerPlan cleanerPlan = requestClean(jsc);
    if ((cleanerPlan.getFilePathsToBeDeletedPerPartition() != null)
        && !cleanerPlan.getFilePathsToBeDeletedPerPartition().isEmpty()
        && cleanerPlan.getFilePathsToBeDeletedPerPartition().values().stream().mapToInt(List::size).sum() > 0) {
      final HoodieInstant cleanInstant = new HoodieInstant(HoodieInstant.State.REQUESTED, HoodieTimeline.CLEAN_ACTION, startCleanTime);
      try {
        table.getActiveTimeline().saveToCleanRequested(cleanInstant, TimelineMetadataUtils.serializeCleanerPlan(cleanerPlan));
        LOG.info("Requesting Cleaning with instant time " + cleanInstant);
      } catch (IOException e) {
        LOG.error("Got exception when saving cleaner requested file", e);
        throw new HoodieIOException(e.getMessage(), e);
      }
      return Option.of(cleanerPlan);
    }
    return Option.empty();
  }
Option < HoodieCleanerPlan > requestClean ( String startCleanTime ) { final HoodieCleanerPlan cleanerPlan = requestClean ( jsc ) ; if ( ( cleanerPlan . getFilePathsToBeDeletedPerPartition ( ) != null ) && ! cleanerPlan . getFilePathsToBeDeletedPerPartition ( ) . isEmpty ( ) && cleanerPlan . getFilePathsToBeDeletedPerPartition ( ) . values ( ) . stream ( ) . mapToInt ( List :: size ) . sum ( ) > 0 ) { final HoodieInstant cleanInstant = new HoodieInstant ( HoodieInstant . State . REQUESTED , HoodieTimeline . CLEAN_ACTION , startCleanTime ) ; try { table . getActiveTimeline ( ) . saveToCleanRequested ( cleanInstant , TimelineMetadataUtils . serializeCleanerPlan ( cleanerPlan ) ) ; LOG . info ( "Requesting Cleaning with instant time " + cleanInstant ) ; } catch ( IOException e ) { LOG . error ( "Got exception when saving cleaner requested file" , e ) ; throw new HoodieIOException ( e . getMessage ( ) , e ) ; } return Option . of ( cleanerPlan ) ; } return Option . empty ( ) ; }
Creates a Cleaner plan if there are files to be cleaned and stores them in instant file.
Creates a Cleaner plan if there are files to be cleaned and stores them in instant file .
// Only create cleaner plan which does some work // Save to both aux and timeline folder