aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--aai-core/src/main/java/org/onap/aai/dbgen/SchemaGenerator.java16
-rw-r--r--aai-els-onap-logging/src/main/java/org/onap/aai/util/AAIConstants.java2
2 files changed, 18 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);
}
diff --git a/aai-els-onap-logging/src/main/java/org/onap/aai/util/AAIConstants.java b/aai-els-onap-logging/src/main/java/org/onap/aai/util/AAIConstants.java
index f44f736c..a1a36189 100644
--- a/aai-els-onap-logging/src/main/java/org/onap/aai/util/AAIConstants.java
+++ b/aai-els-onap-logging/src/main/java/org/onap/aai/util/AAIConstants.java
@@ -157,6 +157,8 @@ public final class AAIConstants {
/** Flag to control concurrency lock */
public static final String AAI_LOCK_URI_ENABLED = "aai.lock.uri.enabled";
+ public static final String AAI_LOCK_RV_ENABLED = "aai.lock.rv.enabled";
+
/**
* Instantiates a new AAI constants.
*/