Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -811,6 +811,15 @@ public String startCommit(String actionType, HoodieTableMetaClient metaClient) {
return instantTime;
}


/**
* Provides a new commit time for a write operation (insert/update/delete/insert_overwrite/insert_overwrite_table) with specified action.
*/
public String startCommit(String actionType) {
HoodieTableMetaClient metaClient = createMetaClient(true);
return startCommit(actionType, metaClient);
}

/**
* Provides a new commit time for a write operation (insert/update/delete/insert_overwrite/insert_overwrite_table) without specified action.
* @param instantTime Instant time to be generated
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@
import org.apache.hudi.common.table.HoodieTableMetaClient;
import org.apache.hudi.common.table.TableSchemaResolver;
import org.apache.hudi.common.table.log.block.HoodieLogBlock.HoodieLogBlockType;
import org.apache.hudi.common.table.timeline.HoodieActiveTimeline;
import org.apache.hudi.common.table.timeline.HoodieInstant;
import org.apache.hudi.common.table.timeline.HoodieTimeline;
import org.apache.hudi.common.util.CommitUtils;
Expand Down Expand Up @@ -759,10 +758,8 @@ private String startCommit() {
RuntimeException lastException = null;
while (retryNum <= maxRetries) {
try {
String instantTime = HoodieActiveTimeline.createNewInstantTime();
String commitActionType = CommitUtils.getCommitActionType(cfg.operation, HoodieTableType.valueOf(cfg.tableType));
writeClient.startCommitWithTime(instantTime, commitActionType);
return instantTime;
return writeClient.startCommit(commitActionType);
} catch (IllegalArgumentException ie) {
lastException = ie;
LOG.error("Got error trying to start a new commit. Retrying after sleeping for a sec", ie);
Expand Down