import akka.actor.ActorSelection;
import com.google.common.base.Preconditions;
-import org.opendaylight.controller.cluster.datastore.identifiers.TransactionIdentifier;
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
+import org.opendaylight.controller.cluster.access.concepts.TransactionIdentifier;
import org.opendaylight.controller.cluster.datastore.utils.ActorContext;
import org.opendaylight.controller.sal.core.spi.data.DOMStoreReadTransaction;
import org.opendaylight.controller.sal.core.spi.data.DOMStoreReadWriteTransaction;
}
@Override
- protected DOMStoreThreePhaseCommitCohort transactionReady(final SnapshotBackedWriteTransaction<TransactionIdentifier> tx,
- final DataTreeModification tree) {
+ protected DOMStoreThreePhaseCommitCohort transactionReady(
+ final SnapshotBackedWriteTransaction<TransactionIdentifier> tx, final DataTreeModification tree) {
return new LocalThreePhaseCommitCohort(actorContext, leader, tx, tree);
}
- @SuppressWarnings("unchecked")
+ @SuppressWarnings({"unchecked", "checkstyle:IllegalCatch"})
@Override
- public LocalThreePhaseCommitCohort onTransactionReady(DOMStoreWriteTransaction tx) {
+ public LocalThreePhaseCommitCohort onTransactionReady(@Nonnull DOMStoreWriteTransaction tx,
+ @Nullable Exception operationError) {
+ Preconditions.checkArgument(tx instanceof SnapshotBackedWriteTransaction);
+ if (operationError != null) {
+ return new LocalThreePhaseCommitCohort(actorContext, leader,
+ (SnapshotBackedWriteTransaction<TransactionIdentifier>)tx, operationError);
+ }
+
try {
return (LocalThreePhaseCommitCohort) tx.ready();
} catch (Exception e) {