aboutsummaryrefslogtreecommitdiffstats
path: root/catalog-dao/src
diff options
context:
space:
mode:
authorMichaelMorris <michael.morris@est.tech>2021-11-11 10:35:02 +0000
committerAndr� Schmid <andre.schmid@est.tech>2021-11-12 09:19:19 +0000
commit3a811e1483ab42dc31fd62a979399a4bf83b279e (patch)
treedf19091298fdbecd42cc8be4d412b3ed851b77b1 /catalog-dao/src
parent46ccb96229c938c2f21114cb4f1e13aea188a350 (diff)
Fix stability test issue
Failures in stability tests are observed on attempts to get distribution status from SDC backend. These errors are caused by timeouts when reading from the DB (5 sec) and also the reads exceeding the tombstone threshold (100,000). The fix implemented in this change is two fold: 1. Stop writing null values in empty columns in DB writes (a tombstone is created for each null column value) 2. Change the query to the DB to remove the unnecessary filtering which greatly increases the time taken for the read. Failures in stability tests are also observed due to failures in parsing YAML files from VSP. The files are parsed using snakeYAML. The class used is not thread safe however it is possible for it to be invoked in multiple threads. This is most likely the cause of the parsing failures The fix implemented here includes changes to ensure an instance of the Yaml class is not used across multiple threads Signed-off-by: MichaelMorris <michael.morris@est.tech> Issue-ID: SDC-3773 Change-Id: I4067ff0032bb67ab114db2f05accce5d7b42d188
Diffstat (limited to 'catalog-dao/src')
-rw-r--r--catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/AuditAccessor.java2
-rw-r--r--catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/CassandraClient.java2
2 files changed, 2 insertions, 2 deletions
diff --git a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/AuditAccessor.java b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/AuditAccessor.java
index 482ece7f10..ad9d01e77d 100644
--- a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/AuditAccessor.java
+++ b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/AuditAccessor.java
@@ -32,7 +32,7 @@ import org.openecomp.sdc.be.resources.data.auditing.ResourceAdminEvent;
public interface AuditAccessor {
// ***** distributionstatusevent table
- @Query("SELECT * FROM sdcaudit.distributionstatusevent WHERE DID = :did AND ACTION = 'DStatus' ALLOW FILTERING")
+ @Query("SELECT * FROM sdcaudit.distributionstatusevent WHERE DID = :did")
Result<DistributionStatusEvent> getListOfDistributionStatuses(@Param("did") String did);
// ***** resourceadminevent table
diff --git a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/CassandraClient.java b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/CassandraClient.java
index 25a6b49bba..3bd318c7b8 100644
--- a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/CassandraClient.java
+++ b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/CassandraClient.java
@@ -154,7 +154,7 @@ public class CassandraClient {
}
try {
Mapper<T> mapper = manager.mapper(clazz);
- mapper.save(entity);
+ mapper.save(entity, Mapper.Option.saveNullFields(false));
} catch (Exception e) {
logger.error(EcompLoggerErrorCode.DATA_ERROR, CassandraClient.class.getName(), "Failed to save entity [{}], error :", entity, e);
return CassandraOperationStatus.GENERAL_ERROR;