Package io.delta.kernel.internal.metrics
Class TransactionReportImpl
Object
io.delta.kernel.internal.metrics.DeltaOperationReportImpl
io.delta.kernel.internal.metrics.TransactionReportImpl
- All Implemented Interfaces:
DeltaOperationReport,MetricsReport,TransactionReport
A basic POJO implementation of
TransactionReport for creating them-
Constructor Summary
ConstructorsConstructorDescriptionTransactionReportImpl(String tablePath, String operation, String engineInfo, Optional<Long> committedVersion, Optional<List<Column>> clusteringColumns, TransactionMetrics transactionMetrics, Optional<SnapshotReport> snapshotReport, Optional<Exception> exception) -
Method Summary
Modifier and TypeMethodDescriptionlongThe version of the table the transaction was created from.Get the list of clustering columns the table data is expected to be clustered by.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.TransactionReport
getOperationType
-
Constructor Details
-
TransactionReportImpl
public TransactionReportImpl(String tablePath, String operation, String engineInfo, Optional<Long> committedVersion, Optional<List<Column>> clusteringColumns, TransactionMetrics transactionMetrics, Optional<SnapshotReport> snapshotReport, Optional<Exception> exception) - Parameters:
tablePath- the path of the table for the transactionoperation- the operation provided by the connector when the transaction was createdengineInfo- the engineInfo provided by the connector when the transaction was createdcommittedVersion- the version committed to the table. Empty for a failed transaction.clusteringColumns- the clustering columns for the table, if any. Empty if not set.transactionMetrics- the metrics for the transactionsnapshotReport- the SnapshotReport for the base snapshot of this transaction. Note, in the case of a new table (when version = -1), this SnapshotReport is just a placeholder and was never emitted to the engine's metrics reporters.exception- the exception thrown. Empty for a successful transaction.
-
-
Method Details
-
getOperation
- Specified by:
getOperationin interfaceTransactionReport- Returns:
- The
Operationprovided when the transaction was created usingTable.createTransactionBuilder(io.delta.kernel.engine.Engine, java.lang.String, io.delta.kernel.Operation).
-
getEngineInfo
- Specified by:
getEngineInfoin interfaceTransactionReport- Returns:
- The engineInfo provided when the transaction was created using
Table.createTransactionBuilder(io.delta.kernel.engine.Engine, java.lang.String, io.delta.kernel.Operation).
-
getBaseSnapshotVersion
public long getBaseSnapshotVersion()Description copied from interface:TransactionReportThe version of the table the transaction was created from. For example, if the latest table version is 4 when the transaction is created, the transaction is based off of the snapshot of the table at version 4. For a new table (e.g. a transaction that is creating a table) this is -1.- Specified by:
getBaseSnapshotVersionin interfaceTransactionReport- Returns:
- the table version of the snapshot the transaction was started from
-
getClusteringColumns
Description copied from interface:TransactionReportGet the list of clustering columns the table data is expected to be clustered by. This is optional because clustering columns are not always defined for a table. Consumers of the transaction report trigger clustering operations based on this list.- Specified by:
getClusteringColumnsin interfaceTransactionReport- Returns:
- list of clustering columns for the table. The columns are physical names of how the data is written in the data files. Each column can contain one or more elements representing the hierarchy of the column names in case of nested columns.
-
getSnapshotReportUUID
- Specified by:
getSnapshotReportUUIDin interfaceTransactionReport- Returns:
- the
DeltaOperationReport.getReportUUID()of the SnapshotReport for the transaction's snapshot construction. Empty for a new table transaction.
-
getCommittedVersion
- Specified by:
getCommittedVersionin interfaceTransactionReport- Returns:
- the version committed to the table in this transaction. Empty for a failed transaction.
-
getTransactionMetrics
- Specified by:
getTransactionMetricsin interfaceTransactionReport- Returns:
- the metrics for this transaction
-
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
-