public class SnapshotManager
extends Object
| Constructor and Description |
|---|
SnapshotManager(Path logPath,
Path tablePath) |
| Modifier and Type | Method and Description |
|---|---|
Snapshot |
buildLatestSnapshot(Engine engine)
Construct the latest snapshot for given table.
|
void |
checkpoint(Engine engine,
long version) |
java.util.Optional<LogSegment> |
getLogSegmentForVersion(Engine engine,
java.util.Optional<Long> startCheckpoint,
java.util.Optional<Long> versionToLoad)
Get a list of files that can be used to compute a Snapshot at version `versionToLoad`, If
`versionToLoad` is not provided, will generate the list of files that are needed to load the
latest version of the Delta table.
|
Snapshot |
getSnapshotAt(Engine engine,
long version)
Construct the snapshot for the given table at the version provided.
|
Snapshot |
getSnapshotForTimestamp(Engine engine,
long millisSinceEpochUTC)
Construct the snapshot for the given table at the provided timestamp.
|
static void |
verifyDeltaVersions(java.util.List<Long> versions,
java.util.Optional<Long> expectedStartVersion,
java.util.Optional<Long> expectedEndVersion)
- Verify the versions are contiguous.
|
public static void verifyDeltaVersions(java.util.List<Long> versions,
java.util.Optional<Long> expectedStartVersion,
java.util.Optional<Long> expectedEndVersion)
public Snapshot buildLatestSnapshot(Engine engine) throws TableNotFoundException
engine - Instance of Engine to use.TableNotFoundExceptionpublic Snapshot getSnapshotAt(Engine engine, long version) throws TableNotFoundException
engine - Instance of Engine to use.version - The snapshot version to constructSnapshot of the table at version versionTableNotFoundExceptionpublic Snapshot getSnapshotForTimestamp(Engine engine, long millisSinceEpochUTC) throws TableNotFoundException
engine - Instance of Engine to use.millisSinceEpochUTC - timestamp to fetch the snapshot for in milliseconds since the
unix epochSnapshot of the table at the provided timestampTableNotFoundExceptionpublic void checkpoint(Engine engine, long version) throws TableNotFoundException, java.io.IOException
TableNotFoundExceptionjava.io.IOExceptionpublic java.util.Optional<LogSegment> getLogSegmentForVersion(Engine engine, java.util.Optional<Long> startCheckpoint, java.util.Optional<Long> versionToLoad)
startCheckpoint - A potential start version to perform the listing of the DeltaLog,
typically that of a known checkpoint. If this version's not provided,
we will start listing from version 0.versionToLoad - A specific version to load. Typically used with time travel and the
Delta streaming source. If not provided, we will try to load the
latest
version of the table.