public interface HoodieTimeline extends Serializable
Timelines are immutable once created and operations create new instance of timelines which filter on the instants and this can be chained.
HoodieTableMetaClient,
HoodieDefaultTimeline,
HoodieInstant| Modifier and Type | Method and Description |
|---|---|
static boolean |
compareTimestamps(String commit1,
BiPredicate<String,String> predicateToApply,
String commit2) |
boolean |
containsInstant(HoodieInstant instant) |
boolean |
containsInstant(String ts) |
boolean |
containsOrBeforeTimelineStarts(String ts) |
int |
countInstants() |
boolean |
empty()
If the timeline has any instants.
|
HoodieTimeline |
filter(Predicate<HoodieInstant> filter)
Custom Filter of Instants.
|
HoodieTimeline |
filterCompletedAndCompactionInstants()
Filter this timeline to just include the completed + compaction (inflight + requested) instants A RT filesystem
view is constructed with this timeline so that file-slice after pending compaction-requested instant-time is also
considered valid.
|
HoodieTimeline |
filterCompletedIndexTimeline()
Filter this timeline to just include completed index instants.
|
HoodieTimeline |
filterCompletedInstants()
Filter this timeline to just include the completed instants.
|
HoodieTimeline |
filterCompletedInstantsOrRewriteTimeline()
Timeline to just include completed commits or all rewrites like compaction, logcompaction and replace actions.
|
HoodieTimeline |
filterCompletedOrMajorOrMinorCompactionInstants() |
HoodieTimeline |
filterInflights()
Filter this timeline to just include the in-flights.
|
HoodieTimeline |
filterInflightsAndRequested()
Filter this timeline to include requested and in-flights.
|
HoodieTimeline |
filterPendingCompactionTimeline()
Filter this timeline to just include requested and inflight compaction instants.
|
HoodieTimeline |
filterPendingExcludingCompaction()
Filter this timeline to just include the in-flights excluding compaction instants.
|
HoodieTimeline |
filterPendingExcludingLogCompaction()
Filter this timeline to just include the in-flights excluding logcompaction instants.
|
HoodieTimeline |
filterPendingExcludingMajorAndMinorCompaction()
Filter this timeline to just include the in-flights excluding major and minor compaction instants.
|
HoodieTimeline |
filterPendingIndexTimeline()
Filter this timeline to just include requested and inflight index instants.
|
HoodieTimeline |
filterPendingLogCompactionTimeline()
Filter this timeline to just include requested and inflight log compaction instants.
|
HoodieTimeline |
filterPendingMajorOrMinorCompactionTimeline()
Filter this timeline to just include requested and inflight from both major and minor compaction instants.
|
HoodieTimeline |
filterPendingReplaceTimeline()
Filter this timeline to just include requested and inflight replacecommit instants.
|
HoodieTimeline |
filterPendingRollbackTimeline()
Filter this timeline to include pending rollbacks.
|
HoodieTimeline |
filterRequestedRollbackTimeline()
Filter this timeline for requested rollbacks.
|
Option<HoodieInstant> |
findInstantBefore(String instantTime)
Finds the instant before specified time.
|
HoodieTimeline |
findInstantsAfter(String instantTime)
Create a new Timeline with all the instants after startTs.
|
HoodieTimeline |
findInstantsAfter(String instantTime,
int numCommits)
Create a new Timeline with all the instants after startTs.
|
HoodieTimeline |
findInstantsAfterOrEquals(String commitTime,
int numCommits)
Create a new Timeline with all the instants after startTs.
|
HoodieTimeline |
findInstantsBefore(String instantTime)
Create a new Timeline with all instants before specified time.
|
HoodieTimeline |
findInstantsBeforeOrEquals(String instantTime)
Create new timeline with all instants before or equals specified time.
|
HoodieTimeline |
findInstantsInClosedRange(String startTs,
String endTs)
Create a new Timeline with instants after or equals startTs and before or on endTs.
|
HoodieTimeline |
findInstantsInRange(String startTs,
String endTs)
Create a new Timeline with instants after startTs and before or on endTs.
|
HoodieTimeline |
findInstantsInRangeByStateTransitionTime(String startTs,
String endTs)
`
Create a new Timeline with instants after startTs and before or on endTs
by state transition timestamp of actions.
|
HoodieTimeline |
findInstantsModifiedAfterByStateTransitionTime(String instantTime)
Create new timeline with all instants that were modified after specified time.
|
Option<HoodieInstant> |
firstInstant() |
Option<HoodieInstant> |
firstInstant(String action,
HoodieInstant.State state) |
static HoodieInstant |
getCleanInflightInstant(String timestamp) |
static HoodieInstant |
getCleanRequestedInstant(String timestamp) |
static String |
getCommitFromCommitFile(String commitFileName) |
static HoodieInstant |
getCompactionInflightInstant(String timestamp) |
static HoodieInstant |
getCompactionRequestedInstant(String timestamp) |
static HoodieInstant |
getCompletedInstant(HoodieInstant instant) |
HoodieTimeline |
getCompletedReplaceTimeline()
Timeline to just include replace instants that have valid (commit/deltacommit) actions.
|
HoodieTimeline |
getContiguousCompletedWriteTimeline()
Timeline to just include commits (commit/deltacommit), compaction and replace actions that are completed and contiguous.
|
Option<HoodieInstant> |
getFirstNonSavepointCommit()
First non-savepoint commit in the active data timeline.
|
Option<HoodieInstant> |
getFirstPendingClusterInstant()
get the least recent pending cluster commit if present
|
static HoodieInstant |
getIndexInflightInstant(String timestamp) |
static HoodieInstant |
getIndexRequestedInstant(String timestamp) |
static HoodieInstant |
getInflightInstant(HoodieInstant instant,
HoodieTableMetaClient metaClient)
Returns the inflight instant corresponding to the instant being passed.
|
Option<byte[]> |
getInstantDetails(HoodieInstant instant)
Read the completed instant details.
|
List<HoodieInstant> |
getInstants() |
Stream<HoodieInstant> |
getInstantsAsStream() |
Stream<HoodieInstant> |
getInstantsOrderedByStateTransitionTime()
Get the stream of instants in order by state transition timestamp of actions.
|
Option<HoodieInstant> |
getLastClusteringInstant()
get the most recent cluster commit if present
|
Option<HoodieInstant> |
getLastPendingClusterInstant()
get the most recent pending cluster commit if present
|
static HoodieInstant |
getLogCompactionInflightInstant(String timestamp) |
static HoodieInstant |
getLogCompactionRequestedInstant(String timestamp) |
static HoodieInstant |
getReplaceCommitInflightInstant(String timestamp) |
static HoodieInstant |
getReplaceCommitRequestedInstant(String timestamp) |
static HoodieInstant |
getRequestedInstant(HoodieInstant instant) |
static HoodieInstant |
getRestoreRequestedInstant(HoodieInstant instant) |
Stream<HoodieInstant> |
getReverseOrderedInstants() |
static HoodieInstant |
getRollbackRequestedInstant(HoodieInstant instant) |
String |
getTimelineHash()
Get hash of timeline.
|
HoodieTimeline |
getWriteTimeline()
Timeline to just include commits (commit/deltacommit), compaction and replace actions.
|
boolean |
isBeforeTimelineStarts(String ts) |
boolean |
isEmpty(HoodieInstant instant) |
static boolean |
isInClosedRange(String timestamp,
String startTs,
String endTs)
Return true if specified timestamp is in range [startTs, endTs].
|
static boolean |
isInRange(String timestamp,
String startTs,
String endTs)
Return true if specified timestamp is in range (startTs, endTs].
|
boolean |
isPendingClusterInstant(String instantTime)
return true if instant is a pending clustering commit, otherwise false
|
Option<HoodieInstant> |
lastInstant() |
static String |
makeCleanerFileName(String instant) |
static String |
makeCommitFileName(String instantTime) |
static String |
makeDeltaFileName(String instantTime) |
static String |
makeFileNameAsComplete(String fileName) |
static String |
makeFileNameAsInflight(String fileName) |
static String |
makeIndexCommitFileName(String instant) |
static String |
makeInflightCleanerFileName(String instant) |
static String |
makeInflightCommitFileName(String instantTime) |
static String |
makeInflightCompactionFileName(String instantTime) |
static String |
makeInflightDeltaFileName(String instantTime) |
static String |
makeInflightIndexFileName(String instant) |
static String |
makeInflightLogCompactionFileName(String instantTime) |
static String |
makeInflightReplaceFileName(String instant) |
static String |
makeInflightRestoreFileName(String instant) |
static String |
makeInflightRollbackFileName(String instant) |
static String |
makeInflightSavePointFileName(String instantTime) |
static String |
makeInflightSchemaFileName(String instantTime) |
static String |
makeReplaceFileName(String instant) |
static String |
makeRequestedCleanerFileName(String instant) |
static String |
makeRequestedCommitFileName(String instantTime) |
static String |
makeRequestedCompactionFileName(String instantTime) |
static String |
makeRequestedDeltaFileName(String instantTime) |
static String |
makeRequestedIndexFileName(String instant) |
static String |
makeRequestedLogCompactionFileName(String instantTime) |
static String |
makeRequestedReplaceFileName(String instant) |
static String |
makeRequestedRestoreFileName(String instant) |
static String |
makeRequestedRollbackFileName(String instant) |
static String |
makeRequestSchemaFileName(String instantTime) |
static String |
makeRestoreFileName(String instant) |
static String |
makeRollbackFileName(String instant) |
static String |
makeSavePointFileName(String instantTime) |
static String |
makeSchemaFileName(String instantTime) |
Option<HoodieInstant> |
nthFromLastInstant(int n) |
Option<HoodieInstant> |
nthInstant(int n) |
static final String COMMIT_ACTION
static final String DELTA_COMMIT_ACTION
static final String CLEAN_ACTION
static final String ROLLBACK_ACTION
static final String SAVEPOINT_ACTION
static final String REPLACE_COMMIT_ACTION
static final String INFLIGHT_EXTENSION
static final String COMPACTION_ACTION
static final String LOG_COMPACTION_ACTION
static final String REQUESTED_EXTENSION
static final String COMPLETED_EXTENSION
static final String RESTORE_ACTION
static final String INDEXING_ACTION
static final String SCHEMA_COMMIT_ACTION
static final String[] VALID_ACTIONS_IN_TIMELINE
static final String COMMIT_EXTENSION
static final String DELTA_COMMIT_EXTENSION
static final String CLEAN_EXTENSION
static final String ROLLBACK_EXTENSION
static final String SAVEPOINT_EXTENSION
static final String INFLIGHT_COMMIT_EXTENSION
static final String REQUESTED_COMMIT_EXTENSION
static final String REQUESTED_DELTA_COMMIT_EXTENSION
static final String INFLIGHT_DELTA_COMMIT_EXTENSION
static final String INFLIGHT_CLEAN_EXTENSION
static final String REQUESTED_CLEAN_EXTENSION
static final String INFLIGHT_ROLLBACK_EXTENSION
static final String REQUESTED_ROLLBACK_EXTENSION
static final String INFLIGHT_SAVEPOINT_EXTENSION
static final String REQUESTED_COMPACTION_SUFFIX
static final String COMPLETED_COMPACTION_SUFFIX
static final String REQUESTED_COMPACTION_EXTENSION
static final String INFLIGHT_COMPACTION_EXTENSION
static final String REQUESTED_RESTORE_EXTENSION
static final String INFLIGHT_RESTORE_EXTENSION
static final String RESTORE_EXTENSION
static final String INFLIGHT_REPLACE_COMMIT_EXTENSION
static final String REQUESTED_REPLACE_COMMIT_EXTENSION
static final String REPLACE_COMMIT_EXTENSION
static final String INFLIGHT_INDEX_COMMIT_EXTENSION
static final String REQUESTED_INDEX_COMMIT_EXTENSION
static final String INDEX_COMMIT_EXTENSION
static final String SAVE_SCHEMA_ACTION_EXTENSION
static final String INFLIGHT_SAVE_SCHEMA_ACTION_EXTENSION
static final String REQUESTED_SAVE_SCHEMA_ACTION_EXTENSION
static final String REQUESTED_LOG_COMPACTION_SUFFIX
static final String REQUESTED_LOG_COMPACTION_EXTENSION
static final String INFLIGHT_LOG_COMPACTION_EXTENSION
static final String INVALID_INSTANT_TS
static final String INIT_INSTANT_TS
static final String METADATA_BOOTSTRAP_INSTANT_TS
static final String FULL_BOOTSTRAP_INSTANT_TS
static final BiPredicate<String,String> EQUALS
static final BiPredicate<String,String> GREATER_THAN_OR_EQUALS
static final BiPredicate<String,String> GREATER_THAN
static final BiPredicate<String,String> LESSER_THAN_OR_EQUALS
static final BiPredicate<String,String> LESSER_THAN
HoodieTimeline filterInflights()
HoodieTimeline filterInflightsAndRequested()
HoodieTimeline filterPendingExcludingCompaction()
HoodieTimeline filterPendingExcludingLogCompaction()
HoodieTimeline filterPendingExcludingMajorAndMinorCompaction()
HoodieTimeline filterCompletedInstants()
HoodieTimeline filterCompletedAndCompactionInstants()
HoodieTimeline filterCompletedOrMajorOrMinorCompactionInstants()
HoodieTimeline filterCompletedInstantsOrRewriteTimeline()
HoodieTimeline getWriteTimeline()
HoodieTimeline getContiguousCompletedWriteTimeline()
HoodieTimeline getCompletedReplaceTimeline()
HoodieTimeline filterPendingCompactionTimeline()
HoodieTimeline filterPendingLogCompactionTimeline()
HoodieTimeline filterPendingMajorOrMinorCompactionTimeline()
HoodieTimeline filterPendingReplaceTimeline()
HoodieTimeline filterPendingRollbackTimeline()
HoodieTimeline filterRequestedRollbackTimeline()
HoodieTimeline findInstantsAfterOrEquals(String commitTime, int numCommits)
HoodieTimeline findInstantsInRange(String startTs, String endTs)
HoodieTimeline findInstantsInClosedRange(String startTs, String endTs)
HoodieTimeline findInstantsInRangeByStateTransitionTime(String startTs, String endTs)
HoodieTimeline findInstantsModifiedAfterByStateTransitionTime(String instantTime)
HoodieTimeline findInstantsAfter(String instantTime, int numCommits)
HoodieTimeline findInstantsAfter(String instantTime)
HoodieTimeline findInstantsBefore(String instantTime)
Option<HoodieInstant> findInstantBefore(String instantTime)
HoodieTimeline findInstantsBeforeOrEquals(String instantTime)
HoodieTimeline filter(Predicate<HoodieInstant> filter)
HoodieTimeline filterPendingIndexTimeline()
HoodieTimeline filterCompletedIndexTimeline()
boolean empty()
int countInstants()
Option<HoodieInstant> firstInstant()
Option<HoodieInstant> firstInstant(String action, HoodieInstant.State state)
action - Instant action String.state - Instant State.Option<HoodieInstant> nthInstant(int n)
Option<HoodieInstant> lastInstant()
String getTimelineHash()
Option<HoodieInstant> nthFromLastInstant(int n)
boolean containsInstant(HoodieInstant instant)
boolean containsInstant(String ts)
boolean containsOrBeforeTimelineStarts(String ts)
Stream<HoodieInstant> getInstantsAsStream()
List<HoodieInstant> getInstants()
Stream<HoodieInstant> getReverseOrderedInstants()
Stream<HoodieInstant> getInstantsOrderedByStateTransitionTime()
boolean isBeforeTimelineStarts(String ts)
Option<HoodieInstant> getFirstNonSavepointCommit()
Option<HoodieInstant> getLastClusteringInstant()
Option<HoodieInstant> getLastPendingClusterInstant()
Option<HoodieInstant> getFirstPendingClusterInstant()
boolean isPendingClusterInstant(String instantTime)
Option<byte[]> getInstantDetails(HoodieInstant instant)
boolean isEmpty(HoodieInstant instant)
static boolean compareTimestamps(String commit1, BiPredicate<String,String> predicateToApply, String commit2)
static boolean isInRange(String timestamp, String startTs, String endTs)
static boolean isInClosedRange(String timestamp, String startTs, String endTs)
static HoodieInstant getCompletedInstant(HoodieInstant instant)
static HoodieInstant getRequestedInstant(HoodieInstant instant)
static HoodieInstant getCleanRequestedInstant(String timestamp)
static HoodieInstant getCleanInflightInstant(String timestamp)
static HoodieInstant getCompactionRequestedInstant(String timestamp)
static HoodieInstant getCompactionInflightInstant(String timestamp)
static HoodieInstant getLogCompactionRequestedInstant(String timestamp)
static HoodieInstant getLogCompactionInflightInstant(String timestamp)
static HoodieInstant getReplaceCommitRequestedInstant(String timestamp)
static HoodieInstant getReplaceCommitInflightInstant(String timestamp)
static HoodieInstant getRollbackRequestedInstant(HoodieInstant instant)
static HoodieInstant getRestoreRequestedInstant(HoodieInstant instant)
static HoodieInstant getIndexRequestedInstant(String timestamp)
static HoodieInstant getIndexInflightInstant(String timestamp)
static HoodieInstant getInflightInstant(HoodieInstant instant, HoodieTableMetaClient metaClient)
instant - Hoodie InstantmetaClient - Hoodie metaClient to fetch tableType and fileSystem.static String makeInflightLogCompactionFileName(String instantTime)
static String makeRequestedLogCompactionFileName(String instantTime)
Copyright © 2024 The Apache Software Foundation. All rights reserved.