1
0

[HUDI-52] Enabling savepoint and restore for MOR table (#4507)

* Enabling restore for MOR table

* Fixing savepoint for compaction commits in MOR
This commit is contained in:
Sivabalan Narayanan
2022-01-06 10:56:08 -05:00
committed by GitHub
parent b6891d253f
commit 2954027b92
3 changed files with 101 additions and 14 deletions

View File

@@ -24,7 +24,6 @@ import org.apache.hudi.common.engine.HoodieEngineContext;
import org.apache.hudi.common.fs.FSUtils;
import org.apache.hudi.common.model.HoodieBaseFile;
import org.apache.hudi.common.model.HoodieRecordPayload;
import org.apache.hudi.common.model.HoodieTableType;
import org.apache.hudi.common.table.timeline.HoodieInstant;
import org.apache.hudi.common.table.timeline.HoodieTimeline;
import org.apache.hudi.common.table.timeline.TimelineMetadataUtils;
@@ -65,13 +64,9 @@ public class SavepointActionExecutor<T extends HoodieRecordPayload, I, K, O> ext
@Override
public HoodieSavepointMetadata execute() {
if (table.getMetaClient().getTableType() == HoodieTableType.MERGE_ON_READ) {
throw new UnsupportedOperationException("Savepointing is not supported or MergeOnRead table types");
}
Option<HoodieInstant> cleanInstant = table.getCompletedCleanTimeline().lastInstant();
HoodieInstant commitInstant = new HoodieInstant(false, HoodieTimeline.COMMIT_ACTION, instantTime);
if (!table.getCompletedCommitsTimeline().containsInstant(commitInstant)) {
throw new HoodieSavepointException("Could not savepoint non-existing commit " + commitInstant);
if (!table.getCompletedCommitsTimeline().containsInstant(instantTime)) {
throw new HoodieSavepointException("Could not savepoint non-existing commit " + instantTime);
}
try {