- do not attempt to create schema-initialized index when it already exists
Issue-ID: AAI-4177
Change-Id: I95f25b767ba03986d8290125b97c35abca756b80
Signed-off-by: Fiete Ostkamp <Fiete.Ostkamp@telekom.de>
private static void createSchemaInitializedIndex(JanusGraph graph, JanusGraphManagement mgmt) throws InterruptedException {
// creating a composite index
private static void createSchemaInitializedIndex(JanusGraph graph, JanusGraphManagement mgmt) throws InterruptedException {
// creating a composite index
+ boolean indexExists = mgmt.containsGraphIndex(SCHEMA_INITIALIZED);
+ if(indexExists) {
+ LOGGER.debug(SCHEMA_INITIALIZED + " index already exists. Skipping creation.");
+ return;
+ }
LOGGER.debug("-- Building an index on property schema-initialized");
PropertyKey schemaInitialized = mgmt.makePropertyKey(SCHEMA_INITIALIZED).dataType(Boolean.class).make();
mgmt.buildIndex(SCHEMA_INITIALIZED, Vertex.class)
LOGGER.debug("-- Building an index on property schema-initialized");
PropertyKey schemaInitialized = mgmt.makePropertyKey(SCHEMA_INITIALIZED).dataType(Boolean.class).make();
mgmt.buildIndex(SCHEMA_INITIALIZED, Vertex.class)