Add OnDemandShardState to report additional Shard state
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / main / java / org / opendaylight / controller / cluster / datastore / ShardDataTree.java
index fbb48f51011ebb07ad67d09137d365c9b0a781e8..4e9b05ff218d15b52e248e7e67a190bbcc83a669 100644 (file)
@@ -208,7 +208,10 @@ public class ShardDataTree extends ShardDataTreeTransactionParent {
 
         final DataTreeModification unwrapped = unwrap(mod);
         dataTree.validate(unwrapped);
-        dataTree.commit(dataTree.prepare(unwrapped));
+        DataTreeCandidateTip candidate = dataTree.prepare(unwrapped);
+        dataTree.commit(candidate);
+        notifyListeners(candidate);
+
         LOG.debug("{}: state snapshot applied in %s", logContext, elapsed);
     }
 
@@ -357,7 +360,7 @@ public class ShardDataTree extends ShardDataTreeTransactionParent {
 
     private void allMetadataCommittedTransaction(final TransactionIdentifier txId) {
         for (ShardDataTreeMetadata<?> m : metadata) {
-            m.transactionCommitted(txId);
+            m.onTransactionCommitted(txId);
         }
     }
 
@@ -649,6 +652,10 @@ public class ShardDataTree extends ShardDataTreeTransactionParent {
         LOG.debug("{}: Transaction {} submitted to persistence", logContext, txId);
     }
 
+    Collection<ActorRef> getCohortActors() {
+        return cohortRegistry.getCohortActors();
+    }
+
     void processCohortRegistryCommand(final ActorRef sender, final CohortRegistryCommand message) {
         cohortRegistry.process(sender, message);
     }