From 7a58a584bb439c3614d280130127d4f99628bbc5 Mon Sep 17 00:00:00 2001 From: Oleksandr Porunov Date: Mon, 20 Jun 2022 22:27:40 +0100 Subject: [PATCH 1/2] Mark 0.5.z releases as EOL Signed-off-by: Oleksandr Porunov --- docs/changelog.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/changelog.md b/docs/changelog.md index 47ae8a0716..37bbf14489 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -26,7 +26,6 @@ All currently supported verions of JanusGraph are listed below. | JanusGraph | Storage Version | Cassandra | HBase | Bigtable | Elasticsearch | Solr | TinkerPop | Spark | Scala | | ----- | ---- | ---- | ---- | ---- | ---- | ---- | --- | ---- | ---- | -| 0.5.z | 2 | 2.1.z, 2.2.z, 3.0.z, 3.11.z | 1.2.z, 1.3.z, 1.4.z, 2.1.z | 1.3.0, 1.4.0, 1.5.z, 1.6.z, 1.7.z, 1.8.z, 1.9.z, 1.10.z, 1.11.z, 1.14.z | 6.y, 7.y | 7.y | 3.4.z | 2.2.z | 2.11.z | | 0.6.z | 2 | 3.0.z, 3.11.z | 1.6.z, 2.2.z | 1.3.0, 1.4.0, 1.5.z, 1.6.z, 1.7.z, 1.8.z, 1.9.z, 1.10.z, 1.11.z, 1.14.z | 6.y, 7.y | 7.y, 8.y | 3.5.z | 3.0.z | 2.12.z | #### End-of-Life @@ -38,6 +37,7 @@ The versions of JanusGraph listed below are outdated and will no longer receive | 0.2.z | 1 | 1.2.z, 2.0.z, 2.1.z, 2.2.z, 3.0.z, 3.11.z | 0.98.z, 1.0.z, 1.1.z, 1.2.z, 1.3.z | 0.9.z, 1.0.0-preZ, 1.0.0 | 1.5-1.7.z, 2.3-2.4.z, 5.y, 6.y | 5.2-5.5.z, 6.2-6.6.z, 7.y | 3.2.z | 1.6.z | 2.10.z | | 0.3.z | 2 | 1.2.z, 2.0.z, 2.1.z, 2.2.z, 3.0.z, 3.11.z | 1.0.z, 1.1.z, 1.2.z, 1.3.z, 1.4.z | 1.0.0, 1.1.0, 1.1.2, 1.2.0, 1.3.0, 1.4.0 | 1.5-1.7.z, 2.3-2.4.z, 5.y, 6.y | 5.2-5.5.z, 6.2-6.6.z, 7.y | 3.3.z | 2.2.z | 2.11.z | | 0.4.z | 2 | 2.1.z, 2.2.z, 3.0.z, 3.11.z | 1.2.z, 1.3.z, 1.4.z, 2.1.z | N/A | 5.y, 6.y | 7.y | 3.4.z | 2.2.z | 2.11.z | +| 0.5.z | 2 | 2.1.z, 2.2.z, 3.0.z, 3.11.z | 1.2.z, 1.3.z, 1.4.z, 2.1.z | 1.3.0, 1.4.0, 1.5.z, 1.6.z, 1.7.z, 1.8.z, 1.9.z, 1.10.z, 1.11.z, 1.14.z | 6.y, 7.y | 7.y | 3.4.z | 2.2.z | 2.11.z | ## Release Notes From 1bd764b43928ca1d1dd93d509ebb5e7b798632f7 Mon Sep 17 00:00:00 2001 From: Lionel Fleury Date: Thu, 16 Jun 2022 17:11:36 +0200 Subject: [PATCH 2/2] [janusgraph-core] fixes properties step in multi-query - add test - add fix when empty vertices to prefetch - fix comments Closes #3081 Signed-off-by: Lionel Fleury --- .../org/janusgraph/graphdb/JanusGraphTest.java | 16 ++++++++++++++++ .../optimize/step/JanusGraphPropertiesStep.java | 13 +++++++++---- .../optimize/step/JanusGraphVertexStep.java | 2 +- 3 files changed, 26 insertions(+), 5 deletions(-) diff --git a/janusgraph-backend-testutils/src/main/java/org/janusgraph/graphdb/JanusGraphTest.java b/janusgraph-backend-testutils/src/main/java/org/janusgraph/graphdb/JanusGraphTest.java index 6a9261acf9..b666472c94 100644 --- a/janusgraph-backend-testutils/src/main/java/org/janusgraph/graphdb/JanusGraphTest.java +++ b/janusgraph-backend-testutils/src/main/java/org/janusgraph/graphdb/JanusGraphTest.java @@ -7409,4 +7409,20 @@ public void testVerticesDropAfterWhereWithBatchQueryEnabled() { assertFalse(tx.traversal().V().has("a", timestamp).has("b", true).has("c", true).bothE().hasNext()); } + @Test + public void testPropertiesAfterProjectWithByThenChooseWithBatchQueryEnabled() { + clopen(option(USE_MULTIQUERY),true, + option(BATCH_PROPERTY_PREFETCHING),false, + option(STORAGE_BATCH),false + ); + + long timestamp = System.currentTimeMillis(); + + tx.traversal().addV("test").property("a", timestamp).next(); + + newTx(); + + assertTrue(tx.traversal().V().has("a", timestamp).project("a").by(__.choose(__.has("a"), __.values("a"))).hasNext()); + } + } diff --git a/janusgraph-core/src/main/java/org/janusgraph/graphdb/tinkerpop/optimize/step/JanusGraphPropertiesStep.java b/janusgraph-core/src/main/java/org/janusgraph/graphdb/tinkerpop/optimize/step/JanusGraphPropertiesStep.java index dbf4ee7cdf..825be7c15e 100644 --- a/janusgraph-core/src/main/java/org/janusgraph/graphdb/tinkerpop/optimize/step/JanusGraphPropertiesStep.java +++ b/janusgraph-core/src/main/java/org/janusgraph/graphdb/tinkerpop/optimize/step/JanusGraphPropertiesStep.java @@ -110,10 +110,15 @@ private Iterator convertIterator(Iterable itera * This initialisation method is called when an attempt to retrieve a vertex from the cached multiQuery results * doesn't find an entry. */ - private void prefetchNextBatch() { + private void prefetchNextBatch(final Traverser.Admin traverser) { final JanusGraphMultiVertexQuery multiQuery = JanusGraphTraversalUtil.getTx(getTraversal()).multiQuery(); - multiQuery.addAllVertices(verticesToPrefetch); - verticesToPrefetch.clear(); + if (verticesToPrefetch.isEmpty()) { + multiQuery.addVertex(JanusGraphTraversalUtil.getJanusGraphVertex(traverser)); + } else { + multiQuery.addAllVertices(verticesToPrefetch); + verticesToPrefetch.clear(); + } + makeQuery(multiQuery); try { @@ -129,7 +134,7 @@ private void prefetchNextBatch() { protected Iterator flatMap(final Traverser.Admin traverser) { if (useMultiQuery && traverser.get() instanceof Vertex) { if (multiQueryResults == null || !multiQueryResults.containsKey(traverser.get())) { - prefetchNextBatch(); + prefetchNextBatch(traverser); } return convertIterator(multiQueryResults.get(traverser.get())); } else if (traverser.get() instanceof JanusGraphVertex || traverser.get() instanceof WrappedVertex) { diff --git a/janusgraph-core/src/main/java/org/janusgraph/graphdb/tinkerpop/optimize/step/JanusGraphVertexStep.java b/janusgraph-core/src/main/java/org/janusgraph/graphdb/tinkerpop/optimize/step/JanusGraphVertexStep.java index daa7f2ba62..a902c943c3 100644 --- a/janusgraph-core/src/main/java/org/janusgraph/graphdb/tinkerpop/optimize/step/JanusGraphVertexStep.java +++ b/janusgraph-core/src/main/java/org/janusgraph/graphdb/tinkerpop/optimize/step/JanusGraphVertexStep.java @@ -110,7 +110,7 @@ public Q makeQuery(Q query) { */ private void prefetchNextBatch(final Traverser.Admin traverser) { final JanusGraphMultiVertexQuery multiQuery = JanusGraphTraversalUtil.getTx(getTraversal()).multiQuery(); - if(verticesToPrefetch.isEmpty()){ + if (verticesToPrefetch.isEmpty()) { multiQuery.addVertex(JanusGraphTraversalUtil.getJanusGraphVertex(traverser)); } else { multiQuery.addAllVertices(verticesToPrefetch);