Package io.delta.kernel.internal.metrics
Class SnapshotReportImpl
Object
io.delta.kernel.internal.metrics.DeltaOperationReportImpl
io.delta.kernel.internal.metrics.SnapshotReportImpl
- All Implemented Interfaces:
DeltaOperationReport,MetricsReport,SnapshotReport
A basic POJO implementation of
SnapshotReport for creating them-
Method Summary
Modifier and TypeMethodDescriptionstatic SnapshotReportforError(SnapshotQueryContext snapshotContext, Exception e) Creates aSnapshotReportfor a failed snapshot query.static SnapshotReportforSuccess(SnapshotQueryContext snapshotContext) Creates aSnapshotReportfor a successful snapshot query.For a time-travel by version query, this is the version provided.toJson()Converts this metrics report to a JSON string representation.Methods inherited from class io.delta.kernel.internal.metrics.DeltaOperationReportImpl
getException, getReportUUID, getTablePathMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.delta.kernel.metrics.DeltaOperationReport
getException, getReportUUID, getTablePathMethods inherited from interface io.delta.kernel.metrics.SnapshotReport
getOperationType
-
Method Details
-
forError
Creates aSnapshotReportfor a failed snapshot query.- Parameters:
snapshotContext- context/metadata about the snapshot querye- the exception that was thrown
-
forSuccess
Creates aSnapshotReportfor a successful snapshot query.- Parameters:
snapshotContext- context/metadata about the snapshot query
-
getSnapshotMetrics
- Specified by:
getSnapshotMetricsin interfaceSnapshotReport- Returns:
- the metrics for this snapshot construction
-
getVersion
Description copied from interface:SnapshotReportFor a time-travel by version query, this is the version provided. For a time-travel by timestamp query, this is the version resolved from the provided timestamp. For a latest snapshot, this is the version read from the delta log.This is empty when this report is for a failed snapshot construction, and the error occurs before a version can be resolved.
- Specified by:
getVersionin interfaceSnapshotReport- Returns:
- the version of the snapshot
-
getCheckpointVersion
- Specified by:
getCheckpointVersionin interfaceSnapshotReport- Returns:
- the version of the checkpoint used for this snapshot, empty if no checkpoint was used or if this is a failed snapshot construction
-
getProvidedTimestamp
- Specified by:
getProvidedTimestampin interfaceSnapshotReport- Returns:
- the timestamp provided for time-travel, empty if this is not a timestamp-based time-travel query
-
toJson
Description copied from interface:MetricsReportConverts this metrics report to a JSON string representation.- Specified by:
toJsonin interfaceMetricsReport- Returns:
- a JSON string representation of this metrics report
- Throws:
com.fasterxml.jackson.core.JsonProcessingException- if the report cannot be serialized to JSON
-