Harden ShardCommitCoordinator to survive EOS write retries
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / main / java / org / opendaylight / controller / cluster / datastore / CohortEntry.java
index 3d5238ee77812eed4190017d7d7a1289887875dd..5e5d0f16cd220759c7ad3d1a99dfa8e6c8f61f06 100644 (file)
@@ -32,6 +32,7 @@ final class CohortEntry {
     private Shard shard;
 
     private CohortEntry(final ReadWriteShardDataTreeTransaction transaction, final short clientVersion) {
+        this.cohort = null;
         this.transaction = Preconditions.checkNotNull(transaction);
         this.transactionId = transaction.getIdentifier();
         this.clientVersion = clientVersion;
@@ -122,6 +123,10 @@ final class CohortEntry {
         }
     }
 
+    boolean isSealed() {
+        return cohort != null;
+    }
+
     Optional<SortedSet<String>> getParticipatingShardNames() {
         return cohort != null ? cohort.getParticipatingShardNames() : Optional.empty();
     }