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);
}
} else if (payload instanceof DataTreeCandidatePayload) {
applyRecoveryCandidate(((DataTreeCandidatePayload) payload).getCandidate());
} else {
- LOG.warn("{}: ignoring unhandled payload {}", logContext, payload);
+ LOG.debug("{}: ignoring unhandled payload {}", logContext, payload);
}
}
return ensureTransactionChain(txId.getHistoryId()).newReadWriteTransaction(txId);
}
+ @VisibleForTesting
public void notifyListeners(final DataTreeCandidate candidate) {
treeChangeListenerPublisher.publishChanges(candidate, logContext);
dataChangeListenerPublisher.publishChanges(candidate, logContext);
return dataTree.takeSnapshot().readNode(path);
}
- public DataTreeSnapshot takeSnapshot() {
+ DataTreeSnapshot takeSnapshot() {
return dataTree.takeSnapshot();
}
+ @VisibleForTesting
public DataTreeModification newModification() {
return dataTree.takeSnapshot().newModification();
}