1
0

Handle inflight clean instants during Hoodie instants archiving

This commit is contained in:
Jian Xu
2018-03-01 14:04:16 -08:00
committed by vinoth chandar
parent 5d5c306e64
commit dfd1979c51
3 changed files with 27 additions and 3 deletions

View File

@@ -126,9 +126,11 @@ public class HoodieCommitArchiveLog {
HoodieTable table = HoodieTable.getHoodieTable(metaClient, config);
// GroupBy each action and limit each action timeline to maxCommitsToKeep
// TODO: Handle ROLLBACK_ACTION in future
// ROLLBACK_ACTION is currently not defined in HoodieActiveTimeline
HoodieTimeline cleanAndRollbackTimeline = table.getActiveTimeline()
.getTimelineOfActions(Sets.newHashSet(HoodieTimeline.CLEAN_ACTION,
HoodieTimeline.ROLLBACK_ACTION));
.getTimelineOfActions(Sets.newHashSet(HoodieTimeline.CLEAN_ACTION))
.filterCompletedInstants();
Stream<HoodieInstant> instants = cleanAndRollbackTimeline.getInstants()
.collect(Collectors.groupingBy(s -> s.getAction()))
.entrySet()