use of org.unipop.elastic.document.DocumentSchema 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);
}
Aggregations