Package io.delta.kernel.internal
Class DeltaHistoryManager
Object
io.delta.kernel.internal.DeltaHistoryManager
-
Method Summary
Modifier and TypeMethodDescriptionstatic longgetActiveCommitAtTimestamp(Engine engine, Path logPath, long timestamp) Returns the latest recreatable commit that happened at or beforetimestamp.static longgetEarliestRecreatableCommit(Engine engine, Path logPath) Gets the earliest commit that we can recreate.
-
Method Details
-
getActiveCommitAtTimestamp
public static long getActiveCommitAtTimestamp(Engine engine, Path logPath, long timestamp) throws TableNotFoundException Returns the latest recreatable commit that happened at or beforetimestamp. If the provided timestamp is after the timestamp of the latest version of the table throws an exception. If the provided timestamp is before the timestamp of the earliest version of the table throws an exception.- Parameters:
engine- instance ofEngineto uselogPath- the _delta_log path of the tabletimestamp- the timestamp find the version for in milliseconds since the unix epoch- Returns:
- the active recreatable commit version at the provided timestamp
- Throws:
TableNotFoundException- when there is no Delta table at the given path
-
getEarliestRecreatableCommit
public static long getEarliestRecreatableCommit(Engine engine, Path logPath) throws TableNotFoundException Gets the earliest commit that we can recreate. Note that this version isn't guaranteed to exist when performing an action as a concurrent operation can delete the file during cleanup. This value must be used as a lower bound. We search for the earliest checkpoint we have, or whether we have the 0th delta file. This method assumes that the commits are contiguous.- Throws:
TableNotFoundException
-