Update janusgraph to 0.3.3 76/137476/7
authorFiete Ostkamp <Fiete.Ostkamp@telekom.de>
Wed, 6 Mar 2024 06:56:05 +0000 (07:56 +0100)
committerFiete Ostkamp <Fiete.Ostkamp@telekom.de>
Tue, 4 Jun 2024 14:43:22 +0000 (16:43 +0200)
- update tinkerpop version from 3.2.11 to 3.3.0
- update janusgraph from 0.2.3 to 0.3.3
- the default GraphSON version would change with this update but was held back [1]
- add jackson-dataformat-xml dependency to aai-core as the XmlMapper is used in the ErrorLogHelper

[1] a separate story AAI-3796 - Use GraphSON v2 or v3 in AAI has been created for this

Issue-ID: AAI-3795
Change-Id: I4539e83aa74c260d5238ebe869e9884d4396e9f4
Signed-off-by: Fiete Ostkamp <Fiete.Ostkamp@telekom.de>
26 files changed:
aai-aaf-auth/pom.xml
aai-annotations/pom.xml
aai-auth/pom.xml
aai-common-docker/aai-common-images/pom.xml
aai-common-docker/aai-haproxy-image/pom.xml
aai-common-docker/pom.xml
aai-core/pom.xml
aai-core/src/main/java/org/onap/aai/dbgen/GraphSONPartialIO.java
aai-core/src/main/java/org/onap/aai/dbmap/AAIGraph.java
aai-core/src/main/java/org/onap/aai/query/builder/GraphTraversalBuilder.java
aai-core/src/main/java/org/onap/aai/query/builder/GremlinQueryBuilder.java
aai-core/src/main/java/org/onap/aai/query/builder/QueryBuilder.java
aai-core/src/main/java/org/onap/aai/restcore/search/AAIAbstractGroovyShell.java
aai-core/src/main/java/org/onap/aai/serialization/queryformats/GraphSON.java
aai-core/src/test/java/org/onap/aai/TinkerpopUpgradeTests.java
aai-core/src/test/java/org/onap/aai/db/DbMethHelperTest.java
aai-els-onap-logging/pom.xml
aai-failover/pom.xml
aai-parent/pom.xml
aai-rest/pom.xml
aai-schema-abstraction/pom.xml
aai-schema-ingest/pom.xml
aai-schema-ingest/src/main/java/org/onap/aai/nodes/NodeIngestor.java
aai-utils/pom.xml
pom.xml
version.properties

index 0fa1e8c..f0ef4a9 100644 (file)
@@ -6,7 +6,7 @@
     <parent>
         <groupId>org.onap.aai.aai-common</groupId>
         <artifactId>aai-parent</artifactId>
-        <version>1.13.6-SNAPSHOT</version>
+        <version>1.14.0-SNAPSHOT</version>
         <relativePath>../aai-parent/pom.xml</relativePath>
     </parent>
     <artifactId>aai-aaf-auth</artifactId>
index cae569d..7f92056 100644 (file)
@@ -27,7 +27,7 @@
     <parent>
         <groupId>org.onap.aai.aai-common</groupId>
         <artifactId>aai-parent</artifactId>
-        <version>1.13.6-SNAPSHOT</version>
+        <version>1.14.0-SNAPSHOT</version>
         <relativePath>../aai-parent/pom.xml</relativePath>
     </parent>
     <artifactId>aai-annotations</artifactId>
index 7ff240b..5de5805 100644 (file)
@@ -27,7 +27,7 @@
     <parent>
         <groupId>org.onap.aai.aai-common</groupId>
         <artifactId>aai-parent</artifactId>
-        <version>1.13.6-SNAPSHOT</version>
+        <version>1.14.0-SNAPSHOT</version>
         <relativePath>../aai-parent/pom.xml</relativePath>
     </parent>
     <artifactId>aai-auth</artifactId>
index 1695edb..a4d4cd7 100644 (file)
     <parent>
         <groupId>org.onap.aai.aai-common</groupId>
         <artifactId>aai-common-docker</artifactId>
-        <version>1.13.6-SNAPSHOT</version>
+        <version>1.14.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>aai-common-images</artifactId>
-    <version>1.13.6-SNAPSHOT</version>
+    <version>1.14.0-SNAPSHOT</version>
     <packaging>pom</packaging>
     <name>aai-aai-common-images</name>
     <description>Contains dockerfiles for aai-common images (alpine and ubuntu based).</description>
index 5f43948..df458ad 100644 (file)
     <parent>
         <groupId>org.onap.aai.aai-common</groupId>
         <artifactId>aai-common-docker</artifactId>
-        <version>1.13.6-SNAPSHOT</version>
+        <version>1.14.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>aai-haproxy-image</artifactId>
-    <version>1.13.6-SNAPSHOT</version>
+    <version>1.14.0-SNAPSHOT</version>
     <packaging>pom</packaging>
     <name>aai-aai-haproxy-image</name>
     <description>Contains dockerfiles for aai-haproxy image.</description>
index 5c0298b..bdf6721 100644 (file)
@@ -26,7 +26,7 @@
     <parent>
         <groupId>org.onap.aai.aai-common</groupId>
         <artifactId>aai-parent</artifactId>
-        <version>1.13.6-SNAPSHOT</version>
+        <version>1.14.0-SNAPSHOT</version>
         <relativePath>../aai-parent/pom.xml</relativePath>
     </parent>
 
index b9814e8..047e3af 100644 (file)
@@ -26,7 +26,7 @@ limitations under the License.
        <parent>
                <groupId>org.onap.aai.aai-common</groupId>
                <artifactId>aai-parent</artifactId>
-               <version>1.13.6-SNAPSHOT</version>
+               <version>1.14.0-SNAPSHOT</version>
                <relativePath>../aai-parent/pom.xml</relativePath>
        </parent>
        <artifactId>aai-core</artifactId>
@@ -396,6 +396,10 @@ limitations under the License.
                        <groupId>com.fasterxml.jackson.core</groupId>
                        <artifactId>jackson-annotations</artifactId>
                </dependency>
+               <dependency>
+                       <groupId>com.fasterxml.jackson.dataformat</groupId>
+                       <artifactId>jackson-dataformat-xml</artifactId>
+               </dependency>
                <dependency>
                        <groupId>com.fasterxml.jackson.dataformat</groupId>
                        <artifactId>jackson-dataformat-yaml</artifactId>
index 6c2eee1..c097a5b 100644 (file)
@@ -129,16 +129,6 @@ public final class GraphSONPartialIO
             this.version = version;
         }
 
-        /**
-         * @deprecated As of release 3.2.2, replaced by {@link #onMapper(Consumer)}.
-         */
-        @Deprecated
-        @Override
-        public Io.Builder<GraphSONPartialIO> registry(final IoRegistry registry) {
-            this.registry = registry;
-            return this;
-        }
-
         @Override
         public Io.Builder<? extends Io> onMapper(final Consumer<Mapper.Builder> onMapper) {
             this.onMapper = onMapper;
index d9994f5..15f57c1 100644 (file)
@@ -70,6 +70,7 @@ public class AAIGraph {
             }
             this.loadGraph(rtConfig, serviceName);
         } catch (Exception e) {
+            logger.error("Failed to instantiate graph", e);
             throw new RuntimeException("Failed to instantiate graphs", e);
         }
     }
index c5c4512..24e5ec8 100644 (file)
@@ -34,7 +34,7 @@ import java.util.Set;
 
 import org.apache.tinkerpop.gremlin.process.traversal.P;
 import org.apache.tinkerpop.gremlin.process.traversal.Path;
-import org.apache.tinkerpop.gremlin.process.traversal.Step;
+import org.apache.tinkerpop.gremlin.process.traversal.Pop;
 import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
 import org.apache.tinkerpop.gremlin.process.traversal.Traversal.Admin;
 import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal;
@@ -688,6 +688,15 @@ public abstract class GraphTraversalBuilder<E> extends QueryBuilder<E> {
         return this;
     }
 
+    @Override
+    public QueryBuilder<E> select(Pop pop, String name) {
+        this.traversal.select(pop, name);
+
+        stepIndex++;
+
+        return this;
+    }
+
     @Override
     public QueryBuilder<E> select(String... names) {
         if (names.length == 1) {
index 4500a47..db1c78a 100644 (file)
@@ -29,6 +29,7 @@ import com.google.common.collect.Multimap;
 import java.util.*;
 
 import org.apache.tinkerpop.gremlin.process.traversal.Path;
+import org.apache.tinkerpop.gremlin.process.traversal.Pop;
 import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal;
 import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource;
 import org.apache.tinkerpop.gremlin.process.traversal.step.util.Tree;
@@ -827,6 +828,14 @@ public abstract class GremlinQueryBuilder<E> extends QueryBuilder<E> {
         return this;
     }
 
+    @Override
+    public QueryBuilder<E> select(Pop pop, String name) {
+        this.list.add(".select(Pop." + pop.toString() + ",'" + name + "')");
+        stepIndex++;
+
+        return this;
+    }
+
     @Override
     public QueryBuilder<E> select(String... names) {
         String stepString = ".select('";
index 6653252..309ffa1 100644 (file)
@@ -31,6 +31,7 @@ import java.util.Map;
 import javax.ws.rs.core.MultivaluedMap;
 
 import org.apache.tinkerpop.gremlin.process.traversal.Path;
+import org.apache.tinkerpop.gremlin.process.traversal.Pop;
 import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource;
 import org.apache.tinkerpop.gremlin.process.traversal.step.util.Tree;
 import org.apache.tinkerpop.gremlin.structure.Edge;
@@ -704,6 +705,8 @@ public abstract class QueryBuilder<E> implements Iterator<E> {
 
     public abstract QueryBuilder<E> select(String name);
 
+    public abstract QueryBuilder<E> select(Pop pop, String name);
+
     public abstract QueryBuilder<E> select(String... names);
 
     public abstract QueryBuilder<E> until(QueryBuilder<E> builder);
index 4a8760e..f63df4b 100644 (file)
@@ -59,7 +59,7 @@ public abstract class AAIAbstractGroovyShell {
                 "org.apache.tinkerpop.gremlin.process.traversal.Order");
         imports.addImports("org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__",
                 "org.apache.tinkerpop.gremlin.structure.T", "org.apache.tinkerpop.gremlin.process.traversal.P",
-                "org.onap.aai.edges.enums.EdgeType", "java.util.Map.Entry");
+                "org.onap.aai.edges.enums.EdgeType", "java.util.Map.Entry","org.apache.tinkerpop.gremlin.process.traversal.Pop");
         imports.addStarImports("java.util");
         CompilerConfiguration config = new CompilerConfiguration();
         config.addCompilationCustomizers(custom, imports);
index c0ba860..89970e2 100644 (file)
@@ -36,6 +36,7 @@ import java.util.Optional;
 import org.apache.tinkerpop.gremlin.structure.Direction;
 import org.apache.tinkerpop.gremlin.structure.Vertex;
 import org.apache.tinkerpop.gremlin.structure.io.graphson.GraphSONMapper;
+import org.apache.tinkerpop.gremlin.structure.io.graphson.GraphSONVersion;
 import org.apache.tinkerpop.gremlin.structure.io.graphson.GraphSONWriter;
 import org.janusgraph.graphdb.tinkerpop.JanusGraphIoRegistry;
 import org.onap.aai.serialization.queryformats.exceptions.AAIFormatQueryResultFormatNotSupported;
@@ -47,8 +48,13 @@ public class GraphSON implements FormatMapper {
 
     private static final Logger logger = LoggerFactory.getLogger(GraphSON.class);
 
+    // TODO: Use v2 or v3 here
+    // v2 is the default starting from Janusgraph 0.3.0
+    // Further reference: https://tinkerpop.apache.org/docs/3.3.0/dev/io/#graphson
+    private static final GraphSONVersion version = GraphSONVersion.V1_0;
+
     private final GraphSONMapper mapper =
-            GraphSONMapper.build().addRegistry(JanusGraphIoRegistry.getInstance()).create();
+            GraphSONMapper.build().version(version).addRegistry(JanusGraphIoRegistry.getInstance()).create();
     private final GraphSONWriter writer = GraphSONWriter.build().mapper(mapper).create();
 
     @Override
index 799f606..f443b30 100644 (file)
@@ -24,6 +24,7 @@ import org.junit.experimental.categories.Categories;
 import org.junit.experimental.categories.Categories.IncludeCategory;
 import org.junit.runner.RunWith;
 import org.junit.runners.Suite.SuiteClasses;
+import org.onap.aai.db.DbMethHelperTest;
 import org.onap.aai.introspection.sideeffect.DataLinkTest;
 import org.onap.aai.parsers.query.GraphTraversalTest;
 import org.onap.aai.query.builder.TraversalQueryTest;
@@ -45,7 +46,8 @@ import org.onap.aai.query.builder.TraversalURIOptimizedQueryTest;
     DataLinkTest.class,
     GraphTraversalTest.class,
     TraversalQueryTest.class,
-    TraversalURIOptimizedQueryTest.class
+    TraversalURIOptimizedQueryTest.class,
+    DbMethHelperTest.class
 })
 public class TinkerpopUpgradeTests {
 }
index 16faa5f..c79b914 100644 (file)
@@ -36,6 +36,7 @@ import org.apache.commons.io.IOUtils;
 import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource;
 import org.apache.tinkerpop.gremlin.structure.Graph;
 import org.apache.tinkerpop.gremlin.structure.Vertex;
+import org.apache.tinkerpop.gremlin.structure.VertexProperty;
 import org.janusgraph.core.JanusGraphFactory;
 import org.junit.After;
 import org.junit.AfterClass;
@@ -44,10 +45,12 @@ import org.junit.Before;
 import org.junit.BeforeClass;
 import org.junit.Rule;
 import org.junit.Test;
+import org.junit.experimental.categories.Category;
 import org.junit.rules.ExpectedException;
 import org.junit.runner.RunWith;
 import org.junit.runners.Parameterized;
 import org.onap.aai.AAISetup;
+import org.onap.aai.TinkerpopUpgrade;
 import org.onap.aai.exceptions.AAIException;
 import org.onap.aai.introspection.Introspector;
 import org.onap.aai.introspection.Loader;
@@ -62,6 +65,7 @@ import org.onap.aai.setup.SchemaVersion;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.test.annotation.DirtiesContext;
 
+@Category(TinkerpopUpgrade.class)
 @RunWith(value = Parameterized.class)
 @DirtiesContext(classMode = DirtiesContext.ClassMode.BEFORE_CLASS)
 public class DbMethHelperTest extends AAISetup {
@@ -127,12 +131,10 @@ public class DbMethHelperTest extends AAISetup {
         map.put("pserver.hostname", "testSearchVertexByIdentityMap-pserver-hostname-01");
 
         Optional<Vertex> optionalVertex;
-        try {
-            optionalVertex = dbMethHelper.searchVertexByIdentityMap(type, map);
-        } catch (Exception e) {
-            throw new Exception(e);
-        }
-        Assert.assertEquals("vp[hostname->testSearchVertexById]", optionalVertex.get().property("hostname").toString());
+        optionalVertex = dbMethHelper.searchVertexByIdentityMap(type, map);
+
+        String hostname = (String) optionalVertex.get().property("hostname").value();
+        Assert.assertEquals("testSearchVertexByIdentityMap-pserver-hostname-01", hostname);
     }
 
     @Test(expected = AmbiguousMapAAIException.class)
index aa0782b..8188d56 100644 (file)
@@ -4,7 +4,7 @@
     <parent>
         <groupId>org.onap.aai.aai-common</groupId>
         <artifactId>aai-parent</artifactId>
-        <version>1.13.6-SNAPSHOT</version>
+        <version>1.14.0-SNAPSHOT</version>
         <relativePath>../aai-parent/pom.xml</relativePath>
     </parent>
     <artifactId>aai-els-onap-logging</artifactId>
index 1206bdd..9395354 100644 (file)
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.onap.aai.aai-common</groupId>
         <artifactId>aai-parent</artifactId>
-        <version>1.13.6-SNAPSHOT</version>
+        <version>1.14.0-SNAPSHOT</version>
         <relativePath>../aai-parent/pom.xml</relativePath>
     </parent>
     <modelVersion>4.0.0</modelVersion>
index 25ca2a9..2fd8e88 100644 (file)
@@ -27,7 +27,7 @@ limitations under the License.
   <parent>
     <groupId>org.onap.aai.aai-common</groupId>
     <artifactId>aai-common</artifactId>
-    <version>1.13.6-SNAPSHOT</version>
+    <version>1.14.0-SNAPSHOT</version>
   </parent>
   <artifactId>aai-parent</artifactId>
   <name>aai-parent</name>
@@ -62,13 +62,13 @@ limitations under the License.
     <eelf.core.version>2.0.0-oss</eelf.core.version>
     <freemarker.version>2.3.31</freemarker.version>
     <google.guava.version>31.1-jre</google.guava.version>
-    <gremlin.version>3.2.11</gremlin.version>
+    <gremlin.version>3.3.0</gremlin.version>
+    <janusgraph.version>0.3.3</janusgraph.version>
     <groovy.version>2.5.15</groovy.version>
     <gson.version>2.9.1</gson.version>
     <hamcrest.junit.version>2.0.0.0</hamcrest.junit.version>
     <hamcrest.core.version>2.2</hamcrest.core.version>
     <jackson.bom.version>2.11.4</jackson.bom.version>
-    <janusgraph.version>0.2.3</janusgraph.version>
     <javatuples.version>1.2</javatuples.version>
     <jaxb.version>2.3.1</jaxb.version>
     <old.jaxb.version>2.3.0.1</old.jaxb.version>
index 9e8697e..a86ad18 100644 (file)
@@ -29,7 +29,7 @@
     <parent>
         <groupId>org.onap.aai.aai-common</groupId>
         <artifactId>aai-parent</artifactId>
-        <version>1.13.6-SNAPSHOT</version>
+        <version>1.14.0-SNAPSHOT</version>
         <relativePath>../aai-parent/pom.xml</relativePath>
     </parent>
     <artifactId>aai-rest</artifactId>
index a0dc76c..76d4832 100644 (file)
@@ -28,7 +28,7 @@
   <parent>
     <groupId>org.onap.aai.aai-common</groupId>
     <artifactId>aai-parent</artifactId>
-    <version>1.13.6-SNAPSHOT</version>
+    <version>1.14.0-SNAPSHOT</version>
     <relativePath>../aai-parent/pom.xml</relativePath>
   </parent>
 
index dd83c92..ef9793a 100644 (file)
@@ -26,7 +26,7 @@ limitations under the License.
        <parent>
                <groupId>org.onap.aai.aai-common</groupId>
                <artifactId>aai-parent</artifactId>
-               <version>1.13.6-SNAPSHOT</version>
+               <version>1.14.0-SNAPSHOT</version>
                <relativePath>../aai-parent/pom.xml</relativePath>
        </parent>
        <artifactId>aai-schema-ingest</artifactId>
index a3d477e..cf27806 100644 (file)
@@ -140,6 +140,7 @@ public class NodeIngestor {
                 schemaPerVersion.put(version, createCombinedSchema(inputStreams, version, retrieveLocalSchema));
             }
         } catch (JAXBException | ParserConfigurationException | SAXException | IOException e) {
+            LOGGER.error("Schema ingestion failed", e);
             throw new ExceptionInInitializerError(e);
         }
     }
index 68dc4dc..cf682ed 100644 (file)
@@ -27,7 +27,7 @@
     <parent>
         <groupId>org.onap.aai.aai-common</groupId>
         <artifactId>aai-parent</artifactId>
-        <version>1.13.6-SNAPSHOT</version>
+        <version>1.14.0-SNAPSHOT</version>
         <relativePath>../aai-parent/pom.xml</relativePath>
     </parent>
     <artifactId>aai-utils</artifactId>
diff --git a/pom.xml b/pom.xml
index 1aba075..5f3b231 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -30,7 +30,7 @@
 
     <groupId>org.onap.aai.aai-common</groupId>
     <artifactId>aai-common</artifactId>
-    <version>1.13.6-SNAPSHOT</version>
+    <version>1.14.0-SNAPSHOT</version>
     <packaging>pom</packaging>
     <name>aai-aai-common</name>
     <description>Contains all of the common code for resources and traversal repos</description>
index 53fad52..5dfb2dd 100644 (file)
@@ -4,8 +4,8 @@
 # because they are used in Jenkins, whose plug-in doesn't support
 
 major_version=1
-minor_version=13
-patch_version=6
+minor_version=14
+patch_version=0
 
 base_version=${major_version}.${minor_version}.${patch_version}