T
- transaction identifier type@Beta public abstract class AbstractSnapshotBackedTransactionChain<T> extends SnapshotBackedWriteTransaction.TransactionReadyPrototype<T> implements DOMStoreTransactionChain
DOMStoreTransactionChain
interface relying on DataTreeSnapshot
supplier
and backend commit coordinator.Modifier | Constructor and Description |
---|---|
protected |
AbstractSnapshotBackedTransactionChain() |
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes Transaction Chain.
|
protected abstract DOMStoreThreePhaseCommitCohort |
createCohort(SnapshotBackedWriteTransaction<T> transaction,
org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeModification modification,
Exception operationError)
Create a cohort for driving the transaction through the commit process.
|
protected abstract boolean |
getDebugTransactions()
Inquire as to whether transactions should record their allocation context.
|
DOMStoreReadTransaction |
newReadOnlyTransaction()
Create a new read only transaction which will continue the chain.
|
protected DOMStoreReadTransaction |
newReadOnlyTransaction(T transactionId) |
DOMStoreReadWriteTransaction |
newReadWriteTransaction()
Create a new read write transaction which will continue the chain.
|
protected DOMStoreReadWriteTransaction |
newReadWriteTransaction(T transactionId) |
DOMStoreWriteTransaction |
newWriteOnlyTransaction()
Create a new write-only transaction which will continue the chain.
|
protected DOMStoreWriteTransaction |
newWriteOnlyTransaction(T transactionId) |
protected abstract T |
nextTransactionIdentifier()
Return the next transaction identifier.
|
protected void |
onTransactionCommited(SnapshotBackedWriteTransaction<T> transaction)
Notify the base logic that a previously-submitted transaction has been committed successfully.
|
protected void |
onTransactionFailed(SnapshotBackedWriteTransaction<T> transaction,
Throwable cause)
Notify the base logic that a previously-submitted transaction has failed.
|
protected abstract org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeSnapshot |
takeSnapshot()
Take a fresh
DataTreeSnapshot from the backend. |
protected void |
transactionAborted(SnapshotBackedWriteTransaction<T> tx)
Called when a transaction is closed without being readied.
|
protected DOMStoreThreePhaseCommitCohort |
transactionReady(SnapshotBackedWriteTransaction<T> tx,
org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeModification tree,
Exception readyError)
Returns a commit coordinator associated with supplied transactions.
|
protected AbstractSnapshotBackedTransactionChain()
public final DOMStoreReadTransaction newReadOnlyTransaction()
DOMStoreTransactionChain
DOMStoreTransactionFactory.newReadOnlyTransaction()
and contains merged result of previous one and current state of data store.
Otherwise read-only transaction presents isolated view as if previous read-write
transaction was successful. State which was introduced by other transactions
outside this transaction chain after creation of previous transaction is not visible.newReadOnlyTransaction
in interface DOMStoreTransactionChain
newReadOnlyTransaction
in interface DOMStoreTransactionFactory
protected DOMStoreReadTransaction newReadOnlyTransaction(T transactionId)
public final DOMStoreReadWriteTransaction newReadWriteTransaction()
DOMStoreTransactionChain
If previous write transaction was already commited to data store, new
read-write transaction is same as obtained via DOMStoreTransactionFactory.newReadWriteTransaction()
and contains merged result of previous one and current state of data store.
Otherwise read-write transaction presents isolated view as if previous read-write transaction was successful. State which was introduced by other transactions outside this transaction chain after creation of previous transaction is not visible.
newReadWriteTransaction
in interface DOMStoreTransactionChain
newReadWriteTransaction
in interface DOMStoreTransactionFactory
protected DOMStoreReadWriteTransaction newReadWriteTransaction(T transactionId)
public final DOMStoreWriteTransaction newWriteOnlyTransaction()
DOMStoreTransactionChain
newWriteOnlyTransaction
in interface DOMStoreTransactionChain
newWriteOnlyTransaction
in interface DOMStoreTransactionFactory
protected DOMStoreWriteTransaction newWriteOnlyTransaction(T transactionId)
protected final void transactionAborted(SnapshotBackedWriteTransaction<T> tx)
SnapshotBackedWriteTransaction.TransactionReadyPrototype
transactionAborted
in class SnapshotBackedWriteTransaction.TransactionReadyPrototype<T>
tx
- Transaction which got aborted.protected final DOMStoreThreePhaseCommitCohort transactionReady(SnapshotBackedWriteTransaction<T> tx, org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeModification tree, Exception readyError)
SnapshotBackedWriteTransaction.TransactionReadyPrototype
transactionReady
in class SnapshotBackedWriteTransaction.TransactionReadyPrototype<T>
tx
- Transaction on which ready was invoked.tree
- Modified data tree which has been constructed.readyError
- Any error that has already happened when readying.public final void close()
DOMStoreTransactionChain
Close method of transaction chain does not guarantee that last alocated transaction is ready or was submitted.
close
in interface AutoCloseable
close
in interface DOMStoreTransactionChain
protected final void onTransactionCommited(SnapshotBackedWriteTransaction<T> transaction)
transaction
- Transaction which completed successfully.protected final void onTransactionFailed(SnapshotBackedWriteTransaction<T> transaction, Throwable cause)
transaction
- Transaction which failed.cause
- Failure causeprotected abstract T nextTransactionIdentifier()
protected abstract boolean getDebugTransactions()
protected abstract org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeSnapshot takeSnapshot()
DataTreeSnapshot
from the backend.protected abstract DOMStoreThreePhaseCommitCohort createCohort(SnapshotBackedWriteTransaction<T> transaction, org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeModification modification, Exception operationError)
transaction
- Transaction handlemodification
- DataTreeModification
which needs to be applied to the backendoperationError
- Any previous error that could be reported through three phase commitDOMStoreThreePhaseCommitCohort
cohort.Copyright © 2019 OpenDaylight. All rights reserved.