summaryrefslogtreecommitdiffstats
path: root/aai-core/src
diff options
context:
space:
mode:
Diffstat (limited to 'aai-core/src')
-rw-r--r--aai-core/src/main/java/org/onap/aai/dbgen/SchemaGenerator.java16
1 files changed, 16 insertions, 0 deletions
diff --git a/aai-core/src/main/java/org/onap/aai/dbgen/SchemaGenerator.java b/aai-core/src/main/java/org/onap/aai/dbgen/SchemaGenerator.java
index 37d497ab..9f3e7475 100644
--- a/aai-core/src/main/java/org/onap/aai/dbgen/SchemaGenerator.java
+++ b/aai-core/src/main/java/org/onap/aai/dbgen/SchemaGenerator.java
@@ -126,6 +126,14 @@ public class SchemaGenerator {
graphMgmt.setConsistency(propK, ConsistencyModifier.LOCK);
}
}
+ else if (dbPropName.equals("resource-version")) {
+ String aai_rv_lock_enabled = AAIConfig.get(AAIConstants.AAI_LOCK_RV_ENABLED, "false");
+ LOGGER.info(" Info: aai_rv_lock_enabled:" + aai_rv_lock_enabled);
+ if ("true".equals(aai_rv_lock_enabled)) {
+ LOGGER.info(" Lock is being set for resource-version Property.");
+ graphMgmt.setConsistency(propK, ConsistencyModifier.LOCK);
+ }
+ }
seenProps.put(dbPropName, propK);
} else {
propK = seenProps.get(dbPropName);
@@ -151,6 +159,14 @@ public class SchemaGenerator {
graphMgmt.setConsistency(indexG, ConsistencyModifier.LOCK);
}
}
+ else if (indexG != null && dbPropName.equals("resource-version")) {
+ String aai_rv_lock_enabled = AAIConfig.get(AAIConstants.AAI_LOCK_RV_ENABLED, "false");
+ LOGGER.info(" Info:: aai_rv_lock_enabled:" + aai_rv_lock_enabled);
+ if ("true".equals(aai_rv_lock_enabled)) {
+ LOGGER.info("Lock is being set for resource-version Index.");
+ graphMgmt.setConsistency(indexG, ConsistencyModifier.LOCK);
+ }
+ }
} else {
LOGGER.info("No index added for PropertyKey: [{}]", dbPropName);
}