diff options
author | Fiete Ostkamp <Fiete.Ostkamp@telekom.de> | 2024-03-06 07:56:05 +0100 |
---|---|---|
committer | Fiete Ostkamp <Fiete.Ostkamp@telekom.de> | 2024-06-04 16:43:22 +0200 |
commit | 9034ac68d20e1cb9f9aeda9ed8445023fca92527 (patch) | |
tree | d8520cd4ddd128b5bda15284680a2af84d14eebc | |
parent | 17cf0fc2bd8ead53beadafe0fda7605fbb27f618 (diff) |
Update janusgraph to 0.3.3
- 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, 68 insertions, 41 deletions
diff --git a/aai-aaf-auth/pom.xml b/aai-aaf-auth/pom.xml index 0fa1e8c8..f0ef4a96 100644 --- a/aai-aaf-auth/pom.xml +++ b/aai-aaf-auth/pom.xml @@ -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> diff --git a/aai-annotations/pom.xml b/aai-annotations/pom.xml index cae569de..7f92056d 100644 --- a/aai-annotations/pom.xml +++ b/aai-annotations/pom.xml @@ -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> diff --git a/aai-auth/pom.xml b/aai-auth/pom.xml index 7ff240b9..5de5805a 100644 --- a/aai-auth/pom.xml +++ b/aai-auth/pom.xml @@ -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> diff --git a/aai-common-docker/aai-common-images/pom.xml b/aai-common-docker/aai-common-images/pom.xml index 1695edbc..a4d4cd7a 100644 --- a/aai-common-docker/aai-common-images/pom.xml +++ b/aai-common-docker/aai-common-images/pom.xml @@ -25,11 +25,11 @@ <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> diff --git a/aai-common-docker/aai-haproxy-image/pom.xml b/aai-common-docker/aai-haproxy-image/pom.xml index 5f439483..df458adc 100644 --- a/aai-common-docker/aai-haproxy-image/pom.xml +++ b/aai-common-docker/aai-haproxy-image/pom.xml @@ -25,11 +25,11 @@ <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> diff --git a/aai-common-docker/pom.xml b/aai-common-docker/pom.xml index 5c0298b9..bdf67218 100644 --- a/aai-common-docker/pom.xml +++ b/aai-common-docker/pom.xml @@ -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> diff --git a/aai-core/pom.xml b/aai-core/pom.xml index b9814e8e..047e3af4 100644 --- a/aai-core/pom.xml +++ b/aai-core/pom.xml @@ -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> @@ -398,6 +398,10 @@ limitations under the License. </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> </dependency> <dependency> diff --git a/aai-core/src/main/java/org/onap/aai/dbgen/GraphSONPartialIO.java b/aai-core/src/main/java/org/onap/aai/dbgen/GraphSONPartialIO.java index 6c2eee15..c097a5bf 100644 --- a/aai-core/src/main/java/org/onap/aai/dbgen/GraphSONPartialIO.java +++ b/aai-core/src/main/java/org/onap/aai/dbgen/GraphSONPartialIO.java @@ -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; diff --git a/aai-core/src/main/java/org/onap/aai/dbmap/AAIGraph.java b/aai-core/src/main/java/org/onap/aai/dbmap/AAIGraph.java index d9994f52..15f57c13 100644 --- a/aai-core/src/main/java/org/onap/aai/dbmap/AAIGraph.java +++ b/aai-core/src/main/java/org/onap/aai/dbmap/AAIGraph.java @@ -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); } } diff --git a/aai-core/src/main/java/org/onap/aai/query/builder/GraphTraversalBuilder.java b/aai-core/src/main/java/org/onap/aai/query/builder/GraphTraversalBuilder.java index c5c4512e..24e5ec8b 100644 --- a/aai-core/src/main/java/org/onap/aai/query/builder/GraphTraversalBuilder.java +++ b/aai-core/src/main/java/org/onap/aai/query/builder/GraphTraversalBuilder.java @@ -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; @@ -689,6 +689,15 @@ public abstract class GraphTraversalBuilder<E> extends QueryBuilder<E> { } @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) { this.traversal.select(names[0]); diff --git a/aai-core/src/main/java/org/onap/aai/query/builder/GremlinQueryBuilder.java b/aai-core/src/main/java/org/onap/aai/query/builder/GremlinQueryBuilder.java index 4500a47e..db1c78ae 100644 --- a/aai-core/src/main/java/org/onap/aai/query/builder/GremlinQueryBuilder.java +++ b/aai-core/src/main/java/org/onap/aai/query/builder/GremlinQueryBuilder.java @@ -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; @@ -828,6 +829,14 @@ public abstract class GremlinQueryBuilder<E> extends QueryBuilder<E> { } @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('"; for (int i = 0; i < names.length; i++) { diff --git a/aai-core/src/main/java/org/onap/aai/query/builder/QueryBuilder.java b/aai-core/src/main/java/org/onap/aai/query/builder/QueryBuilder.java index 66532529..309ffa16 100644 --- a/aai-core/src/main/java/org/onap/aai/query/builder/QueryBuilder.java +++ b/aai-core/src/main/java/org/onap/aai/query/builder/QueryBuilder.java @@ -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); diff --git a/aai-core/src/main/java/org/onap/aai/restcore/search/AAIAbstractGroovyShell.java b/aai-core/src/main/java/org/onap/aai/restcore/search/AAIAbstractGroovyShell.java index 4a8760ec..f63df4b2 100644 --- a/aai-core/src/main/java/org/onap/aai/restcore/search/AAIAbstractGroovyShell.java +++ b/aai-core/src/main/java/org/onap/aai/restcore/search/AAIAbstractGroovyShell.java @@ -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); diff --git a/aai-core/src/main/java/org/onap/aai/serialization/queryformats/GraphSON.java b/aai-core/src/main/java/org/onap/aai/serialization/queryformats/GraphSON.java index c0ba860f..89970e24 100644 --- a/aai-core/src/main/java/org/onap/aai/serialization/queryformats/GraphSON.java +++ b/aai-core/src/main/java/org/onap/aai/serialization/queryformats/GraphSON.java @@ -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 diff --git a/aai-core/src/test/java/org/onap/aai/TinkerpopUpgradeTests.java b/aai-core/src/test/java/org/onap/aai/TinkerpopUpgradeTests.java index 799f6060..f443b308 100644 --- a/aai-core/src/test/java/org/onap/aai/TinkerpopUpgradeTests.java +++ b/aai-core/src/test/java/org/onap/aai/TinkerpopUpgradeTests.java @@ -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 { } diff --git a/aai-core/src/test/java/org/onap/aai/db/DbMethHelperTest.java b/aai-core/src/test/java/org/onap/aai/db/DbMethHelperTest.java index 16faa5f1..c79b9148 100644 --- a/aai-core/src/test/java/org/onap/aai/db/DbMethHelperTest.java +++ b/aai-core/src/test/java/org/onap/aai/db/DbMethHelperTest.java @@ -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) diff --git a/aai-els-onap-logging/pom.xml b/aai-els-onap-logging/pom.xml index aa0782b7..8188d562 100644 --- a/aai-els-onap-logging/pom.xml +++ b/aai-els-onap-logging/pom.xml @@ -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> diff --git a/aai-failover/pom.xml b/aai-failover/pom.xml index 1206bdd0..93953544 100644 --- a/aai-failover/pom.xml +++ b/aai-failover/pom.xml @@ -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> diff --git a/aai-parent/pom.xml b/aai-parent/pom.xml index 25ca2a9c..2fd8e887 100644 --- a/aai-parent/pom.xml +++ b/aai-parent/pom.xml @@ -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> diff --git a/aai-rest/pom.xml b/aai-rest/pom.xml index 9e8697e6..a86ad18b 100644 --- a/aai-rest/pom.xml +++ b/aai-rest/pom.xml @@ -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> diff --git a/aai-schema-abstraction/pom.xml b/aai-schema-abstraction/pom.xml index a0dc76c6..76d48328 100644 --- a/aai-schema-abstraction/pom.xml +++ b/aai-schema-abstraction/pom.xml @@ -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> diff --git a/aai-schema-ingest/pom.xml b/aai-schema-ingest/pom.xml index dd83c92c..ef9793a9 100644 --- a/aai-schema-ingest/pom.xml +++ b/aai-schema-ingest/pom.xml @@ -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> diff --git a/aai-schema-ingest/src/main/java/org/onap/aai/nodes/NodeIngestor.java b/aai-schema-ingest/src/main/java/org/onap/aai/nodes/NodeIngestor.java index a3d477ee..cf278060 100644 --- a/aai-schema-ingest/src/main/java/org/onap/aai/nodes/NodeIngestor.java +++ b/aai-schema-ingest/src/main/java/org/onap/aai/nodes/NodeIngestor.java @@ -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); } } diff --git a/aai-utils/pom.xml b/aai-utils/pom.xml index 68dc4dc6..cf682ed7 100644 --- a/aai-utils/pom.xml +++ b/aai-utils/pom.xml @@ -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> @@ -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> diff --git a/version.properties b/version.properties index 53fad524..5dfb2ddd 100644 --- a/version.properties +++ b/version.properties @@ -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} |