Code Review
/
aai
/
aai-common.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Enhance SchemaGenerator to also generate indices for relationships
[aai/aai-common.git]
/
aai-core
/
src
/
main
/
java
/
org
/
onap
/
aai
/
dbmap
/
AAIGraph.java
diff --git
a/aai-core/src/main/java/org/onap/aai/dbmap/AAIGraph.java
b/aai-core/src/main/java/org/onap/aai/dbmap/AAIGraph.java
index
cb388cc
..
d9994f5
100644
(file)
--- a/
aai-core/src/main/java/org/onap/aai/dbmap/AAIGraph.java
+++ b/
aai-core/src/main/java/org/onap/aai/dbmap/AAIGraph.java
@@
-147,14
+147,14
@@
public class AAIGraph {
private void loadSchema(JanusGraph graph) {
// Load the propertyKeys, indexes and edge-Labels into the DB
private void loadSchema(JanusGraph graph) {
// Load the propertyKeys, indexes and edge-Labels into the DB
- JanusGraphManagement graphMgt = graph.openManagement();
-
+ boolean dbNotEmpty = graph.traversal().V().limit(1).hasNext();
logger.info("-- loading schema into JanusGraph");
if ("true".equals(
logger.info("-- loading schema into JanusGraph");
if ("true".equals(
- SpringContextAware.getApplicationContext().getEnvironment().getProperty("history.enabled", "false"))) {
+ SpringContextAware.getApplicationContext().getEnvironment().getProperty("history.enabled", "false"))) {
+ JanusGraphManagement graphMgt = graph.openManagement();
SchemaGenerator4Hist.loadSchemaIntoJanusGraph(graphMgt, IN_MEMORY);
} else {
SchemaGenerator4Hist.loadSchemaIntoJanusGraph(graphMgt, IN_MEMORY);
} else {
- SchemaGenerator.loadSchemaIntoJanusGraph(graph
Mgt, IN_MEMORY
);
+ SchemaGenerator.loadSchemaIntoJanusGraph(graph
, IN_MEMORY, dbNotEmpty
);
}
}
}
}