public class SerializedDOMDataBroker extends AbstractDOMDataBroker
DOMStoreThreePhaseCommitCohort
.
This implementation does not support cancellation of commit,
In order to advance to next phase of three phase commit all subtasks of previous step must be finish.
This executor does not have an upper bound on subtask timeout.
Constructor and Description |
---|
SerializedDOMDataBroker(Map<LogicalDatastoreType,DOMStore> datastores,
com.google.common.util.concurrent.ListeningExecutorService executor)
Construct DOMDataCommitCoordinator which uses supplied executor to
process commit coordinations.
|
Modifier and Type | Method and Description |
---|---|
protected void |
checkNotClosed()
Checks if instance is not closed.
|
protected <T> com.google.common.util.concurrent.ListenableFuture<T> |
commit(DOMDataWriteTransaction transaction,
Collection<DOMStoreThreePhaseCommitCohort> cohorts,
com.google.common.base.Supplier<T> futureValueSupplier)
User-supplied implementation of
AsyncWriteTransaction.commit()
for transaction. |
org.opendaylight.yangtools.util.DurationStatisticsTracker |
getCommitStatsTracker() |
protected Map<LogicalDatastoreType,T> |
getTxFactories()
Convenience accessor of backing factories intended to be used only by
finalization of this class.
|
DOMDataReadOnlyTransaction |
newReadOnlyTransaction()
Creates a new composite read-only transaction
|
DOMDataReadWriteTransaction |
newReadWriteTransaction()
Creates a new composite write-only transaction
|
DOMDataWriteTransaction |
newWriteOnlyTransaction()
Creates a new composite write-only transaction
|
close, createTransactionChain, getSupportedExtensions, newTransactionIdentifier, setCloseable
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
newReadOnlyTransaction, newReadWriteTransaction, newWriteOnlyTransaction
public SerializedDOMDataBroker(Map<LogicalDatastoreType,DOMStore> datastores, com.google.common.util.concurrent.ListeningExecutorService executor)
datastores
- data storesexecutor
- executor servicepublic org.opendaylight.yangtools.util.DurationStatisticsTracker getCommitStatsTracker()
protected <T> com.google.common.util.concurrent.ListenableFuture<T> commit(DOMDataWriteTransaction transaction, Collection<DOMStoreThreePhaseCommitCohort> cohorts, com.google.common.base.Supplier<T> futureValueSupplier)
AsyncWriteTransaction.commit()
for transaction.
Callback invoked when AsyncWriteTransaction.commit()
is invoked
on transaction created by this factory.
transaction
- Transaction on which AsyncWriteTransaction.commit()
was invoked.cohorts
- Iteratable of cohorts for subtransactions associated with
the transaction being committed.TransactionCommitFailedException
.public final DOMDataReadOnlyTransaction newReadOnlyTransaction()
Creates a new composite read-only transaction backed by one transaction
per factory in getTxFactories()
.
Subtransaction for reading is selected by supplied
LogicalDatastoreType
as parameter for
DOMDataReadTransaction.read(LogicalDatastoreType,
org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier)
.
Id of returned transaction is retrieved via
newTransactionIdentifier()
.
public final DOMDataWriteTransaction newWriteOnlyTransaction()
Creates a new composite write-only transaction backed by one write-only
transaction per factory in getTxFactories()
.
Implementation of composite Write-only transaction is following:
DOMDataWriteTransaction.put(LogicalDatastoreType, YangInstanceIdentifier, NormalizedNode)
- backing subtransaction is selected by LogicalDatastoreType
,
DOMStoreWriteTransaction.write(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier,
org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode)
is invoked on selected subtransaction.
DOMDataWriteTransaction.merge(LogicalDatastoreType, YangInstanceIdentifier, NormalizedNode)
- backing subtransaction is selected by LogicalDatastoreType
,
DOMStoreWriteTransaction.merge(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier,
org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode)
is invoked on selected subtransaction.
AsyncWriteTransaction.delete(LogicalDatastoreType, Path)
DOMStoreWriteTransaction.delete(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier)
is
invoked on
selected subtransaction.
AsyncWriteTransaction.commit()
- results in invoking
DOMStoreWriteTransaction.ready()
, gathering all resulting cohorts
and then invoking finalized implementation callback
commit(org.opendaylight.controller.md.sal.dom.api.DOMDataWriteTransaction, java.util.Collection<org.opendaylight.controller.sal.core.spi.data.DOMStoreThreePhaseCommitCohort>, com.google.common.base.Supplier<T>)
with transaction which was commited and gathered results.
Id of returned transaction is generated via
newTransactionIdentifier()
.
public final DOMDataReadWriteTransaction newReadWriteTransaction()
Creates a new composite write-only transaction backed by one write-only transaction per factory in
getTxFactories()
.
Implementation of composite Write-only transaction is following:
DOMDataReadTransaction.read(LogicalDatastoreType,
YangInstanceIdentifier)
- backing subtransaction is selected by LogicalDatastoreType
,
DOMStoreReadTransaction.read(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier)
is invoked
on selected subtransaction.
DOMDataWriteTransaction.put(LogicalDatastoreType,
org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier,
org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode)
- backing subtransaction is selected by LogicalDatastoreType
,
DOMStoreWriteTransaction.write(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier,
org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode)
is invoked on selected subtransaction.
DOMDataWriteTransaction.merge(LogicalDatastoreType,
org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier,
org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode)
- backing subtransaction is selected by LogicalDatastoreType
,
DOMStoreWriteTransaction.merge(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier,
org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode)
is invoked on selected subtransaction.
DOMDataWriteTransaction.delete(LogicalDatastoreType,
org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier)
- backing subtransaction is selected by LogicalDatastoreType
,
DOMStoreWriteTransaction.delete(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier)
is
invoked on
selected subtransaction.
AsyncWriteTransaction.commit()
- results in invoking
DOMStoreWriteTransaction.ready()
, gathering all resulting cohorts
and then invoking finalized implementation callback
commit(org.opendaylight.controller.md.sal.dom.api.DOMDataWriteTransaction, java.util.Collection<org.opendaylight.controller.sal.core.spi.data.DOMStoreThreePhaseCommitCohort>, com.google.common.base.Supplier<T>)
with transaction which was committed and gathered results.
Id of returned transaction is generated via
newTransactionIdentifier()
.
protected final Map<LogicalDatastoreType,T> getTxFactories()
protected final void checkNotClosed()
IllegalStateException
- If instance of this class was closed.Copyright © 2019 OpenDaylight. All rights reserved.