-
- // There should only be one candidate reported
- Preconditions.checkState(changes.size() == 1);
-
- lastNotifTimestamp.set(System.nanoTime());
-
- // do not log the change into debug, only use trace since it will lead to OOM on default heap settings
- LOG.debug("Received data tree changed");
-
- changes.forEach(change -> {
- if (change.getRootNode().getDataAfter().isPresent()) {
- LOG.trace("Received change, data before: {}, data after: {}",
- change.getRootNode().getDataBefore().isPresent()
- ? change.getRootNode().getDataBefore().get() : "",
- change.getRootNode().getDataAfter().get());
-
- if (localCopy == null || checkEqual(change.getRootNode().getDataBefore().get())) {
- localCopy = change.getRootNode().getDataAfter().get();
- } else {
- LOG.warn("Ignoring notification.");
- LOG.trace("Ignored notification content: {}", change);
- }
- } else {
- LOG.warn("getDataAfter() is missing from notification. change: {}", change);
- }
- });