diff options
author | Vitaly Emporopulo <Vitaliy.Emporopulo@amdocs.com> | 2017-11-15 10:35:29 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2017-11-15 10:35:29 +0000 |
commit | d52194fd5b45b5af0e0a9698b456f9945522bd80 (patch) | |
tree | 64f3a63cb4f68d5ad1d39df4e6670985e8c7e446 /openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib | |
parent | 552ef55138ec653fed1d25ac6b9e3ff4bc284db9 (diff) | |
parent | 6a0ab8cbf809e6f0467c65c1916e7b03112a5e3e (diff) |
Merge "Casandra data center and consistency level"
Diffstat (limited to 'openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib')
2 files changed, 5 insertions, 4 deletions
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/main/java/org/openecomp/core/nosqldb/impl/cassandra/CassandraSessionFactory.java b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/main/java/org/openecomp/core/nosqldb/impl/cassandra/CassandraSessionFactory.java index 18b4b06811..519d7b160b 100644 --- a/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/main/java/org/openecomp/core/nosqldb/impl/cassandra/CassandraSessionFactory.java +++ b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/main/java/org/openecomp/core/nosqldb/impl/cassandra/CassandraSessionFactory.java @@ -29,7 +29,6 @@ import com.datastax.driver.core.policies.DCAwareRoundRobinPolicy; import com.datastax.driver.core.policies.LoadBalancingPolicy; import com.datastax.driver.core.policies.TokenAwarePolicy; import com.google.common.base.Optional; -import org.apache.commons.lang.ArrayUtils; import org.openecomp.core.nosqldb.util.CassandraUtils; import org.openecomp.sdc.logging.api.Logger; import org.openecomp.sdc.logging.api.LoggerFactory; @@ -109,7 +108,7 @@ public class CassandraSessionFactory { } private static void setConsistencyLevel(Cluster.Builder builder, String[] addresses) { - if (ArrayUtils.isNotEmpty(addresses) && addresses.length > 1) { + if (addresses != null && addresses.length > 1) { String consistencyLevel = CassandraUtils.getConsistencyLevel(); if (Objects.nonNull(consistencyLevel)) { log.info( diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/main/java/org/openecomp/core/nosqldb/util/ConfigurationManager.java b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/main/java/org/openecomp/core/nosqldb/util/ConfigurationManager.java index fd7c1043e8..5723a6fe61 100644 --- a/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/main/java/org/openecomp/core/nosqldb/util/ConfigurationManager.java +++ b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/main/java/org/openecomp/core/nosqldb/util/ConfigurationManager.java @@ -20,6 +20,7 @@ package org.openecomp.core.nosqldb.util; +import org.apache.commons.collections4.CollectionUtils; import org.openecomp.core.utilities.file.FileUtils; import org.openecomp.sdc.logging.api.Logger; import org.openecomp.sdc.logging.api.LoggerFactory; @@ -116,9 +117,10 @@ public class ConfigurationManager { return addresses.split(","); } List lsAddresses = (ArrayList) cassandraConfiguration.get(CASSANDRA_HOSTS_KEY); - if (Objects.isNull(addresses) || addresses.length() == 0) { - throw new RuntimeException("Missing Cassandra hose.Cassandra host missing is mandatory."); + if (CollectionUtils.isEmpty(lsAddresses)) { + log.info("No Cassandra hosts are defined."); } + String[] addressesArray; addressesArray = (String[]) lsAddresses.toArray(new String[lsAddresses.size()]); return addressesArray; |