hudi-client/src/main/java/org/apache/hudi/table/action/bootstrap/BootstrapCommitActionExecutor.java
/**
   * Perform Metadata Bootstrap.
   * @param partitionFilesList List of partitions and files within that partitions
   */
Perform Metadata Bootstrap.
@param partitionFilesList List of partitions and files within that partitions
Perform Metadata Bootstrap . @param partitionFilesList List of partitions and files within that partitions
protected Option<HoodieWriteMetadata> metadataBootstrap(List<Pair<String, List<HoodieFileStatus>>> partitionFilesList) {
    if (null == partitionFilesList || partitionFilesList.isEmpty()) {
      return Option.empty();
    }
    HoodieTableMetaClient metaClient = table.getMetaClient();
    metaClient.getActiveTimeline().createNewInstant(
        new HoodieInstant(State.REQUESTED, metaClient.getCommitActionType(),
            HoodieTimeline.METADATA_BOOTSTRAP_INSTANT_TS));
    table.getActiveTimeline().transitionRequestedToInflight(new HoodieInstant(State.REQUESTED,
        metaClient.getCommitActionType(), HoodieTimeline.METADATA_BOOTSTRAP_INSTANT_TS), Option.empty());
    JavaRDD<BootstrapWriteStatus> bootstrapWriteStatuses = runMetadataBootstrap(partitionFilesList);
    HoodieWriteMetadata result = new HoodieWriteMetadata();
    updateIndexAndCommitIfNeeded(bootstrapWriteStatuses.map(w -> w), result);
    return Option.of(result);
  }
protected Option < HoodieWriteMetadata > metadataBootstrap ( List < Pair < String , List < HoodieFileStatus > > > partitionFilesList ) { if ( null == partitionFilesList || partitionFilesList . isEmpty ( ) ) { return Option . empty ( ) ; } HoodieTableMetaClient metaClient = table . getMetaClient ( ) ; metaClient . getActiveTimeline ( ) . createNewInstant ( new HoodieInstant ( State . REQUESTED , metaClient . getCommitActionType ( ) , HoodieTimeline . METADATA_BOOTSTRAP_INSTANT_TS ) ) ; table . getActiveTimeline ( ) . transitionRequestedToInflight ( new HoodieInstant ( State . REQUESTED , metaClient . getCommitActionType ( ) , HoodieTimeline . METADATA_BOOTSTRAP_INSTANT_TS ) , Option . empty ( ) ) ; JavaRDD < BootstrapWriteStatus > bootstrapWriteStatuses = runMetadataBootstrap ( partitionFilesList ) ; HoodieWriteMetadata result = new HoodieWriteMetadata ( ) ; updateIndexAndCommitIfNeeded ( bootstrapWriteStatuses . map ( w -> w ) , result ) ; return Option . of ( result ) ; }
Perform Metadata Bootstrap.
Perform Metadata Bootstrap .