diff options
author | 2018-06-02 21:35:48 +0300 | |
---|---|---|
committer | 2018-06-02 21:35:48 +0300 | |
commit | 76be68d39688617e46ab5dba1b5865ed4cb85b69 (patch) | |
tree | 17e3a109e6c9b5da7d2ff5222b51de60a5d69d0d /catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/schema/SdcSchemaUtils.java | |
parent | 0a3c4290cc8d29ac42413994a05c438ff06edd6f (diff) |
tine out configuration not usedv1.2.0
Change-Id: I55c81975cd40b81510b18865e32e2f5394718349
Issue-ID: SDC-1344
Signed-off-by: Michael Lando <ml636r@att.com>
Diffstat (limited to 'catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/schema/SdcSchemaUtils.java')
-rw-r--r-- | catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/schema/SdcSchemaUtils.java | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/schema/SdcSchemaUtils.java b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/schema/SdcSchemaUtils.java index e1e33871b1..ca737b2a5d 100644 --- a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/schema/SdcSchemaUtils.java +++ b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/schema/SdcSchemaUtils.java @@ -22,6 +22,7 @@ package org.openecomp.sdc.be.dao.cassandra.schema; import java.util.List; +import com.datastax.driver.core.SocketOptions; import org.openecomp.sdc.be.config.ConfigurationManager; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -73,6 +74,18 @@ public class SdcSchemaUtils { System.setProperty("javax.net.ssl.trustStorePassword", truststorePassword); clusterBuilder.withSSL(); } + SocketOptions socketOptions =new SocketOptions(); + Integer socketConnectTimeout = ConfigurationManager.getConfigurationManager().getConfiguration().getCassandraConfig().getSocketConnectTimeout(); + if( socketConnectTimeout!=null ){ + log.info("SocketConnectTimeout was provided, setting Cassandra client to use SocketConnectTimeout: {} .",socketConnectTimeout); + socketOptions.setConnectTimeoutMillis(socketConnectTimeout); + } + Integer socketReadTimeout = ConfigurationManager.getConfigurationManager().getConfiguration().getCassandraConfig().getSocketReadTimeout(); + if( socketReadTimeout != null ){ + log.info("SocketReadTimeout was provided, setting Cassandra client to use SocketReadTimeout: {} .",socketReadTimeout); + socketOptions.setReadTimeoutMillis(socketReadTimeout); + } + clusterBuilder.withSocketOptions(socketOptions); return clusterBuilder.build(); } |