trait Transaction extends Closeable
Represents a transaction.
Spark begins a transaction with TransactionalCatalogPlugin#beginTransaction and
executes read/write operations against the transaction's catalog. On success, Spark
calls #commit(); on failure, Spark calls #abort(). In both cases Spark
subsequently calls #close() to release resources.
- Annotations
- @Evolving()
- Source
- Transaction.java
- Since
4.2.0
- Alphabetic
- By Inheritance
- Transaction
- Closeable
- AutoCloseable
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Abstract Value Members
- abstract def abort(): Unit
Aborts the transaction, discarding any staged changes.
Aborts the transaction, discarding any staged changes.
This method must be idempotent. If the transaction has already been committed or aborted, invoking it must have no effect.
Spark calls
#close()immediately after this method returns. - abstract def catalog(): CatalogPlugin
Returns the catalog associated with this transaction.
Returns the catalog associated with this transaction. This catalog is responsible for tracking read/write operations that occur within the boundaries of a transaction. This allows connectors to perform conflict resolution at commit time.
- abstract def close(): Unit
Releases any resources held by this transaction.
Releases any resources held by this transaction.
Spark always calls this method after
#commit()or#abort(), regardless of whether those methods succeed or not.This method must be idempotent. If the transaction has already been closed, invoking it must have no effect.
- Definition Classes
- Transaction → Closeable → AutoCloseable
- Annotations
- @Override()
- abstract def commit(): Unit
Commits the transaction.
Commits the transaction. All writes performed under it become visible to other readers.
The connector is responsible for detecting and resolving conflicting commits or throwing an exception if resolution is not possible.
This method will be called exactly once per transaction. Spark calls
#close()immediately after this method returns.- Exceptions thrown
IllegalStateExceptionif the transaction has already been committed or aborted.
- abstract def registerScans(scans: Array[Scan]): Boolean
Attempts to register materialized scans against this transaction's read set.
Attempts to register materialized scans against this transaction's read set.
An example use case is cache reuse. Spark passes the scans of a candidate cached subtree for the transaction's catalog and the connector decides whether to accept them.
The connector must either accept all passed scans (returning
trueafter adding the scans to the read set) or refuse (returningfalsewithout modifying the read set).- scans
the materialized scans Spark offers for registration against this transaction's read set.
- returns
true if the connector accepts the scans; false otherwise.
Concrete Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @IntrinsicCandidate() @native()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @IntrinsicCandidate() @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @IntrinsicCandidate() @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @IntrinsicCandidate() @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @IntrinsicCandidate() @native()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated
(Since version 9)