diff options
Diffstat (limited to 'cps-ri')
-rw-r--r-- | cps-ri/pom.xml | 2 | ||||
-rw-r--r-- | cps-ri/src/main/java/org/onap/cps/ri/CpsDataPersistenceServiceImpl.java | 16 |
2 files changed, 17 insertions, 1 deletions
diff --git a/cps-ri/pom.xml b/cps-ri/pom.xml index bcf6c802de..1ab5920ef4 100644 --- a/cps-ri/pom.xml +++ b/cps-ri/pom.xml @@ -26,7 +26,7 @@ <parent>
<groupId>org.onap.cps</groupId>
<artifactId>cps-parent</artifactId>
- <version>3.5.4-SNAPSHOT</version>
+ <version>3.5.5-SNAPSHOT</version>
<relativePath>../cps-parent/pom.xml</relativePath>
</parent>
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<>(); |