-
Notifications
You must be signed in to change notification settings - Fork 1
/
SparkJanusGraph.java
28 lines (20 loc) · 939 Bytes
/
SparkJanusGraph.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package org.expero;
import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource;
import org.apache.tinkerpop.gremlin.spark.process.computer.SparkGraphComputer;
import org.apache.tinkerpop.gremlin.structure.Vertex;
import org.apache.tinkerpop.gremlin.structure.util.GraphFactory;
import java.util.List;
public class SparkJanusGraph {
public static void main(String[] args) throws Exception {
if (args.length == 0) {
System.out.println("Please specify the location of the reader-graph.properties file");
System.exit(1);
}
GraphTraversalSource g = GraphFactory.open(args[0])
.traversal().withComputer(SparkGraphComputer.class);
System.out.println(("Running query..."));
List<Vertex> result = g.V().toList();
System.out.println("Processed " + result.size() + " vertex on a Spark job");
System.exit(0);
}
}