Skip to content

Commit e131102

Browse files
zhangsuochaozhoney
zhangsuochao
authored andcommitted
add HugeGraph test into graphdb-benchmarks
Change-Id: I939f14e99ffa6d9fef7138017d4118d7e26e2bf5
1 parent 87bad50 commit e131102

File tree

11 files changed

+422
-19
lines changed

11 files changed

+422
-19
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
graphdb-benchmarks
22
==================
3-
The project graphdb-benchmarks is a benchmark between popular graph dataases. Currently the framework supports [Titan](http://thinkaurelius.github.io/titan/), [OrientDB](http://www.orientechnologies.com/orientdb/), [Neo4j](http://neo4j.com/) and [Sparksee](http://www.sparsity-technologies.com/). The purpose of this benchmark is to examine the performance of each graph database in terms of execution time. The benchmark is composed of four workloads, Clustering, Massive Insertion, Single Insertion and Query Workload. Every workload has been designed to simulate common operations in graph database systems.
3+
The project graphdb-benchmarks is a benchmark between popular graph dataases. Currently the framework supports [Titan](http://thinkaurelius.github.io/titan/), [OrientDB](http://www.orientechnologies.com/orientdb/), [Neo4j](http://neo4j.com/) , [Sparksee](http://www.sparsity-technologies.com/) and [HugeGraph](https://github.com/hugegraph/hugegraph). The purpose of this benchmark is to examine the performance of each graph database in terms of execution time. The benchmark is composed of four workloads, Clustering, Massive Insertion, Single Insertion and Query Workload. Every workload has been designed to simulate common operations in graph database systems.
44

55
- *Clustering Workload (CW)*: CW consists of a well-known community detection algorithm for modularity optimization, the Louvain Method. We adapt the algorithm on top of the benchmarked graph databases and employ cache techniques to take advantage of both graph database capabilities and in-memory execution speed. We measure the time the algorithm needs to converge.
66
- *Massive Insertion Workload (MIW)*: we create the graph database and configure it for massive loading, then we populate it with a particular dataset. We measure the time for the creation of the whole graph.

pom.xml

+19-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<modelVersion>4.0.0</modelVersion>
55
<groupId>eu.socialsensor</groupId>
66
<artifactId>graphdb-benchmarks</artifactId>
7-
<version>1.0</version>
7+
<version>1.1</version>
88

99
<name>graphdb-benchmarks</name>
1010
<url>https://github.com/socialsensor/graphdb-benchmarks</url>
@@ -53,16 +53,23 @@
5353
<blueprints.version>2.6.0</blueprints.version>
5454
<orientdb.version>2.2.5</orientdb.version>
5555
<titan.version>0.5.4</titan.version>
56-
<hbase.version>0.98.8-hadoop2</hbase.version>
56+
<!--<hbase.version>0.98.8-hadoop2</hbase.version>-->
57+
<hbase.version>1.2.0</hbase.version>
5758
<neo4j.version>2.0.1</neo4j.version>
5859
<dynamodb.titan.version>1.0.0</dynamodb.titan.version>
5960
<log4j2.version>2.1</log4j2.version>
6061
<maven.surefire.version>2.18.1</maven.surefire.version>
6162
<jdk.version>1.8</jdk.version>
6263
<metrics.version>3.0.0-BETA3</metrics.version>
64+
<hugegraph.client.version>1.0-SNAPSHOT</hugegraph.client.version>
6365
</properties>
6466

6567
<dependencies>
68+
<dependency>
69+
<groupId>com.baidu.hugegraph</groupId>
70+
<artifactId>hugegraph-client</artifactId>
71+
<version>${hugegraph.client.version}</version>
72+
</dependency>
6673
<dependency>
6774
<groupId>org.antlr</groupId>
6875
<artifactId>antlr-runtime</artifactId>
@@ -263,6 +270,16 @@
263270
<artifactId>metrics-core</artifactId>
264271
<version>${metrics.version}</version>
265272
</dependency>
273+
<dependency>
274+
<groupId>com.fasterxml.jackson.jaxrs</groupId>
275+
<artifactId>jackson-jaxrs-base</artifactId>
276+
<version>2.8.4</version>
277+
</dependency>
278+
<dependency>
279+
<groupId>com.fasterxml.jackson.jaxrs</groupId>
280+
<artifactId>jackson-jaxrs-json-provider</artifactId>
281+
<version>2.8.4</version>
282+
</dependency>
266283
</dependencies>
267284
<build>
268285
<pluginManagement>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,241 @@
1+
/*
2+
* Copyright (C) 2017 Baidu, Inc. All Rights Reserved.
3+
*/
4+
package eu.socialsensor.graphdatabases;
5+
6+
import java.io.File;
7+
import java.util.Iterator;
8+
import java.util.List;
9+
import java.util.Map;
10+
import java.util.Set;
11+
12+
import com.baidu.hugegraph.driver.HugeClient;
13+
import com.baidu.hugegraph.driver.SchemaManager;
14+
import com.baidu.hugegraph.structure.graph.Edge;
15+
import com.baidu.hugegraph.structure.graph.Vertex;
16+
//import com.tinkerpop.blueprints.Edge;
17+
//import com.tinkerpop.blueprints.Vertex;
18+
19+
import eu.socialsensor.insert.HugeGraphMassiveInsertion;
20+
import eu.socialsensor.main.BenchmarkConfiguration;
21+
import eu.socialsensor.main.GraphDatabaseType;
22+
import eu.socialsensor.utils.HugeGraphUtils;
23+
24+
/**
25+
* Created by zhangsuochao on 17/6/21.
26+
*/
27+
public class HugeGraphDatabase extends GraphDatabaseBase<Iterator<Vertex>, Iterator<Edge>, Vertex, Edge> {
28+
29+
protected final HugeClient hugeClient;
30+
31+
public HugeGraphDatabase(BenchmarkConfiguration config, File dbStorageDirectoryIn) {
32+
super(GraphDatabaseType.HUGEGRAPH_CASSANDRA, dbStorageDirectoryIn);
33+
hugeClient = HugeClient.open("http://localhost:8080",
34+
"hugegraph");
35+
}
36+
37+
@Override
38+
public Vertex getOtherVertexFromEdge(Edge r, Vertex oneVertex) {
39+
return null;
40+
}
41+
42+
@Override
43+
public Vertex getSrcVertexFromEdge(Edge edge) {
44+
return null;
45+
}
46+
47+
@Override
48+
public Vertex getDestVertexFromEdge(Edge edge) {
49+
return null;
50+
}
51+
52+
@Override
53+
public Vertex getVertex(Integer i) {
54+
return hugeClient.graph().getVertex(HugeGraphUtils.createId("node",i+""));
55+
}
56+
57+
@Override
58+
public Iterator<Edge> getAllEdges() {
59+
return hugeClient.graph().getEdges().iterator();
60+
}
61+
62+
@Override
63+
public Iterator<Edge> getNeighborsOfVertex(Vertex v) {
64+
return null;
65+
}
66+
67+
@Override
68+
public boolean edgeIteratorHasNext(Iterator<Edge> it) {
69+
return false;
70+
}
71+
72+
@Override
73+
public Edge nextEdge(Iterator<Edge> it) {
74+
return it.next();
75+
}
76+
77+
@Override
78+
public void cleanupEdgeIterator(Iterator<Edge> it) {
79+
80+
}
81+
82+
@Override
83+
public Iterator<Vertex> getVertexIterator() {
84+
return null;
85+
}
86+
87+
@Override
88+
public boolean vertexIteratorHasNext(Iterator<Vertex> it) {
89+
return it.hasNext();
90+
}
91+
92+
@Override
93+
public Vertex nextVertex(Iterator<Vertex> it) {
94+
return it.next();
95+
}
96+
97+
@Override
98+
public void cleanupVertexIterator(Iterator<Vertex> it) {
99+
100+
}
101+
102+
@Override
103+
public void open() {
104+
105+
}
106+
107+
@Override
108+
public void createGraphForSingleLoad() {
109+
110+
}
111+
112+
@Override
113+
public void massiveModeLoading(File dataPath) {
114+
SchemaManager schemaManager = hugeClient.schema();
115+
schemaManager.makePropertyKey("nodeId").asText().ifNotExist().create();
116+
schemaManager.makeVertexLabel("node").properties("nodeId").primaryKeys("nodeId").ifNotExist().create();
117+
schemaManager.makeEdgeLabel("link").link("node","node").ifNotExist().create();
118+
HugeGraphMassiveInsertion massiveInsertion = new HugeGraphMassiveInsertion(this.hugeClient.graph());
119+
massiveInsertion.createGraph(dataPath,0 /* scenarioNumber */);
120+
}
121+
122+
@Override
123+
public void singleModeLoading(File dataPath, File resultsPath, int scenarioNumber) {
124+
125+
}
126+
127+
@Override
128+
public void createGraphForMassiveLoad() {
129+
130+
}
131+
132+
@Override
133+
public void shutdown() {
134+
135+
}
136+
137+
@Override
138+
public void delete() {
139+
140+
}
141+
142+
@Override
143+
public void shutdownMassiveGraph() {
144+
145+
}
146+
147+
@Override
148+
public void shortestPath(Vertex fromNode, Integer node) {
149+
150+
}
151+
152+
@Override
153+
public int getNodeCount() {
154+
return 0;
155+
}
156+
157+
@Override
158+
public Set<Integer> getNeighborsIds(int nodeId) {
159+
return null;
160+
}
161+
162+
@Override
163+
public double getNodeWeight(int nodeId) {
164+
return 0;
165+
}
166+
167+
@Override
168+
public void initCommunityProperty() {
169+
170+
}
171+
172+
@Override
173+
public Set<Integer> getCommunitiesConnectedToNodeCommunities(int nodeCommunities) {
174+
return null;
175+
}
176+
177+
@Override
178+
public Set<Integer> getNodesFromCommunity(int community) {
179+
return null;
180+
}
181+
182+
@Override
183+
public Set<Integer> getNodesFromNodeCommunity(int nodeCommunity) {
184+
return null;
185+
}
186+
187+
@Override
188+
public double getEdgesInsideCommunity(int nodeCommunity, int communityNodes) {
189+
return 0;
190+
}
191+
192+
@Override
193+
public double getCommunityWeight(int community) {
194+
return 0;
195+
}
196+
197+
@Override
198+
public double getNodeCommunityWeight(int nodeCommunity) {
199+
return 0;
200+
}
201+
202+
@Override
203+
public void moveNode(int from, int to) {
204+
205+
}
206+
207+
@Override
208+
public double getGraphWeightSum() {
209+
return 0;
210+
}
211+
212+
@Override
213+
public int reInitializeCommunities() {
214+
return 0;
215+
}
216+
217+
@Override
218+
public int getCommunityFromNode(int nodeId) {
219+
return 0;
220+
}
221+
222+
@Override
223+
public int getCommunity(int nodeCommunity) {
224+
return 0;
225+
}
226+
227+
@Override
228+
public int getCommunitySize(int community) {
229+
return 0;
230+
}
231+
232+
@Override
233+
public Map<Integer, List<Integer>> mapCommunities(int numberOfCommunities) {
234+
return null;
235+
}
236+
237+
@Override
238+
public boolean nodeExists(int nodeId) {
239+
return false;
240+
}
241+
}

0 commit comments

Comments
 (0)