public class TransactionImpl extends Object implements Transaction
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_READ_VERSION |
static int |
DEFAULT_WRITE_VERSION |
| Constructor and Description |
|---|
TransactionImpl(boolean isNewTable,
Path dataPath,
Path logPath,
SnapshotImpl readSnapshot,
String engineInfo,
Operation operation,
Protocol protocol,
Metadata metadata,
java.util.Optional<SetTransaction> setTxnOpt) |
| Modifier and Type | Method and Description |
|---|---|
TransactionCommitResult |
commit(Engine engine,
CloseableIterable<Row> dataActions)
Commit the transaction including the data action rows generated by
Transaction.generateAppendActions(io.delta.kernel.engine.Engine, io.delta.kernel.data.Row, io.delta.kernel.utils.CloseableIterator<io.delta.kernel.utils.DataFileStatus>, io.delta.kernel.DataWriteContext). |
java.util.List<String> |
getPartitionColumns(Engine engine)
Get the list of logical names of the partition columns.
|
StructType |
getSchema(Engine engine)
Get the schema of the table.
|
java.util.Optional<SetTransaction> |
getSetTxnOpt() |
static java.util.List<Column> |
getStatisticsColumns(Engine engine,
Row transactionState)
Get the part of the schema of the table that needs the statistics to be collected per file.
|
Row |
getTransactionState(Engine engine)
Get the state of the transaction.
|
boolean |
isBlindAppend() |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgenerateAppendActions, getWriteContext, transformLogicalDatapublic static final int DEFAULT_READ_VERSION
public static final int DEFAULT_WRITE_VERSION
public TransactionImpl(boolean isNewTable,
Path dataPath,
Path logPath,
SnapshotImpl readSnapshot,
String engineInfo,
Operation operation,
Protocol protocol,
Metadata metadata,
java.util.Optional<SetTransaction> setTxnOpt)
public Row getTransactionState(Engine engine)
TransactionTransaction.transformLogicalData(Engine, Row, CloseableIterator, Map)getTransactionState in interface Transactionpublic java.util.List<String> getPartitionColumns(Engine engine)
TransactiongetPartitionColumns in interface Transactionpublic StructType getSchema(Engine engine)
TransactiongetSchema in interface Transactionpublic TransactionCommitResult commit(Engine engine, CloseableIterable<Row> dataActions) throws ConcurrentWriteException
TransactionTransaction.generateAppendActions(io.delta.kernel.engine.Engine, io.delta.kernel.data.Row, io.delta.kernel.utils.CloseableIterator<io.delta.kernel.utils.DataFileStatus>, io.delta.kernel.DataWriteContext).commit in interface Transactionengine - Engine instance.dataActions - Iterable of data actions to commit. These data actions are generated by
the
Transaction.generateAppendActions(Engine, Row, CloseableIterator,
DataWriteContext). The CloseableIterable allows the Kernel to
access the list of actions multiple times (in case of retries to resolve
the conflicts due to other writers to the table). Kernel provides a
in-memory based implementation of CloseableIterable with utility
API CloseableIterable.inMemoryIterable(CloseableIterator)TransactionCommitResult status of the successful transaction.ConcurrentWriteException - when the transaction has encountered a non-retryable
conflicts or exceeded the maximum number of retries reached.
The connector needs to rerun the query on top of the latest
table state and retry the transaction.public boolean isBlindAppend()
public java.util.Optional<SetTransaction> getSetTxnOpt()
public static java.util.List<Column> getStatisticsColumns(Engine engine, Row transactionState)
engine - Engine instance to use.transactionState - State of the transaction