[HUDI-761] Refactoring rollback and restore actions using the ActionExecutor abstraction (#1492)
- rollback() and restore() table level APIs introduced - Restore is implemented by wrapping calls to rollback executor - Existing tests transparently cover this, since its just a refactor
This commit is contained in:
@@ -51,15 +51,12 @@ public class TimelineMetadataUtils {
|
||||
|
||||
private static final Integer DEFAULT_VERSION = 1;
|
||||
|
||||
public static HoodieRestoreMetadata convertRestoreMetadata(String startRestoreTime, Option<Long> durationInMs,
|
||||
List<String> commits, Map<String, List<HoodieRollbackStat>> commitToStats) {
|
||||
Map<String, List<HoodieRollbackMetadata>> commitToStatsMap = new HashMap<>();
|
||||
for (Map.Entry<String, List<HoodieRollbackStat>> commitToStat : commitToStats.entrySet()) {
|
||||
commitToStatsMap.put(commitToStat.getKey(),
|
||||
Collections.singletonList(convertRollbackMetadata(startRestoreTime, durationInMs, commits, commitToStat.getValue())));
|
||||
}
|
||||
return new HoodieRestoreMetadata(startRestoreTime, durationInMs.orElseGet(() -> -1L), commits,
|
||||
Collections.unmodifiableMap(commitToStatsMap), DEFAULT_VERSION);
|
||||
public static HoodieRestoreMetadata convertRestoreMetadata(String startRestoreTime,
|
||||
long durationInMs,
|
||||
List<String> commits,
|
||||
Map<String, List<HoodieRollbackMetadata>> instantToRollbackMetadata) {
|
||||
return new HoodieRestoreMetadata(startRestoreTime, durationInMs, commits,
|
||||
Collections.unmodifiableMap(instantToRollbackMetadata), DEFAULT_VERSION);
|
||||
}
|
||||
|
||||
public static HoodieRollbackMetadata convertRollbackMetadata(String startRollbackTime, Option<Long> durationInMs,
|
||||
|
||||
@@ -27,6 +27,7 @@ import org.apache.hadoop.fs.FileStatus;
|
||||
import org.apache.hadoop.fs.Path;
|
||||
import org.junit.After;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.io.File;
|
||||
@@ -115,8 +116,8 @@ public class TestInLineFileSystem {
|
||||
}
|
||||
}
|
||||
|
||||
// @Test
|
||||
// Disabling flaky test for now https://issues.apache.org/jira/browse/HUDI-786
|
||||
@Test
|
||||
@Ignore // Disabling flaky test for now https://issues.apache.org/jira/browse/HUDI-786
|
||||
public void testFileSystemApis() throws IOException {
|
||||
OuterPathInfo outerPathInfo = generateOuterFileAndGetInfo(1000);
|
||||
Path inlinePath = FileSystemTestUtils.getPhantomFile(outerPathInfo.outerPath, outerPathInfo.startOffset, outerPathInfo.length);
|
||||
|
||||
Reference in New Issue
Block a user