X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-distributed-datastore%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fdatastore%2FLocalFrontendHistory.java;h=17e861a3e7252a9c269801bc00a2ebe9ec31d66b;hp=94c0965c007178828cdc04cdeea3170962abdbf8;hb=bdce894fa73714aa9f68eadad3524cfc94dc71d2;hpb=2634ed7138a343f051ff6452ccc7edd3abfc0c3a diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/LocalFrontendHistory.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/LocalFrontendHistory.java index 94c0965c00..17e861a3e7 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/LocalFrontendHistory.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/LocalFrontendHistory.java @@ -14,8 +14,9 @@ import com.google.common.collect.TreeRangeSet; import com.google.common.primitives.UnsignedLong; import java.util.HashMap; import java.util.Map; +import java.util.Optional; +import java.util.SortedSet; import org.opendaylight.controller.cluster.access.concepts.LocalHistoryIdentifier; -import org.opendaylight.controller.cluster.access.concepts.RequestException; import org.opendaylight.controller.cluster.access.concepts.TransactionIdentifier; import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeModification; @@ -36,9 +37,8 @@ final class LocalFrontendHistory extends AbstractFrontendHistory { } static LocalFrontendHistory create(final String persistenceId, final ShardDataTree tree, - final LocalHistoryIdentifier historyId) { - return new LocalFrontendHistory(persistenceId, tree, tree.ensureTransactionChain(historyId), ImmutableMap.of(), - TreeRangeSet.create()); + final ShardDataTreeTransactionChain chain) { + return new LocalFrontendHistory(persistenceId, tree, chain, ImmutableMap.of(), TreeRangeSet.create()); } static LocalFrontendHistory recreate(final String persistenceId, final ShardDataTree tree, @@ -54,23 +54,29 @@ final class LocalFrontendHistory extends AbstractFrontendHistory { } @Override - FrontendTransaction createOpenSnapshot(final TransactionIdentifier id) throws RequestException { + FrontendTransaction createOpenSnapshot(final TransactionIdentifier id) { return FrontendReadOnlyTransaction.create(this, chain.newReadOnlyTransaction(id)); } @Override - FrontendTransaction createOpenTransaction(final TransactionIdentifier id) throws RequestException { + FrontendTransaction createOpenTransaction(final TransactionIdentifier id) { return FrontendReadWriteTransaction.createOpen(this, chain.newReadWriteTransaction(id)); } @Override - FrontendTransaction createReadyTransaction(final TransactionIdentifier id, final DataTreeModification mod) - throws RequestException { + FrontendTransaction createReadyTransaction(final TransactionIdentifier id, final DataTreeModification mod) { return FrontendReadWriteTransaction.createReady(this, id, mod); } @Override - ShardDataTreeCohort createReadyCohort(final TransactionIdentifier id, final DataTreeModification mod) { - return chain.createReadyCohort(id, mod); + ShardDataTreeCohort createFailedCohort(final TransactionIdentifier id, final DataTreeModification mod, + final Exception failure) { + return chain.createFailedCohort(id, mod, failure); + } + + @Override + ShardDataTreeCohort createReadyCohort(final TransactionIdentifier id, final DataTreeModification mod, + final Optional> participatingShardNames) { + return chain.createReadyCohort(id, mod, participatingShardNames); } }