diff options
author | Fiete Ostkamp <fiete.ostkamp@telekom.de> | 2024-01-20 17:14:17 +0000 |
---|---|---|
committer | Fiete Ostkamp <fiete.ostkamp@telekom.de> | 2024-01-20 17:14:17 +0000 |
commit | 9901da168ffe52ed9a34e32d5a65a7a6e5ac9e5f (patch) | |
tree | 29e5d8fab82227004d345ad3e9a203baf97c5ee6 /aai-core/src/main | |
parent | 4e7ca21da096ff03ca70451fb5e7b95d3fd18f6e (diff) |
Revert "Update tinkerpop to 3.2.3 in aai-core"
This reverts commit 4e7ca21da096ff03ca70451fb5e7b95d3fd18f6e.
Reason for revert: This is not properly fixing the underlying issue and was merged prematurely
Issue-ID: AAI-3554
Change-Id: I3ff720bd5322712bdde13d774cc4366a9ed28650
Signed-off-by: Fiete Ostkamp <Fiete.Ostkamp@telekom.de>
Diffstat (limited to 'aai-core/src/main')
3 files changed, 24 insertions, 25 deletions
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 b8a354ea..3c5c4489 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 @@ -4,8 +4,6 @@ * ================================================================================ * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. * ================================================================================ - * Modifications Copyright © 2023 Deutsche Telekom. - * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -64,9 +62,6 @@ public abstract class GraphTraversalBuilder<E> extends QueryBuilder<E> { protected GraphTraversal<Vertex, E> traversal = null; protected Admin<Vertex, E> completeTraversal = null; - protected QueryBuilder<E> containerQuery; - protected QueryBuilder<E> parentQuery; - /** * Instantiates a new graph traversal builder. * @@ -356,7 +351,7 @@ public abstract class GraphTraversalBuilder<E> extends QueryBuilder<E> { traversal.has(AAIProperties.NODE_TYPE, type); } stepIndex++; - markContainerIndex(); + markContainer(); return (QueryBuilder<Vertex>) this; } @@ -843,16 +838,21 @@ public abstract class GraphTraversalBuilder<E> extends QueryBuilder<E> { return this; } + /** + * @{inheritDoc} + */ @Override public <E2> E2 getQuery() { return (E2) this.traversal; } + /** + * @{inheritDoc} + */ @Override public QueryBuilder<E> getParentQuery() { - return this.parentQuery != null - ? this.parentQuery - : cloneQueryAtStep(parentStepIndex); + + return cloneQueryAtStep(parentStepIndex); } @Override @@ -861,22 +861,26 @@ public abstract class GraphTraversalBuilder<E> extends QueryBuilder<E> { if (this.parentStepIndex == 0) { return removeQueryStepsBetween(0, containerStepIndex); } else { - return this.containerQuery; + return cloneQueryAtStep(containerStepIndex); } } + /** + * @{inheritDoc} + */ @Override public void markParentBoundary() { - this.parentQuery = cloneQueryAtStep(stepIndex); parentStepIndex = stepIndex; } @Override - public void markContainerIndex() { - this.containerQuery = cloneQueryAtStep(stepIndex); + public void markContainer() { containerStepIndex = stepIndex; } + /** + * @{inheritDoc} + */ @Override public Vertex getStart() { return this.start; @@ -941,9 +945,7 @@ public abstract class GraphTraversalBuilder<E> extends QueryBuilder<E> { if (this.completeTraversal == null) { executeQuery(); } - // clone is necessary since toList would optimize traversal steps - // which messes with the indeces that are registered while parsing - return this.completeTraversal.clone().toList(); + return this.completeTraversal.toList(); } protected QueryBuilder<Edge> has(String key, String value) { 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 e68cfe69..4500a47e 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 @@ -574,7 +574,7 @@ public abstract class GremlinQueryBuilder<E> extends QueryBuilder<E> { list.add(".has('aai-node-type', '" + type + "')"); } stepIndex++; - this.markContainerIndex(); + this.markContainer(); return (QueryBuilder<Vertex>) this; } @@ -879,7 +879,7 @@ public abstract class GremlinQueryBuilder<E> extends QueryBuilder<E> { } @Override - public void markContainerIndex() { + public void markContainer() { this.containerStepIndex = stepIndex; } 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 6d56d1af..2bc90726 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 @@ -487,7 +487,7 @@ public abstract class QueryBuilder<E> implements Iterator<E> { * This is necessary in cases such as "if the Optional Property 1 is sent, * find all Nodes of type A with edges to Nodes of type B with property 1, * otherwise, simply find all nodes of type A". - * + * * @param type * @param outNodeType * @param inNodeType @@ -506,7 +506,7 @@ public abstract class QueryBuilder<E> implements Iterator<E> { * This is necessary in cases such as "if the Optional Property 1 is sent, * find all Nodes of type A with edges to Nodes of type B with property 1, * otherwise, simply find all nodes of type A". - * + * * @param type * @param outNodeType * @param inNodeType @@ -603,7 +603,7 @@ public abstract class QueryBuilder<E> implements Iterator<E> { public abstract <E2> E2 getQuery(); /** - * Marks the current step index as the boundary to the parent. + * Form boundary. */ public abstract void markParentBoundary(); @@ -721,10 +721,7 @@ public abstract class QueryBuilder<E> implements Iterator<E> { */ public abstract QueryBuilder<Path> path(); - /** - * Marks the current step index as the container step. - */ - public abstract void markContainerIndex(); + public abstract void markContainer(); public abstract QueryBuilder<E> getContainerQuery(); |