use of org.unipop.elastic.common.ElasticClient in project unipop by unipop-graph.
the class ElasticSourceProvider method init.
@Override
public Set<UniQueryController> init(UniGraph graph, JSONObject configuration, TraversalFilter traversalFilter) throws Exception {
this.graph = graph;
List<String> addresses = ConversionUtils.toStringList(configuration, "addresses");
this.client = new ElasticClient(addresses);
Set<DocumentSchema> schemas = new HashSet<>();
for (JSONObject json : getList(configuration, "vertices")) {
schemas.add(createVertexSchema(json));
}
for (JSONObject json : getList(configuration, "edges")) {
schemas.add(createEdgeSchema(json));
}
DocumentController documentController = new DocumentController(schemas, client, graph, traversalFilter);
return Sets.newHashSet(documentController);
}
use of org.unipop.elastic.common.ElasticClient in project unipop by unipop-graph.
the class RestGraphProvider method loadGraphData.
@Override
public void loadGraphData(Graph graph, LoadGraphWith loadGraphWith, Class testClass, String testName) {
ElasticClient client = new ElasticClient(Collections.singletonList("http://localhost:9200"));
client.validateIndex("edge");
client.validateIndex("vertex");
super.loadGraphData(graph, loadGraphWith, testClass, testName);
}
Aggregations