From 873d6892fc66d2efb3cc2b3cc10807db47bcaffa Mon Sep 17 00:00:00 2001 From: Fiete Ostkamp Date: Mon, 17 Jun 2024 09:27:21 +0200 Subject: Update aai-common to 1.14.1 in traversal - includes tinkerpop update from 3.3.0 to 3.3.11 - update guava from 18 to 25.0-jre - resolve maven build warnings (undeclared dep versions, duplicate deps, reporting configuration) Issue-ID: AAI-3879 Change-Id: I60124c42ca1a0c884c02981a18c1c9388e62b6e2 Signed-off-by: Fiete Ostkamp --- aai-traversal/pom.xml | 47 +++++++++------------- .../onap/aai/dbgraphgen/ModelBasedProcessing.java | 39 +++++++++++++----- 2 files changed, 47 insertions(+), 39 deletions(-) (limited to 'aai-traversal') diff --git a/aai-traversal/pom.xml b/aai-traversal/pom.xml index 5544ae7..69f42ff 100644 --- a/aai-traversal/pom.xml +++ b/aai-traversal/pom.xml @@ -26,7 +26,7 @@ org.onap.aai.traversal traversal - 1.14.0-SNAPSHOT + 1.14.1-SNAPSHOT org.onap.aai.traversal aai-traversal @@ -43,17 +43,17 @@ - docker.io - localhost:5000 1.0.0 - ${project.build.directory}/${project.artifactId}-${project.version}-build/ 1.0.0 @@ -61,14 +61,14 @@ alpine 1.13.4 - https://nexus.onap.org /content/sites/site/org/onap/aai/traversal/${project.artifactId}/${project.version} /content/repositories/releases/ /content/repositories/snapshots/ - yyyyMMdd'T'HHmmss'Z' @@ -91,7 +91,7 @@ v29 v10,v11,v12,v13,v14,v15,v16,v17,v18,v19,v20,v21,v22,v23,v24,v25,v26,v27,v28,v29 /aai - + 2.4.13 5.3.13 @@ -115,7 +115,7 @@ true - docker @@ -559,8 +559,8 @@ com.jayway.jsonpath json-path - org.apache.activemq @@ -618,7 +618,7 @@ - @@ -646,10 +646,10 @@ - org.springframework.security @@ -808,13 +808,10 @@ pom import - com.google.guava guava - 19.0 + 25.0-jre @@ -992,16 +989,13 @@ exec-maven-plugin org.codehaus.mojo + 1.6.0 org.apache.maven.plugins maven-javadoc-plugin + 2.10.4 - - com.mycila - license-maven-plugin - - org.apache.maven.plugins maven-surefire-plugin @@ -1009,12 +1003,10 @@ alphabetical - org.codehaus.groovy.maven gmaven-plugin - org.antlr antlr4-maven-plugin @@ -1071,7 +1063,6 @@ - maven-assembly-plugin diff --git a/aai-traversal/src/main/java/org/onap/aai/dbgraphgen/ModelBasedProcessing.java b/aai-traversal/src/main/java/org/onap/aai/dbgraphgen/ModelBasedProcessing.java index aa4fdad..005d3dc 100644 --- a/aai-traversal/src/main/java/org/onap/aai/dbgraphgen/ModelBasedProcessing.java +++ b/aai-traversal/src/main/java/org/onap/aai/dbgraphgen/ModelBasedProcessing.java @@ -26,6 +26,8 @@ import com.google.common.util.concurrent.TimeLimiter; import com.google.common.util.concurrent.UncheckedTimeoutException; import java.util.*; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.Executors; import java.util.concurrent.TimeUnit; import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal; @@ -44,6 +46,8 @@ import org.onap.aai.introspection.Introspector; import org.onap.aai.introspection.Loader; import org.onap.aai.introspection.exceptions.AAIUnknownObjectException; import org.onap.aai.logging.ErrorLogHelper; +import org.onap.aai.parsers.exceptions.AAIIdentityMapParseException; +import org.onap.aai.parsers.exceptions.AmbiguousMapAAIException; import org.onap.aai.query.builder.QueryBuilder; import org.onap.aai.schema.enums.PropertyMetadata; import org.onap.aai.serialization.db.DBSerializer; @@ -380,7 +384,7 @@ public class ModelBasedProcessing { } List resultList = new ArrayList<>(); - TimeLimiter limiter = new SimpleTimeLimiter(); + TimeLimiter limiter = SimpleTimeLimiter.create(Executors.newCachedThreadPool()); try { resultList = limiter.callWithTimeout(new AaiCallable>() { @@ -389,10 +393,17 @@ public class ModelBasedProcessing { modelInvId_f, modelName_f, topNodeType_f, startNodeFilterArrayOfHashes_f, apiVer_f); } - }, timeLimitSec, TimeUnit.SECONDS, true); - } catch (AAIException ae) { - // Re-throw AAIException so we get can tell what happened internally - throw ae; + }, timeLimitSec, TimeUnit.SECONDS); + } catch (ExecutionException ex) { + if(ex.getCause() instanceof AAIIdentityMapParseException) { + throw (AAIIdentityMapParseException) ex.getCause(); + } + if(ex.getCause() instanceof AmbiguousMapAAIException) { + throw (AmbiguousMapAAIException) ex.getCause(); + } + if(ex.getCause() instanceof AAIException) { + throw (AAIException) ex.getCause(); + } } catch (UncheckedTimeoutException ute) { throw new AAIException("AAI_6140", "Query Processing Limit exceeded. (limit = " + timeLimitSec + " seconds)"); @@ -1036,7 +1047,7 @@ public class ModelBasedProcessing { } List resultList = new ArrayList<>(); - TimeLimiter limiter = new SimpleTimeLimiter(); + TimeLimiter limiter = SimpleTimeLimiter.create(Executors.newCachedThreadPool()); try { resultList = limiter.callWithTimeout(new AaiCallable>() { public List process() throws AAIException { @@ -1044,11 +1055,17 @@ public class ModelBasedProcessing { startNodeFilterArrayOfHashes_f, apiVer_f, secondaryFilterCutPoint_f, secondaryFilterHash_f); } - }, timeLimitSec, TimeUnit.SECONDS, true); - - } catch (AAIException ae) { - // Re-throw AAIException so we get can tell what happened internally - throw ae; + }, timeLimitSec, TimeUnit.SECONDS); + } catch (ExecutionException ex) { + if(ex.getCause() instanceof AAIIdentityMapParseException) { + throw (AAIIdentityMapParseException) ex.getCause(); + } + if(ex.getCause() instanceof AmbiguousMapAAIException) { + throw (AmbiguousMapAAIException) ex.getCause(); + } + if(ex.getCause() instanceof AAIException) { + throw (AAIException) ex.getCause(); + } } catch (UncheckedTimeoutException ute) { throw new AAIException("AAI_6140", "Query Processing Limit exceeded. (limit = " + timeLimitSec + " seconds)"); -- cgit 1.2.3-korg