summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Hanrahan <daniel.hanrahan@est.tech>2024-10-16 09:21:31 +0000
committerGerrit Code Review <gerrit@onap.org>2024-10-16 09:21:31 +0000
commit65fce14427d2004cad9d27393411471371cc73f9 (patch)
tree27832f6f8d761af34e9cd69e8c568712d141de6f
parentb442bc6d6833c855fb85f29ccffc775d80cc49a7 (diff)
parent426c879645116e22acce507d8e02866944fa0f1c (diff)
Merge "Added additional logging"
-rw-r--r--cps-ri/src/main/java/org/onap/cps/ri/CpsDataPersistenceServiceImpl.java16
1 files changed, 16 insertions, 0 deletions
diff --git a/cps-ri/src/main/java/org/onap/cps/ri/CpsDataPersistenceServiceImpl.java b/cps-ri/src/main/java/org/onap/cps/ri/CpsDataPersistenceServiceImpl.java
index ee555f7dc8..ecbe447226 100644
--- a/cps-ri/src/main/java/org/onap/cps/ri/CpsDataPersistenceServiceImpl.java
+++ b/cps-ri/src/main/java/org/onap/cps/ri/CpsDataPersistenceServiceImpl.java
@@ -228,6 +228,9 @@ public class CpsDataPersistenceServiceImpl implements CpsDataPersistenceService
final Collection<String> xpaths = xpathToUpdatedDataNode.keySet();
Collection<FragmentEntity> existingFragmentEntities = getFragmentEntities(anchorEntity, xpaths);
+
+ logMissingXPaths(xpaths, existingFragmentEntities);
+
existingFragmentEntities = fragmentRepository.prefetchDescendantsOfFragmentEntities(
FetchDescendantsOption.INCLUDE_ALL_DESCENDANTS, existingFragmentEntities);
@@ -243,6 +246,19 @@ public class CpsDataPersistenceServiceImpl implements CpsDataPersistenceService
}
}
+ private void logMissingXPaths(final Collection<String> xpaths, final Collection<FragmentEntity>
+ existingFragmentEntities) {
+ final Set<String> existingXPaths = existingFragmentEntities.stream().map(FragmentEntity::getXpath)
+ .collect(Collectors.toSet());
+
+ final Set<String> missingXPaths = xpaths.stream().filter(xpath -> !existingXPaths.contains(xpath))
+ .collect(Collectors.toSet());
+
+ if (!missingXPaths.isEmpty()) {
+ log.warn("Cannot update data nodes: Target XPaths {} not found in DB.", missingXPaths);
+ }
+ }
+
private void retryUpdateDataNodesIndividually(final AnchorEntity anchorEntity,
final Collection<FragmentEntity> fragmentEntities) {
final Collection<String> failedXpaths = new HashSet<>();