From 9034ac68d20e1cb9f9aeda9ed8445023fca92527 Mon Sep 17 00:00:00 2001 From: Fiete Ostkamp Date: Wed, 6 Mar 2024 07:56:05 +0100 Subject: 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 --- aai-aaf-auth/pom.xml | 2 +- aai-annotations/pom.xml | 2 +- aai-auth/pom.xml | 2 +- aai-common-docker/aai-common-images/pom.xml | 4 ++-- aai-common-docker/aai-haproxy-image/pom.xml | 4 ++-- aai-common-docker/pom.xml | 2 +- aai-core/pom.xml | 6 +++++- .../main/java/org/onap/aai/dbgen/GraphSONPartialIO.java | 10 ---------- aai-core/src/main/java/org/onap/aai/dbmap/AAIGraph.java | 1 + .../org/onap/aai/query/builder/GraphTraversalBuilder.java | 11 ++++++++++- .../org/onap/aai/query/builder/GremlinQueryBuilder.java | 9 +++++++++ .../main/java/org/onap/aai/query/builder/QueryBuilder.java | 3 +++ .../onap/aai/restcore/search/AAIAbstractGroovyShell.java | 2 +- .../org/onap/aai/serialization/queryformats/GraphSON.java | 8 +++++++- .../src/test/java/org/onap/aai/TinkerpopUpgradeTests.java | 4 +++- .../src/test/java/org/onap/aai/db/DbMethHelperTest.java | 14 ++++++++------ aai-els-onap-logging/pom.xml | 2 +- aai-failover/pom.xml | 2 +- aai-parent/pom.xml | 6 +++--- aai-rest/pom.xml | 2 +- aai-schema-abstraction/pom.xml | 2 +- aai-schema-ingest/pom.xml | 2 +- .../src/main/java/org/onap/aai/nodes/NodeIngestor.java | 1 + aai-utils/pom.xml | 2 +- pom.xml | 2 +- version.properties | 4 ++-- 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 @@ org.onap.aai.aai-common aai-parent - 1.13.6-SNAPSHOT + 1.14.0-SNAPSHOT ../aai-parent/pom.xml aai-aaf-auth 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 @@ org.onap.aai.aai-common aai-parent - 1.13.6-SNAPSHOT + 1.14.0-SNAPSHOT ../aai-parent/pom.xml aai-annotations 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 @@ org.onap.aai.aai-common aai-parent - 1.13.6-SNAPSHOT + 1.14.0-SNAPSHOT ../aai-parent/pom.xml aai-auth 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 @@ org.onap.aai.aai-common aai-common-docker - 1.13.6-SNAPSHOT + 1.14.0-SNAPSHOT aai-common-images - 1.13.6-SNAPSHOT + 1.14.0-SNAPSHOT pom aai-aai-common-images Contains dockerfiles for aai-common images (alpine and ubuntu based). 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 @@ org.onap.aai.aai-common aai-common-docker - 1.13.6-SNAPSHOT + 1.14.0-SNAPSHOT aai-haproxy-image - 1.13.6-SNAPSHOT + 1.14.0-SNAPSHOT pom aai-aai-haproxy-image Contains dockerfiles for aai-haproxy image. 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 @@ org.onap.aai.aai-common aai-parent - 1.13.6-SNAPSHOT + 1.14.0-SNAPSHOT ../aai-parent/pom.xml 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. org.onap.aai.aai-common aai-parent - 1.13.6-SNAPSHOT + 1.14.0-SNAPSHOT ../aai-parent/pom.xml aai-core @@ -396,6 +396,10 @@ limitations under the License. com.fasterxml.jackson.core jackson-annotations + + com.fasterxml.jackson.dataformat + jackson-dataformat-xml + com.fasterxml.jackson.dataformat jackson-dataformat-yaml 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 registry(final IoRegistry registry) { - this.registry = registry; - return this; - } - @Override public Io.Builder onMapper(final Consumer 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; @@ -688,6 +688,15 @@ public abstract class GraphTraversalBuilder extends QueryBuilder { return this; } + @Override + public QueryBuilder select(Pop pop, String name) { + this.traversal.select(pop, name); + + stepIndex++; + + return this; + } + @Override public QueryBuilder select(String... names) { if (names.length == 1) { 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; @@ -827,6 +828,14 @@ public abstract class GremlinQueryBuilder extends QueryBuilder { return this; } + @Override + public QueryBuilder select(Pop pop, String name) { + this.list.add(".select(Pop." + pop.toString() + ",'" + name + "')"); + stepIndex++; + + return this; + } + @Override public QueryBuilder select(String... names) { String stepString = ".select('"; 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 implements Iterator { public abstract QueryBuilder select(String name); + public abstract QueryBuilder select(Pop pop, String name); + public abstract QueryBuilder select(String... names); public abstract QueryBuilder until(QueryBuilder 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 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 @@ org.onap.aai.aai-common aai-parent - 1.13.6-SNAPSHOT + 1.14.0-SNAPSHOT ../aai-parent/pom.xml aai-els-onap-logging 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 @@ org.onap.aai.aai-common aai-parent - 1.13.6-SNAPSHOT + 1.14.0-SNAPSHOT ../aai-parent/pom.xml 4.0.0 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. org.onap.aai.aai-common aai-common - 1.13.6-SNAPSHOT + 1.14.0-SNAPSHOT aai-parent aai-parent @@ -62,13 +62,13 @@ limitations under the License. 2.0.0-oss 2.3.31 31.1-jre - 3.2.11 + 3.3.0 + 0.3.3 2.5.15 2.9.1 2.0.0.0 2.2 2.11.4 - 0.2.3 1.2 2.3.1 2.3.0.1 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 @@ org.onap.aai.aai-common aai-parent - 1.13.6-SNAPSHOT + 1.14.0-SNAPSHOT ../aai-parent/pom.xml aai-rest 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 @@ org.onap.aai.aai-common aai-parent - 1.13.6-SNAPSHOT + 1.14.0-SNAPSHOT ../aai-parent/pom.xml 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. org.onap.aai.aai-common aai-parent - 1.13.6-SNAPSHOT + 1.14.0-SNAPSHOT ../aai-parent/pom.xml aai-schema-ingest 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 @@ org.onap.aai.aai-common aai-parent - 1.13.6-SNAPSHOT + 1.14.0-SNAPSHOT ../aai-parent/pom.xml aai-utils diff --git a/pom.xml b/pom.xml index 1aba0756..5f3b2314 100644 --- a/pom.xml +++ b/pom.xml @@ -30,7 +30,7 @@ org.onap.aai.aai-common aai-common - 1.13.6-SNAPSHOT + 1.14.0-SNAPSHOT pom aai-aai-common Contains all of the common code for resources and traversal repos 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} -- cgit 1.2.3-korg