Код: Выделить всё
@Test
public void minimalTest() throws InterruptedException {
// build in-memory backend for janusgraph
JanusGraph graph = JanusGraphFactory.build().set("storage.backend", "inmemory").open();
graph.tx().rollback();
JanusGraphManagement mgmt = graph.openManagement();
// create test prop & commit
String testProp = "testprop";
mgmt.getOrCreatePropertyKey(testProp);
mgmt.commit();
// create test index & commit
mgmt = graph.openManagement();
String testIndex = "testIndex";
mgmt.buildIndex(testIndex, Vertex.class).addKey(mgmt.getPropertyKey(testProp)).buildCompositeIndex();
mgmt.commit();
// attempt to wait for enabled
ManagementSystem.awaitGraphIndexStatus(graph, testIndex).status(SchemaStatus.ENABLED).call();
System.out.println("Gets stuck in the await line above and never makes it here");
}
Код: Выделить всё
@Test
public void minimalTest() throws InterruptedException {
// build in-memory backend for janusgraph
JanusGraph graph = JanusGraphFactory.build().set("storage.backend", "inmemory").open();
graph.tx().rollback();
JanusGraphManagement mgmt = graph.openManagement();
// create test prop & commit
String testProp = "testprop";
mgmt.getOrCreatePropertyKey(testProp);
//mgmt.commit();
// create test index & commit
//mgmt = graph.openManagement();
String testIndex = "testIndex";
mgmt.buildIndex(testIndex, Vertex.class).addKey(mgmt.getPropertyKey(testProp)).buildCompositeIndex();
mgmt.commit();
// attempt to wait for enabled
ManagementSystem.awaitGraphIndexStatus(graph, testIndex).status(SchemaStatus.ENABLED).call();
System.out.println("Gets here fine");
}
Мои версии janusgraph-core и janusgraph-inmemory — 1.0.0, если это вообще имеет значение. Спасибо!
Подробнее здесь: https://stackoverflow.com/questions/781 ... perty-keys