Remove use of {String,UUID}Identifier
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / main / java / org / opendaylight / controller / cluster / datastore / LocalThreePhaseCommitCohort.java
index 569bacceaa8f600f4110ddafb106f34dbccac881..ec7b46d5bbd5ef278489560d534728999820ef65 100644 (file)
@@ -37,7 +37,7 @@ class LocalThreePhaseCommitCohort implements DOMStoreThreePhaseCommitCohort {
     private final DataTreeModification modification;
     private final ActorContext actorContext;
     private final ActorSelection leader;
-    private Exception operationError;
+    private final Exception operationError;
 
     protected LocalThreePhaseCommitCohort(final ActorContext actorContext, final ActorSelection leader,
             final SnapshotBackedWriteTransaction<TransactionIdentifier> transaction, final DataTreeModification modification) {
@@ -45,6 +45,7 @@ class LocalThreePhaseCommitCohort implements DOMStoreThreePhaseCommitCohort {
         this.leader = Preconditions.checkNotNull(leader);
         this.transaction = Preconditions.checkNotNull(transaction);
         this.modification = Preconditions.checkNotNull(modification);
+        this.operationError = null;
     }
 
     protected LocalThreePhaseCommitCohort(final ActorContext actorContext, final ActorSelection leader,
@@ -66,10 +67,6 @@ class LocalThreePhaseCommitCohort implements DOMStoreThreePhaseCommitCohort {
         return actorContext.executeOperationAsync(leader, message, actorContext.getTransactionCommitOperationTimeout());
     }
 
-    void setOperationError(Exception operationError) {
-        this.operationError = operationError;
-    }
-
     Future<ActorSelection> initiateCoordinatedCommit() {
         final Future<Object> messageFuture = initiateCommit(false);
         final Future<ActorSelection> ret = TransactionReadyReplyMapper.transform(messageFuture, actorContext,
@@ -98,7 +95,7 @@ class LocalThreePhaseCommitCohort implements DOMStoreThreePhaseCommitCohort {
                 if (failure != null) {
                     LOG.error("Failed to prepare transaction {} on backend", transaction.getIdentifier(), failure);
                     transactionAborted(transaction);
-                } else if (CommitTransactionReply.SERIALIZABLE_CLASS.isInstance(message)) {
+                } else if (CommitTransactionReply.isSerializedType(message)) {
                     LOG.debug("Transaction {} committed successfully", transaction.getIdentifier());
                     transactionCommitted(transaction);
                 } else {