use of org.onap.aai.db.schema.DBIndex in project aai-graphadmin by onap.
the class ManageSchemaTest method addNewIndex.
@Test
public void addNewIndex() throws JsonParseException, JsonMappingException, IOException {
ObjectMapper mapper = new ObjectMapper();
String content = " {\r\n" + " \"name\" : \"equipment-name\",\r\n" + " \"unique\" : false,\r\n" + " \"properties\" : [ {\r\n" + " \"name\" : \"equipment-name\",\r\n" + " \"cardinality\" : \"SINGLE\",\r\n" + " \"typeClass\" : \"java.lang.String\"\r\n" + " } ]\r\n" + " }";
DBIndex index = mapper.readValue(content, DBIndex.class);
ManageJanusGraphSchema schema = new ManageJanusGraphSchema(graph, auditorFactory, schemaVersions, edgeIngestor);
JanusGraphManagement mgmt = graph.openManagement();
Set<String> instances = mgmt.getOpenInstances();
System.out.println(instances);
schema.updateIndex(index);
graph.close();
}
Aggregations