Skip to content

Commit

Permalink
Merge branch 'v0.6'
Browse files Browse the repository at this point in the history
Signed-off-by: Oleksandr Porunov <alexandr.porunov@gmail.com>
  • Loading branch information
porunov committed Jun 21, 2022
2 parents c3233ce + f44c663 commit 0b000d8
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 6 deletions.
2 changes: 1 addition & 1 deletion docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
| 1.0.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 | 8.y | 3.5.z | 3.0.z | 2.12.z |

Expand All @@ -39,6 +38,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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7904,4 +7904,21 @@ public void shouldThrowExceptionWhenIncorrectPropertiesAreUsedDuringForceIndexRe
protected void clopenForStaleIndex(){
clopen();
}

@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());
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,15 @@ private Iterator<E> convertIterator(Iterable<? extends JanusGraphProperty> 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<Element> 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 {
Expand All @@ -129,7 +134,7 @@ private void prefetchNextBatch() {
protected Iterator<E> flatMap(final Traverser.Admin<Element> 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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public <Q extends BaseVertexQuery> Q makeQuery(Q query) {
*/
private void prefetchNextBatch(final Traverser.Admin<Vertex> traverser) {
final JanusGraphMultiVertexQuery multiQuery = JanusGraphTraversalUtil.getTx(getTraversal()).multiQuery();
if(verticesToPrefetch.isEmpty()){
if (verticesToPrefetch.isEmpty()) {
multiQuery.addVertex(JanusGraphTraversalUtil.getJanusGraphVertex(traverser));
} else {
multiQuery.addAllVertices(verticesToPrefetch);
Expand Down

0 comments on commit 0b000d8

Please sign in to comment.