Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update TinkerPop 3.6.1 [tp-tests] #3208

Merged
merged 1 commit into from
Oct 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci-index-solr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:
args: "-Psolr8"
name: solr8
java: 8
- module: es
- module: solr
install-args: "-Pjava-11"
args: "-Psolr8"
name: solr8
Expand Down
2 changes: 1 addition & 1 deletion docs/advanced-topics/hadoop.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ computations of various OLAP queries may be persisted on the Hadoop file
system.

For configuring a single node Hadoop cluster, please refer to official
[Apache Hadoop Docs](https://hadoop.apache.org/docs/r{{hadoop2_version }}/hadoop-project-dist/hadoop-common/SingleCluster.html)
[Apache Hadoop Docs](https://hadoop.apache.org/docs/r{{hadoop_version }}/hadoop-project-dist/hadoop-common/SingleCluster.html)

Once you have a Hadoop cluster up and running, we will need to specify
the Hadoop configuration files in the `CLASSPATH`. The below document
Expand Down
4 changes: 2 additions & 2 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ All currently supported verions of JanusGraph are listed below.
| JanusGraph | Storage Version | Cassandra | HBase | Bigtable | Elasticsearch | Solr | TinkerPop | Spark | Scala |
| ----- | ---- | ---- | ---- | ---- | ---- | ---- | --- | ---- | ---- |
| 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.11.z, 4.0.z | 2.5.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 |
| 1.0.z | 2 | 3.11.z, 4.0.z | 2.5.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.6.z | 3.2.z | 2.12.z |

#### End-of-Life
The versions of JanusGraph listed below are outdated and will no longer receive bugfixes.
Expand Down Expand Up @@ -65,7 +65,7 @@ compile "org.janusgraph:janusgraph-core:1.0.0"
* Elasticsearch 6.0.1, 6.6.0, 7.17.5
* Apache Lucene 8.11.1
* Apache Solr 8.11.1
* Apache TinkerPop 3.5.3
* Apache TinkerPop 3.6.1
mad marked this conversation as resolved.
Show resolved Hide resolved
* Java 8, 11

**Installed versions in the Pre-Packaged Distribution**
Expand Down
27 changes: 0 additions & 27 deletions janusgraph-all/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -104,33 +104,6 @@
<version>${project.version}</version>
</dependency>

<!-- Override Jackson versions in our transitive dependencies.
Without these dependencies, janusgraph-all users can end up with
1.9 + 1.8 jars together, and this leads to linkage errors.
It might be a better idea to dependencyManagement imports if your Maven version supports it:
https://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#Importing_Dependencies -->
<!-- Jackson 1.x -->
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-mapper-asl</artifactId>
<version>${jackson1.version}</version>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-core-asl</artifactId>
<version>${jackson1.version}</version>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-xc</artifactId>
<version>${jackson1.version}</version>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-jaxrs</artifactId>
<version>${jackson1.version}</version>
</dependency>

<!-- Jackson 2.x -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,14 @@
method = "shouldResetAfterRollback",
reason = "JanusGraph assumes lifecycle of transactionListeners in AbstractThreadLocalTransaction ends when the " +
"transaction ends (commit/rollback/close). TinkerPop, however, asserts transactionListeners are active across transactions.")
@Graph.OptOut(
test = "org.apache.tinkerpop.gremlin.process.traversal.step.map.MergeVertexTest",
method = "g_mergeVXlabel_person_name_markoX_optionXonMatch_age_19X_option",
reason = "JanusGraph doesn't support MergeVertex yet.")
@Graph.OptOut(
test = "org.apache.tinkerpop.gremlin.process.traversal.step.map.MergeVertexTest",
method = "g_withSideEffectXc_label_person_name_markoX_withSideEffectXm_age_19X_mergeVXselectXcXX_optionXonMatch_selectXmXX_option",
reason = "JanusGraph doesn't support MergeVertex yet.")
farodin91 marked this conversation as resolved.
Show resolved Hide resolved
public interface JanusGraph extends Transaction {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@

package org.janusgraph.graphdb.tinkerpop;

import org.apache.tinkerpop.gremlin.structure.Element;
import org.apache.tinkerpop.gremlin.structure.Graph;
import org.apache.tinkerpop.gremlin.structure.Vertex;
import org.janusgraph.core.JanusGraphEdge;
import org.janusgraph.core.JanusGraphVertex;
Expand Down Expand Up @@ -61,13 +59,4 @@ public static RelationIdentifier getEdgeId(Object id) {
}
return null;
}

public static void verifyArgsMustBeEitherIdOrElement(Object... ids) {
assert ids.length>0;
int numElements = 0;
for (Object id : ids) {
if (id instanceof Element) numElements++;
}
if (numElements>0 && numElements<ids.length) throw Graph.Exceptions.idArgsMustBeEitherIdOrElement();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ public JanusGraphVertex addVertex(Object... keyValues) {
@Override
public Iterator<Vertex> vertices(Object... vertexIds) {
if (vertexIds==null || vertexIds.length==0) return (Iterator)getVertices().iterator();
ElementUtils.verifyArgsMustBeEitherIdOrElement(vertexIds);
long[] ids = new long[vertexIds.length];
int pos = 0;
for (Object vertexId : vertexIds) {
Expand All @@ -147,7 +146,6 @@ public Iterator<Vertex> vertices(Object... vertexIds) {
@Override
public Iterator<Edge> edges(Object... edgeIds) {
if (edgeIds==null || edgeIds.length==0) return (Iterator)getEdges().iterator();
ElementUtils.verifyArgsMustBeEitherIdOrElement(edgeIds);
RelationIdentifier[] ids = new RelationIdentifier[edgeIds.length];
int pos = 0;
for (Object edgeId : edgeIds) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import org.apache.tinkerpop.gremlin.process.traversal.util.TraversalHelper;
import org.apache.tinkerpop.gremlin.structure.Element;
import org.apache.tinkerpop.gremlin.structure.Graph;
import org.janusgraph.graphdb.tinkerpop.ElementUtils;
import org.janusgraph.graphdb.tinkerpop.optimize.JanusGraphTraversalUtil;
import org.janusgraph.graphdb.tinkerpop.optimize.step.HasStepFolder;
import org.janusgraph.graphdb.tinkerpop.optimize.step.JanusGraphStep;
Expand Down Expand Up @@ -63,17 +62,19 @@ public void apply(final Traversal.Admin<?, ?> traversal) {
} else {
//Make sure that any provided "start" elements are instantiated in the current transaction
final Object[] ids = originalGraphStep.getIds();
ElementUtils.verifyArgsMustBeEitherIdOrElement(ids);
farodin91 marked this conversation as resolved.
Show resolved Hide resolved
if (ids[0] instanceof Element) {
//GraphStep constructor ensures that the entire array is elements
final Object[] elementIds = new Object[ids.length];
for (int i = 0; i < ids.length; i++) {
final Object[] elementIds = new Object[ids.length];
for (int i = 0; i < ids.length; i++) {
if (ids[i] instanceof Element) {
elementIds[i] = ((Element) ids[i]).id();
}
originalGraphStep.setIteratorSupplier(() -> originalGraphStep.returnsVertex() ?
((Graph) originalGraphStep.getTraversal().getGraph().get()).vertices(elementIds) :
((Graph) originalGraphStep.getTraversal().getGraph().get()).edges(elementIds));
else
{
elementIds[i] = ids[i];
}
}
originalGraphStep.setIteratorSupplier(() -> originalGraphStep.returnsVertex() ?
((Graph) originalGraphStep.getTraversal().getGraph().get()).vertices(elementIds) :
((Graph) originalGraphStep.getTraversal().getGraph().get()).edges(elementIds));
}

});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

public class CloseableIteratorUtils {

public static final CloseableIterator<Object> EMPTY_CLOSABLE_ITERATOR = CloseableIterator.asCloseable(Collections.emptyIterator());
public static final CloseableIterator<Object> EMPTY_CLOSABLE_ITERATOR = CloseableIterator.of(Collections.emptyIterator());

public static <T> CloseableIterator<T> emptyIterator() {
return (CloseableIterator<T>) EMPTY_CLOSABLE_ITERATOR;
Expand Down
1 change: 1 addition & 0 deletions janusgraph-cql/src/test/resources/cql-read.properties
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
gremlin.graph=org.apache.tinkerpop.gremlin.hadoop.structure.HadoopGraph
gremlin.hadoop.graphReader=org.janusgraph.hadoop.formats.cql.CqlInputFormat
gremlin.hadoop.graphWriter=org.apache.hadoop.mapreduce.lib.output.NullOutputFormat

gremlin.hadoop.jarsInDistributedCache=true
gremlin.hadoop.inputLocation=none
gremlin.hadoop.outputLocation=target/output
Expand Down
1 change: 0 additions & 1 deletion janusgraph-hadoop/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-client</artifactId>
<version>${hadoop2.version}</version>
</dependency>

<!-- JANUSGRAPH -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,24 @@
@Testcontainers
public class HBaseInputFormatIT extends AbstractInputFormatIT {
@Container
public static final HBaseContainer hBaseContainer = new HBaseContainer();
private static final HBaseContainer hbase = new HBaseContainer();

protected Graph getGraph() throws IOException, ConfigurationException {
final PropertiesConfiguration config = ConfigurationUtil.loadPropertiesConfig("target/test-classes/hbase-read.properties", false);
private PropertiesConfiguration getGraphConfiguration(final String filename) throws ConfigurationException, IOException {
final PropertiesConfiguration config = ConfigurationUtil.loadPropertiesConfig(filename, false);
Path baseOutDir = Paths.get((String) config.getProperty("gremlin.hadoop.outputLocation"));
baseOutDir.toFile().mkdirs();
String outDir = Files.createTempDirectory(baseOutDir, null).toAbsolutePath().toString();
config.setProperty("gremlin.hadoop.outputLocation", outDir);
return GraphFactory.open(config);
return config;
}

@Override
public WriteConfiguration getConfiguration() {
return hBaseContainer.getWriteConfiguration();
return hbase.getWriteConfiguration();
}

@Override
protected Graph getGraph() throws ConfigurationException, IOException {
return GraphFactory.open(getGraphConfiguration("target/test-classes/hbase-read.properties"));
}
}
15 changes: 12 additions & 3 deletions janusgraph-hbase/src/test/resources/hbase-read-snapshot.properties
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,31 @@
# See the License for the specific language governing permissions and
# limitations under the License.

#
# Hadoop Graph Configuration
#
gremlin.graph=org.apache.tinkerpop.gremlin.hadoop.structure.HadoopGraph
gremlin.hadoop.graphReader=org.janusgraph.hadoop.formats.hbase.HBaseSnapshotInputFormat
gremlin.hadoop.graphWriter=org.apache.hadoop.mapreduce.lib.output.NullOutputFormat

gremlin.hadoop.jarsInDistributedCache=true
gremlin.hadoop.inputLocation=none
gremlin.hadoop.outputLocation=target/output

#
# JanusGraph HBase InputFormat configuration
#
janusgraphmr.ioformat.conf.storage.backend=hbase
janusgraphmr.ioformat.conf.storage.hostname=localhost
janusgraphmr.ioformat.conf.storage.hbase.snapshot-name=janusgraph-snapshot
janusgraphmr.ioformat.conf.storage.hbase.snapshot-restore-dir=target/output
####################################
# SparkGraphComputer Configuration #
####################################

#
# SparkGraphComputer Configuration
#
spark.master=local[4]
spark.driver.host=127.0.0.1
spark.executor.memory=1g
spark.serializer=org.apache.spark.serializer.KryoSerializer
spark.kryo.registrator=org.janusgraph.hadoop.serialize.JanusGraphKryoRegistrator
spark.hadoopRDD.ignoreEmptySplits=false
17 changes: 14 additions & 3 deletions janusgraph-hbase/src/test/resources/hbase-read.properties
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,31 @@
# See the License for the specific language governing permissions and
# limitations under the License.

#
# Hadoop Graph Configuration
#
gremlin.graph=org.apache.tinkerpop.gremlin.hadoop.structure.HadoopGraph
gremlin.hadoop.graphReader=org.janusgraph.hadoop.formats.hbase.HBaseInputFormat
gremlin.hadoop.graphWriter=org.apache.hadoop.mapreduce.lib.output.NullOutputFormat

gremlin.hadoop.jarsInDistributedCache=true
gremlin.hadoop.inputLocation=none
gremlin.hadoop.outputLocation=target/output
gremlin.spark.persistContext=true

#
# JanusGraph HBase InputFormat configuration
#
janusgraphmr.ioformat.conf.storage.backend=hbase
janusgraphmr.ioformat.conf.storage.hostname=localhost
####################################
# SparkGraphComputer Configuration #
####################################
janusgraphmr.ioformat.conf.storage.hbase.table=janusgraph

#
# SparkGraphComputer Configuration
#
spark.master=local[4]
spark.driver.host=127.0.0.1
spark.executor.memory=1g
spark.serializer=org.apache.spark.serializer.KryoSerializer
spark.kryo.registrator=org.janusgraph.hadoop.serialize.JanusGraphKryoRegistrator
spark.hadoopRDD.ignoreEmptySplits=false
4 changes: 2 additions & 2 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,6 @@ nav:
extra:
latest_version: 1.0.0
snapshot_version: 1.0.0-SNAPSHOT
tinkerpop_version: 3.5.3
hadoop2_version: 2.8.5
tinkerpop_version: 3.6.1
hadoop_version: 3.3.4
jamm_version: 0.3.0
Loading