1
0

[HUDI-1136] Add back findInstantsAfterOrEquals to the HoodieTimeline class.

This commit is contained in:
Prashant Wason
2020-08-24 14:24:50 -07:00
committed by n3nash
parent f7e02aa8a3
commit 9b1f16b604
2 changed files with 12 additions and 0 deletions

View File

@@ -132,6 +132,13 @@ public class HoodieDefaultTimeline implements HoodieTimeline {
details);
}
@Override
public HoodieDefaultTimeline findInstantsAfterOrEquals(String commitTime, int numCommits) {
return new HoodieDefaultTimeline(instants.stream()
.filter(s -> HoodieTimeline.compareTimestamps(s.getTimestamp(), GREATER_THAN_OR_EQUALS, commitTime))
.limit(numCommits), details);
}
@Override
public HoodieDefaultTimeline findInstantsBefore(String instantTime) {
return new HoodieDefaultTimeline(instants.stream()

View File

@@ -140,6 +140,11 @@ public interface HoodieTimeline extends Serializable {
*/
HoodieTimeline filterPendingCompactionTimeline();
/**
* Create a new Timeline with all the instants after startTs.
*/
HoodieTimeline findInstantsAfterOrEquals(String commitTime, int numCommits);
/**
* Create a new Timeline with instants after startTs and before or on endTs.
*/