Skip to content
This repository was archived by the owner on Oct 5, 2021. It is now read-only.

Commit 743cdb1

Browse files
committed
'Version 1.1.0 of the Amazon DynamoDB Storage Backend for JanusGraph 0.1.1'
1 parent 8faefcd commit 743cdb1

File tree

7 files changed

+87
-83
lines changed

7 files changed

+87
-83
lines changed

pom.xml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
<version>1.1.0</version>
66
<packaging>jar</packaging>
77
<name>Amazon DynamoDB Storage Backend for JanusGraph</name>
8-
<url>https://github.com/awslabs/dynamodb-titan-storage-backend</url>
8+
<url>https://github.com/awslabs/dynamodb-janusgraph-storage-backend</url>
99
<description>The Amazon DynamoDB Storage Backend for JanusGraph: Distributed Graph Database allows JanusGraph graphs to use DynamoDB as a storage backend.</description>
1010
<scm>
11-
<url>[email protected]:awslabs/dynamodb-titan-storage-backend.git</url>
12-
<tag>janusgraph0.1.1-1.0.0</tag>
11+
<url>[email protected]:awslabs/dynamodb-janusgraph-storage-backend.git</url>
12+
<tag>jg0.1.1-1.1.0</tag>
1313
</scm>
1414
<properties>
1515
<default.test.jvm.opts>-Xms256m -Xmx1280m -XX:+HeapDumpOnOutOfMemoryError</default.test.jvm.opts>
@@ -149,6 +149,7 @@
149149
<artifactId>aws-java-sdk-core</artifactId>
150150
<version>${aws.java.sdk.version}</version>
151151
</dependency>
152+
<!--TODO remove log4j if possible-->
152153
<dependency>
153154
<groupId>log4j</groupId>
154155
<artifactId>log4j</artifactId>

src/main/java/com/amazon/janusgraph/example/MarvelGraphFactory.java

100755100644
Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -39,32 +39,31 @@
3939
import org.janusgraph.core.PropertyKey;
4040
import org.janusgraph.core.schema.JanusGraphManagement;
4141
import org.janusgraph.util.stats.MetricManager;
42-
import org.slf4j.Logger;
43-
import org.slf4j.LoggerFactory;
4442

4543
import com.codahale.metrics.ConsoleReporter;
4644
import com.codahale.metrics.MetricRegistry;
4745

4846
import au.com.bytecode.opencsv.CSVReader;
4947
import lombok.Getter;
5048
import lombok.RequiredArgsConstructor;
49+
import lombok.extern.slf4j.Slf4j;
5150

5251
/**
5352
*
5453
* @author Matthew Sowders
5554
* @author Alexander Patrikalakis
5655
*
5756
*/
57+
@Slf4j
5858
public class MarvelGraphFactory {
5959
private static final SecureRandom RANDOM = new SecureRandom();
6060
private static final int BATCH_SIZE = 10;
61-
private static final Logger LOG = LoggerFactory.getLogger(MarvelGraphFactory.class);
6261
public static final String APPEARED = "appeared";
6362
public static final String COMIC_BOOK = "comic-book";
6463
public static final String CHARACTER = "character";
6564
public static final String WEAPON = "weapon";
6665
public static final MetricRegistry REGISTRY = MetricManager.INSTANCE.getRegistry();
67-
public static final ConsoleReporter REPORTER = ConsoleReporter.forRegistry(REGISTRY).build();
66+
private static final ConsoleReporter REPORTER = ConsoleReporter.forRegistry(REGISTRY).build();
6867
private static final String TIMER_LINE = "MarvelGraph.line";
6968
private static final String TIMER_CREATE = "MarvelGraph.create_";
7069
private static final String COUNTER_GET = "MarvelGraph.get_";
@@ -140,15 +139,15 @@ public static void load(final JanusGraph graph, final int rowsToLoad, final bool
140139
maxAppearances = numberOfAppearances;
141140
}
142141
}
143-
LOG.info("Character {} has most appearances at {}", maxCharacter, maxAppearances);
142+
log.info("Character {} has most appearances at {}", maxCharacter, maxAppearances);
144143

145144
ExecutorService executor = Executors.newFixedThreadPool(POOL_SIZE);
146145
for (int i = 0; i < POOL_SIZE; i++) {
147146
executor.execute(new BatchCommand(graph, creationQueue));
148147
}
149148
executor.shutdown();
150149
while (!executor.awaitTermination(60, TimeUnit.SECONDS)) {
151-
LOG.info("Awaiting:" + creationQueue.size());
150+
log.info("Awaiting:" + creationQueue.size());
152151
if(report) {
153152
REPORTER.report();
154153
}
@@ -159,12 +158,12 @@ public static void load(final JanusGraph graph, final int rowsToLoad, final bool
159158

160159
executor.shutdown();
161160
while (!executor.awaitTermination(60, TimeUnit.SECONDS)) {
162-
LOG.info("Awaiting:" + appearedQueue.size());
161+
log.info("Awaiting:" + appearedQueue.size());
163162
if(report) {
164163
REPORTER.report();
165164
}
166165
}
167-
LOG.info("MarvelGraph.load complete");
166+
log.info("MarvelGraph.load complete");
168167
}
169168

170169
@RequiredArgsConstructor
@@ -189,21 +188,21 @@ public void run() {
189188
} catch (Throwable e) {
190189
Throwable rootCause = ExceptionUtils.getRootCause(e);
191190
String rootCauseMessage = null == rootCause ? "" : rootCause.getMessage();
192-
LOG.error("Error processing comic book {} {}", e.getMessage(), rootCauseMessage, e);
191+
log.error("Error processing comic book {} {}", e.getMessage(), rootCauseMessage, e);
193192
}
194193
if (i++ % BATCH_SIZE == 0) {
195194
try {
196195
graph.tx().commit();
197196
} catch (Throwable e) {
198-
LOG.error("error processing commit {} {}", e.getMessage(), ExceptionUtils.getRootCause(e).getMessage());
197+
log.error("error processing commit {} {}", e.getMessage(), ExceptionUtils.getRootCause(e).getMessage());
199198
}
200199
}
201200

202201
}
203202
try {
204203
graph.tx().commit();
205204
} catch (Throwable e) {
206-
LOG.error("error processing commit {} {}", e.getMessage(), ExceptionUtils.getRootCause(e).getMessage());
205+
log.error("error processing commit {} {}", e.getMessage(), ExceptionUtils.getRootCause(e).getMessage());
207206
}
208207
}
209208

@@ -261,7 +260,7 @@ public void run() {
261260
} catch (Throwable e) {
262261
Throwable rootCause = ExceptionUtils.getRootCause(e);
263262
String rootCauseMessage = null == rootCause ? "" : rootCause.getMessage();
264-
LOG.error("Error processing line {} {}", e.getMessage(), rootCauseMessage, e);
263+
log.error("Error processing line {} {}", e.getMessage(), rootCauseMessage, e);
265264
} finally {
266265
COMPLETED_TASK_COUNT.incrementAndGet();
267266
}

src/test/java/com/amazon/janusgraph/GraphOfTheGodsTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ public class GraphOfTheGodsTest {
4848

4949
private final JanusGraph graph;
5050

51-
@Parameterized.Parameters(name = "{0}")
51+
//TODO
52+
@Parameterized.Parameters//(name = "{0}")
5253
public static Collection<Object[]> data() {
5354
return TestCombination.NATIVE_LOCKING_CROSS_MODELS;
5455
}

src/test/java/com/amazon/janusgraph/MarvelTest.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
import java.util.Collection;
2121
import java.util.Iterator;
2222

23-
import com.amazon.janusgraph.example.MarvelGraphFactory;
2423
import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource;
2524
import org.apache.tinkerpop.gremlin.structure.Direction;
2625
import org.apache.tinkerpop.gremlin.structure.Edge;
@@ -36,6 +35,7 @@
3635
import org.junit.runners.Parameterized;
3736

3837
import com.amazon.janusgraph.diskstorage.dynamodb.BackendDataModel;
38+
import com.amazon.janusgraph.example.MarvelGraphFactory;
3939
import com.amazon.janusgraph.graphdb.dynamodb.TestCombination;
4040
import com.amazon.janusgraph.testcategory.IsolateRemainingTestsCategory;
4141
import com.codahale.metrics.MetricRegistry;
@@ -63,7 +63,8 @@ public void tearDownGraph() throws BackendException {
6363
TestGraphUtil.instance.tearDownGraph(graph);
6464
}
6565

66-
@Parameterized.Parameters(name = "{0}")
66+
//TODO
67+
@Parameterized.Parameters//(name = "{0}")
6768
public static Collection<Object[]> data() {
6869
return TestCombination.NATIVE_LOCKING_CROSS_MODELS;
6970
}

src/test/java/com/amazon/janusgraph/ScenarioTests.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ public class Triple {
140140
this.rightPropertyValue = right[1];
141141
}
142142
}
143+
143144
private static void createHotelSchema(JanusGraph graph) {
144145
//another issue, you should only try to create the schema once.
145146
//you use uniqueness constraints, so you need to define the schema up front with the unique() call,
@@ -169,9 +170,9 @@ private void tripleIngestBase(BiConsumer<StandardJanusGraph, List<Triple>> write
169170
final List<Triple> lines;
170171
try (final BufferedReader bf = new BufferedReader(new InputStreamReader(url.openStream()))) {
171172
lines = bf.lines()
172-
.map(line -> line.split("\t"))
173-
.map(Triple::new)
174-
.collect(Collectors.toList());
173+
.map(line -> line.split("\t"))
174+
.map(Triple::new)
175+
.collect(Collectors.toList());
175176
} catch (IOException e) {
176177
throw new IllegalStateException("Error processing triple file", e);
177178
}
@@ -208,6 +209,7 @@ public void processTripleWithTraversals() throws BackendException {
208209
watch.stop();
209210
});
210211
}
212+
211213
private static Vertex getVertexIfDoesntExist(GraphTraversalSource g,
212214
String propertyName, String propertyValue) {
213215
return g.V()

src/test/java/com/amazon/janusgraph/diskstorage/dynamodb/DynamoDBLockStoreTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ public class DynamoDBLockStoreTest extends LockKeyColumnValueStoreTest {
5454

5555
private final CiHeartbeat ciHeartbeat;
5656

57-
58-
@Parameterized.Parameters(name = "{0}")
57+
//TODO
58+
@Parameterized.Parameters//(name = "{0}")
5959
public static Collection<Object[]> data() {
6060
return TestCombination.LOCKING_CROSS_MODELS;
6161
}

src/test/resources/META-INF/HotelTriples.txt

100755100644
Lines changed: 60 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,60 @@
1-
name:JW Marriott instanceOf name:Marriott International, Inc.
2-
name:The Ritz-Carlton instanceOf name:Marriott International, Inc.
3-
name:St. Regis instanceOf name:Marriott International, Inc.
4-
name:Bulgari Hotels & Resorts instanceOf name:Marriott International, Inc.
5-
name:Edition Hotels instanceOf name:Marriott International, Inc.
6-
name:The Luxury Collection instanceOf name:Marriott International, Inc.
7-
name:W Hotels instanceOf name:Marriott International, Inc.
8-
name:Delta Hotels instanceOf name:Marriott International, Inc.
9-
name:Marriott instanceOf name:Marriott International, Inc.
10-
name:Marriott Vacation Club instanceOf name:Marriott International, Inc.
11-
name:Sheraton instanceOf name:Marriott International, Inc.
12-
name:Autograph Collection instanceOf name:Marriott International, Inc.
13-
name:Design Hotels instanceOf name:Marriott International, Inc.
14-
name:Gaylord Hotels instanceOf name:Marriott International, Inc.
15-
name:Le Méridien instanceOf name:Marriott International, Inc.
16-
name:Renaissance Hotels instanceOf name:Marriott International, Inc.
17-
name:Tribute Portfolio instanceOf name:Marriott International, Inc.
18-
name:Westin instanceOf name:Marriott International, Inc.
19-
name:Courtyard by Marriott instanceOf name:Marriott International, Inc.
20-
name:Fairfield Inn by Marriott instanceOf name:Marriott International, Inc.
21-
name:Four Points by Sheraton instanceOf name:Marriott International, Inc.
22-
name:Protea Hotels by Marriott instanceOf name:Marriott International, Inc.
23-
name:SpringHill Suites by Marriott instanceOf name:Marriott International, Inc.
24-
name:AC Hotels instanceOf name:Marriott International, Inc.
25-
name:Aloft Hotels instanceOf name:Marriott International, Inc.
26-
name:Moxy Hotels instanceOf name:Marriott International, Inc.
27-
name:Marriott Executive Apartments instanceOf name:Marriott International, Inc.
28-
name:Residence Inn by Marriott instanceOf name:Marriott International, Inc.
29-
name:TownePlace Suites by Marriott instanceOf name:Marriott International, Inc.
30-
name:Element by Westin instanceOf name:Marriott International, Inc.
31-
name:JW Marriott hotelBrandType brandtype:Classic Luxury
32-
name:The Ritz-Carlton hotelBrandType brandtype:Classic Luxury
33-
name:St. Regis hotelBrandType brandtype:Classic Luxury
34-
name:Bulgari Hotels & Resorts hotelBrandType brandtype:Distinctive Luxury
35-
name:Edition Hotels hotelBrandType brandtype:Distinctive Luxury
36-
name:The Luxury Collection hotelBrandType brandtype:Distinctive Luxury
37-
name:W Hotels hotelBrandType brandtype:Distinctive Luxury
38-
name:Delta Hotels hotelBrandType brandtype:Classic Premium
39-
name:Marriott hotelBrandType brandtype:Classic Premium
40-
name:Marriott Vacation Club hotelBrandType brandtype:Classic Premium
41-
name:Sheraton hotelBrandType brandtype:Classic Premium
42-
name:Autograph Collection hotelBrandType brandtype:Distinctive Premium
43-
name:Design Hotels hotelBrandType brandtype:Distinctive Premium
44-
name:Gaylord Hotels hotelBrandType brandtype:Distinctive Premium
45-
name:Le Méridien hotelBrandType brandtype:Distinctive Premium
46-
name:Renaissance Hotels hotelBrandType brandtype:Distinctive Premium
47-
name:Tribute Portfolio hotelBrandType brandtype:Distinctive Premium
48-
name:Westin hotelBrandType brandtype:Distinctive Premium
49-
name:Courtyard by Marriott hotelBrandType brandtype:Classic Select
50-
name:Fairfield Inn by Marriott hotelBrandType brandtype:Classic Select
51-
name:Four Points by Sheraton hotelBrandType brandtype:Classic Select
52-
name:Protea Hotels by Marriott hotelBrandType brandtype:Classic Select
53-
name:SpringHill Suites by Marriott hotelBrandType brandtype:Classic Select
54-
name:AC Hotels hotelBrandType brandtype:Distinctive Select
55-
name:Aloft Hotels hotelBrandType brandtype:Distinctive Select
56-
name:Moxy Hotels hotelBrandType brandtype:Distinctive Select
57-
name:Marriott Executive Apartments hotelBrandType brandtype:Classic Longer Stays
58-
name:Residence Inn by Marriott hotelBrandType brandtype:Classic Longer Stays
59-
name:TownePlace Suites by Marriott hotelBrandType brandtype:Classic Longer Stays
60-
name:Element by Westin hotelBrandType brandtype:Distinctive Longer Stays
1+
name:JW Marriott instanceOf name:Marriott International, Inc.
2+
name:The Ritz-Carlton instanceOf name:Marriott International, Inc.
3+
name:St. Regis instanceOf name:Marriott International, Inc.
4+
name:Bulgari Hotels & Resorts instanceOf name:Marriott International, Inc.
5+
name:Edition Hotels instanceOf name:Marriott International, Inc.
6+
name:The Luxury Collection instanceOf name:Marriott International, Inc.
7+
name:W Hotels instanceOf name:Marriott International, Inc.
8+
name:Delta Hotels instanceOf name:Marriott International, Inc.
9+
name:Marriott instanceOf name:Marriott International, Inc.
10+
name:Marriott Vacation Club instanceOf name:Marriott International, Inc.
11+
name:Sheraton instanceOf name:Marriott International, Inc.
12+
name:Autograph Collection instanceOf name:Marriott International, Inc.
13+
name:Design Hotels instanceOf name:Marriott International, Inc.
14+
name:Gaylord Hotels instanceOf name:Marriott International, Inc.
15+
name:Le Méridien instanceOf name:Marriott International, Inc.
16+
name:Renaissance Hotels instanceOf name:Marriott International, Inc.
17+
name:Tribute Portfolio instanceOf name:Marriott International, Inc.
18+
name:Westin instanceOf name:Marriott International, Inc.
19+
name:Courtyard by Marriott instanceOf name:Marriott International, Inc.
20+
name:Fairfield Inn by Marriott instanceOf name:Marriott International, Inc.
21+
name:Four Points by Sheraton instanceOf name:Marriott International, Inc.
22+
name:Protea Hotels by Marriott instanceOf name:Marriott International, Inc.
23+
name:SpringHill Suites by Marriott instanceOf name:Marriott International, Inc.
24+
name:AC Hotels instanceOf name:Marriott International, Inc.
25+
name:Aloft Hotels instanceOf name:Marriott International, Inc.
26+
name:Moxy Hotels instanceOf name:Marriott International, Inc.
27+
name:Marriott Executive Apartments instanceOf name:Marriott International, Inc.
28+
name:Residence Inn by Marriott instanceOf name:Marriott International, Inc.
29+
name:TownePlace Suites by Marriott instanceOf name:Marriott International, Inc.
30+
name:Element by Westin instanceOf name:Marriott International, Inc.
31+
name:JW Marriott hotelBrandType brandtype:Classic Luxury
32+
name:The Ritz-Carlton hotelBrandType brandtype:Classic Luxury
33+
name:St. Regis hotelBrandType brandtype:Classic Luxury
34+
name:Bulgari Hotels & Resorts hotelBrandType brandtype:Distinctive Luxury
35+
name:Edition Hotels hotelBrandType brandtype:Distinctive Luxury
36+
name:The Luxury Collection hotelBrandType brandtype:Distinctive Luxury
37+
name:W Hotels hotelBrandType brandtype:Distinctive Luxury
38+
name:Delta Hotels hotelBrandType brandtype:Classic Premium
39+
name:Marriott hotelBrandType brandtype:Classic Premium
40+
name:Marriott Vacation Club hotelBrandType brandtype:Classic Premium
41+
name:Sheraton hotelBrandType brandtype:Classic Premium
42+
name:Autograph Collection hotelBrandType brandtype:Distinctive Premium
43+
name:Design Hotels hotelBrandType brandtype:Distinctive Premium
44+
name:Gaylord Hotels hotelBrandType brandtype:Distinctive Premium
45+
name:Le Méridien hotelBrandType brandtype:Distinctive Premium
46+
name:Renaissance Hotels hotelBrandType brandtype:Distinctive Premium
47+
name:Tribute Portfolio hotelBrandType brandtype:Distinctive Premium
48+
name:Westin hotelBrandType brandtype:Distinctive Premium
49+
name:Courtyard by Marriott hotelBrandType brandtype:Classic Select
50+
name:Fairfield Inn by Marriott hotelBrandType brandtype:Classic Select
51+
name:Four Points by Sheraton hotelBrandType brandtype:Classic Select
52+
name:Protea Hotels by Marriott hotelBrandType brandtype:Classic Select
53+
name:SpringHill Suites by Marriott hotelBrandType brandtype:Classic Select
54+
name:AC Hotels hotelBrandType brandtype:Distinctive Select
55+
name:Aloft Hotels hotelBrandType brandtype:Distinctive Select
56+
name:Moxy Hotels hotelBrandType brandtype:Distinctive Select
57+
name:Marriott Executive Apartments hotelBrandType brandtype:Classic Longer Stays
58+
name:Residence Inn by Marriott hotelBrandType brandtype:Classic Longer Stays
59+
name:TownePlace Suites by Marriott hotelBrandType brandtype:Classic Longer Stays
60+
name:Element by Westin hotelBrandType brandtype:Distinctive Longer Stays

0 commit comments

Comments
 (0)